I want to divide BootLoader into Boot + Loader

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

I want to divide BootLoader into Boot + Loader

ソリューションへジャンプ
2,557件の閲覧回数
赵子成
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 解決策
2,438件の閲覧回数
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 返答(返信)
2,438件の閲覧回数
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 件の賞賛
返信
2,438件の閲覧回数
赵子成
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 件の賞賛
返信
2,439件の閲覧回数
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 

2,438件の閲覧回数
赵子成
Contributor IV

Yes, your suggestion is well done. 

Thanks you.

0 件の賞賛
返信