bootloader process

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

bootloader process

1,086 Views
renshaoshuai
Contributor II

Hi there,

now i have one CAN bootloader code, i can use PCAN device to download APP code to new flash address.

the following is the APP flash parameter:

at S32K144_64_flash.ld : 

m_interrupts (RX) : ORIGIN = 0x00004000, LENGTH = 0x00000400 // set new interrupt, used for reload this part.
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010// same with bootloader code
m_text (RX) : ORIGIN = 0x00004400, LENGTH = 0x0007BC00//new flash address.

at: startup.c: 

// if (__VECTOR_RAM != __VECTOR_TABLE)
// {
// /* Copy the vector table from ROM to RAM */
// for (n = 0; n < (((uint32_t)__RAM_VECTOR_TABLE_SIZE)/sizeof(uint32_t)); n++)
// {
// __VECTOR_RAM[n] = __VECTOR_TABLE[n];
// }
// /* Point the VTOR to the position of vector table */
// S32_SCB->VTOR = (uint32_t)__VECTOR_RAM;
// }
// else
// {
// /* Point the VTOR to the position of vector table */
// S32_SCB->VTOR = (uint32_t)__VECTOR_TABLE;
// }

S32_SCB->VTOR = (uint32_t)0x4004;// i just use this line code, and comment original code.

through the above set, i can download code to board by CAN bootloader.

my question is:

if i want to use __VECTOR_RAM, how to set the parameter in S32K144_64_flash.ld file?

is it ok to comment the original bold S32_SCB->VTOR code?

part II:

there have two ways to start CAN bootloader process.

1. power off and power on 

2. press reset button.

do these two way lead to same process(both use __VECTOR_TABLE? )?

could you explain the difference between __VECTOR_TABLE and __VECTOR_RAM in S32_SCB->VTOR?

0 Kudos
0 Replies