gicking / STM8_serial_flasher

PC tool for uplading hexfiles to the STM8 microcontroller via COM port or USB, using the built-in ROM bootloader. Works under Windows and Posix operating systems
25 stars 7 forks source link

Intel hex file has unsupported type 5 #13

Closed SingingFrog7 closed 8 years ago

SingingFrog7 commented 8 years ago

Hey guys

it may be a stupid question, but I built the software and seems able to run it, but my hex files return errors. I try to program an STM8L with the following command: ./STM8_serial_flasher -p /dev/ttymxc3 -w project.hex -r 2 -Q

(Yes, my software supports the Re5eT command.)

The same files work in the ST-LINK software

The error I have:

Error: Line 324 of Intel hex file has unsupported type 5

If one of you know what's going on, it would be really cool! Thanks!

gicking commented 8 years ago

hi joe540,

sorry to hear you have problems! Can you please forward me your hex file via mail to "icking at online home dot de" for checking? By the way, what compiler are you using with what linker option? Because I never came across a STM8 Intel hex file with record type 5. Actually, according to this link, IHX record type 5 is ARM specific...? Thanks in advance!

Georg

gicking commented 8 years ago

hi again,

record type 5 = "start linear address records" apparently set the start address of the code. For STM8 this is always 0x8000, so I guess I can ignore record types 05 (also see here).

I have just updated the project on Github. Can you please re-try? Thanks in advance!

Georg

SingingFrog7 commented 8 years ago

Hi gicking, I use IAR Embedded Workbench, but not by choice, only because my program was started with (by the last guy). I will be able to provide my linker option on monday morning, if it's still needed for debugging purpose.

For the 05 records, that's the conclusion I had from my search (I don't know why my compiler add that line at the end of the code...) I was about to simply remove the 05 line from my HEX file manually, (which would have the same result as ignoring it from the code).

I'll have to test it on monday and I'll let you know!

Thanks for your fast answer and have a nice weekend, Jonathan

SingingFrog7 commented 8 years ago

Hi Georg,

It works, the record type 5 was useless (I still don't know why my compiler add it, there's no linker option for anything related to that...)

My program works perfectly so just ignoring that type of record seems to be the way to do for STM8 programs!

Thanks, I closed the issue as it as been resolved.

SingingFrog7 commented 8 years ago

I think there's an error in your last commit:

hexfile.c:358:46: error: ‘addrStart’ redeclared as different kind of symbol uint32_t addr, addrMin, addrMax, addrOff, addrStart, val; ^ hexfile.c:353:39: note: previous definition of ‘addrStart’ was here void convert_hex(char _buf, uint32_t addrStart, uint32_t numBytes, char image) { ^ hexfile.c:468:3: error: invalid type argument of unary ‘_’ (have ‘uint32_t {aka unsigned int}’) addrStart = addrMin;

I will try to remove the new declaration of addrStart and try to make again

gicking commented 8 years ago

yep you're completely right, I overlooked that :-( I just fixed it by changing the name. Thanks again for pointing it out!