I want to divide BootLoader into Boot + Loader

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

I want to divide BootLoader into Boot + Loader

跳至解决方案
1,349 次查看
赵子成
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.

标记 (3)
0 项奖励
1 解答
1,230 次查看
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 

在原帖中查看解决方案

4 回复数
1,230 次查看
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 项奖励
1,230 次查看
赵子成
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 项奖励
1,231 次查看
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,230 次查看
赵子成
Contributor IV

Yes, your suggestion is well done. 

Thanks you.

0 项奖励