For our product we would like to be able to put the M4 core to sleep, have the M0 load new code from flash to RAM, and then reset the M4 to run the new code from RAM.
The LPC43xx manual states that the M4MEMMAP is default set to the boot rom at 0x1040 000; Is this default value only set at system reset, or also when the M4 is reset with M4_RST in LPC_RGU->RESET_CTR?
Regards,
Bernhard.
Hi Bernhard,
Thanks for your answer, and sorry for my late reply.
I got this to work as I wanted. My first implementation used a kind of trampoline outside of the memory I wanted to replace; I kept the M4 in a tight loop there while replacing the code, and then let it jump out of the loop when ready. That worked.
Later I tried to simplify stuff, and I found out that issueing a M4 core reset in RESET_CTRL just works:
LPC_RGU->RESET_CTRL[RGU_M3_RST >> 5]
does *not* remap the boot ROM to address 0 and does the job for me.
(Funny though, that the header files still call it 'M3_RST' instead of 'M4_RST')
Thanks for the information, Gerd.
Interesting that this keeps the current PC of the core in place. We should reflect this somehow in our docu.
LPC1800 and LP4300 share mostly the same code base, that's why M3_RST is kept.
Regards,
Bernhard.
Hi,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------