I want to divide BootLoader into Boot + Loader

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

I want to divide BootLoader into Boot + Loader

Jump to solution
1,277 Views
赵子成
Contributor IV

For the security reason, I must divide BootLoader into Boot + Loader in S32K144 CPU.

The Boot is stored in PFLASH. If  Application is needed to update, First Boot receive the Loader.

Then  Loader  is Running in RAM and receive the Application and Program Application  to PFLASH.

Can anyone tell me how to do that?

Can anyone share the project?

Thanks.

0 Kudos
1 Solution
1,158 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

you can use - for example - C library function - memcpy() - Tutorialspoint   . Or you can write data from one address(array) to your target address(array) in  loop. In attachment is memcpy example. There is constant data array (in your case you will copy data probably from UART buffer) and pointer into unused RAM (see modified linker file). 

When you copy your data into RAM - you use pointer to function for calling it. 

Jiri 

View solution in original post

4 Replies
1,158 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

if I understand it correctly - you like to have one bootloader which can receive Flashing algorithm from UART (for example) and store it in RAM. When done - BL will receive application and will call flashing algorithm from RAM to store app in the PFlash. Am I correct? 

Unfortunately there is no such example. But technically there is nothing special about it. Your BL needs to first receive app for Flashing -> store it in RAM -> receive parts of target app  -> call Flashing algorithm from RAM to store received app parts into PFlash. 

Jiri

0 Kudos
1,158 Views
赵子成
Contributor IV

Hi Jiri,

Yes, you are right.

My issue is: How to store the Flashing algorithm in RAM.

Pls give me instruction.

Of course, if you can give me a demo, it is much appreciated.

Thanks.

0 Kudos
1,159 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

you can use - for example - C library function - memcpy() - Tutorialspoint   . Or you can write data from one address(array) to your target address(array) in  loop. In attachment is memcpy example. There is constant data array (in your case you will copy data probably from UART buffer) and pointer into unused RAM (see modified linker file). 

When you copy your data into RAM - you use pointer to function for calling it. 

Jiri 

1,158 Views
赵子成
Contributor IV

Yes, your suggestion is well done. 

Thanks you.

0 Kudos