We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I use LPC1754, and Keil uVision4. I have a small code that use noinit memory , at the end of the first region of RAM From 0x10003F00 to 0x10003FFF. - 256 bytes. I zeroed this region, and make reset. I found that after every reset, memory addresses between 0x10003FC8-0x10003FE0 are always changed form the mcu, with this bytes CD,AB,56,34,CD,AB,56,34,78,56,34,12,00,00,00,00,CD,AB,56,34,FF,FF,FF,FF All other bytes remain zeroed , as they are expected because they are in noinit section.
Does anybody knows, what are these bytes. Does anybody knows, what kind of instructions are executed right after reset, and what memory region they use for their job.
I suppose it is boot-rom code, that is executed before main, and even before start-up assembler code. ( __main ).
Another thing is what is the size of RAM that this hidden code uses. What is the possible size of RAM at the end of the first region, that can be used for noinit memory.
10x
Doesn't matter if you use IAP or ISP.
The chip still always starts the boot loader to check the pin to know if ISP is needed. And to check interrupt vector table to see if there seems to be a valid program or chip is empty.
So you always get stack usage there.
Linker have no reason to warn - most of this stack space doesn't collide with your own program because your program is started after the boot loader. It's only when you specifically ask for IAP that you need to consider the stack requirements for the IAP code that you explicitly call.
But (!) the important thing is that if you need zero-initialized memory, you should consider using other side of the RAM instead. The linker just can't know what memory the chip internal firmware will touch. And your startup code will run way after the memory have been touched.