i am building a bootloader project , in others projrct based infineon TC233 ,i see the app address in pflash is 0x80020020, but when system reset ,the jump address for app is 0x80020000, the two address is different ,i want to know ,why they are not the same address ??????
now i am building a bootloader based on s32k144 ,the adderss jump app is 0x00010000,how should i set the app start address in pflash???
Hi @zq1
Standard reset vector is always placed at address 0x4. This is used by your bootloader.
If you shift user application to 0x10000, the reset vector can be found at 0x10004 and initial value of stack pointer at 0x10000. That's what your code shows (add is the base address 0x10000):
appStack = *(uint32_t *)(add);
appEntry = *(uint32_t *)(add + 4);
If you are asking how to shift application to 0x10000 then just change this in your linker file:
MEMORY
{
/* Flash */
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0007FBF0
to this:
MEMORY
{
/* Flash */
m_interrupts (RX) : ORIGIN = 0x00010000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00010400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00010410, LENGTH = 0x0007FBF0-0x10000
Regards,
Lukas
i want to know ,the origin m_interrupts (RX) : ORIGIN = 0x00000000 must be same with APP_START_ADDR ????
Yes, that's correct.