Closed basilhussain closed 4 years ago
Could you test your proposed fix and file a pull request?
I tried to test the fix back when I first filed this issue, but unfortunately I didn't have any success attempting to build stm8flash on Windows (with MinGW). Mostly down to issues with the makefile, I think, but I don't know enough about make, etc. to know exactly what was wrong or to fix it. Sorry.
I managed to set up a Linux build environment and make this fix. See pull request #129.
By the way, I think the README file could do with some additions describing how to build, and the prerequisites for doing so. I found you cannot build stm8flash on a default Debian install without first installing libusb-1.0-0-dev
and pkg-config
packages.
When reading flash memory from devices with more than 32KB of flash memory (e.g. STM8S208RB with 128KB), an invalid Intel Hex file is written.
All data records following all but the first 'Extended Linear Address' (ELA) record have incorrect address fields. The problem is that stm8flash seems to be incorrectly including the upper bytes of the address extension when outputting all following addresses.
Some examples:
Note that after the ELA records, there are 5 digits for the address - e.g. "10020".
I believe the problem lies in line 133 of ihex.c, where
chunk_start
should probably be changed tochunk_start & 0xffff
. I have not tested this, though.