Hi. I am using the Keil "OBJECT TO HEX FILE CONVERTER OH51 V2.6" to convert the OMF file to an Intel .HEX file to download into the C8051F120 part using the Cygnal IDE v1.8. I have a bootloader at address 0000H and the application I am downloading starts at 0C00H. All worked well until my application code got larger. It is now approx. 62k and the bootloader now fails with "Checksum Failure" after a certain number of bytes while downloading the .HEX file. Could there be a problem in the OH51.EXE converter? I downloaded the .HEX file generated from OH51 directly using the Cygnal IDE, without my bootloader, and it fails to execute. I am stumped. Any advice on what I should try? From my point of view it seems like the OH51.EXE isn't generating the correct .HEX file when my app is in the 60k range. That just might be a symptom of something else though, I don't know. Anyone have any ideas? Thank you very much.
Cygnal F020 devices have 64K flash, howewer, the addresses from 0xFDFD and above cannot be used for code storage. Check linker map file (*.m51 or *.map) that your code ends BEFORE 0xFDFD... regards Dejan
Last line in the code memory in the M51 file is: CODE FB38H 0004H UNIT ?CO?ISR
the bootloader now fails with "Checksum Failure" after a certain number of bytes while downloading the .HEX file Well, if you have the HEX file and if you know the address where the error occurs, you can easily check the HEX file to verify that it is correct. The HEX file format is described at http://www.keil.com/support/docs/1584.htm. Alternatively, you could download the HEX2BIN utility and see if it complains about the checksum. Jon
Yes. I wrote a little utility app that goes through the file and checks all the checksums on each line. The file is fine. What is happening is my bootloader performs the checksum on the databytes written to flash. So it reads them from flash memory to perform the checksum and that is when it fails. However, when I download that same HEX file using the Cygnal IDE, it works. So I'm stumped.
What is happening is my bootloader performs the checksum on the databytes written to flash. So it reads them from flash memory to perform the checksum and that is when it fails. However, when I download that same HEX file using the Cygnal IDE, it works. So I'm stumped. Man, I hate it when stuff like that happens. Have you tried reading the bytes BEFORE you program them to make sure they are erased (FF)? Jon
Walla! Excellent, that was it. I looked at my erase function and discovered I was only erasing 0C00h to F400h. My bootloader is from 0000h to 0C00h so I don't want to erase that area. But I am not sure why I wasn't erasing F400h to FFFFh. Now I am and it works. Thank you so much. -- Steve
This is good to know. I didn't find where this was documented. Could you point it out so that I can put a comment in my code? Thanks.