Anyone know why the binary code generated by the Keil ELF tool is different from the JTAG uploaded code? It looks like the last 150 bytes or so are different. I have a automatic firmware update tool that occasionally fails to restart. I have noticed that as my code size gets close to the size boundary (within 4000 bytes or so), the update fails to restart almost all the time (and won't work until I reload from JTAG). I've then noticed that the JTAG uploads different code than the ELF tool produces. What is the difference?
Jtag interface just downloads used areas.
The binary file can't contain holes, so it fills more.
That may be true. But, the compiled code from Keil along with the Keil ELF tool produces a contiguous binary file with no holes. If some of those areas are unused, they are being filled with something by the compilation and/or ELF tool. The JTAG upload erases the code space to FF, so if your statement is true, then the unused areas should remain FF. And, they don't.