Updated: I've also included generated map file and screenshot from debugger showing broken RAM. Screenshot with proper memset() from another example application with code in ROM is also attached.
Thanks for your answer. If I understand correctly, supplied files differ from mine only in copying to RAM only flash routines instead of all CODE segment.
I seem to have the same problem as you with getting the IAP code to work.
You say the initialization code was linked to RAM and therefore wasn't initialised. I understand that the issue is caused by the memset and memcopy library functions also being moved into RAM - and so cannot initialise themselves. Which I think come to the same end. So, how did you get around this problem? How do you stop the memset and memcopy functions from being moved into RAM? It appears to me that if you want to keep the initialization code in ROM, you cannot use any library functions in the code running in RAM? Any advice would be gratefully received!! Thank you.
First---IAP Driver:The IAP Driver must be downloaded to STR71X.You can get it from the websize of STR71X --AN2078 DEMO program.Do not any change!!!Directly download it!!! --I can give your *.bin file or you convert it,if you need it. Second--User program:As the AN2078 say ,there are two cases : 1�if your program dose not use interrupts ,just only map and program flash your user program from address 0x40002000.Then IAP it by Uart. 2�otherwise ,your program dose not use interrupts .We need do as following: 1)map and program flash your user program from address 0x40002000 2)exception vectors map to RAM,3)Copy exception vectors to RAM 4)software remap setting : ram of remap to 0x0. Try it ,if can not ,give me an E--mail :bingo_2046@yahoo.com.cn