S32G2xx M7 execute code from external flash ?

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

S32G2xx M7 execute code from external flash ?

ソリューションへジャンプ
2,922件の閲覧回数
SSyb
Contributor III

Hi all,

this might be a little bit of a dummy-question, and maybe I have just overread relevant infos in the reference manual. I have an S32G2-VNP-RDB2 board with an S32G274A. Currently only the M7 core(s) are in focus.

The softwarestack for the Arm-M7we want to get to run is a custom thing (not using the DS32 toolchain or libraries), and my actual plan is to boot from the external Macronix Flash and also execute the code from there, like we would do on a "traditional" microcontroller. I have learned that I have to inject the IVT record also.

But more generally put: can the S32G2 execute code from flash ? or does the bootrom expect everything is linked against the RAM and load the code into RAM only before execution ?

If yes, any additional hints on executing code from the flash on the S32G2?

thanks and best regrads,

Stefan

 

 

0 件の賞賛
返信
1 解決策
2,888件の閲覧回数
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

The execution of code on the S32G274A is mainly being done on the internal SRAM.

The main idea of the external Flash is used to store the code and send it to internal SRAM in the boot process.

If you would like to use the external Flash for code execution, there is a feature called XIP (eXecute-In-Place) which is used for this purpose.

"The eXecute in Place, or XiP, is a capability that allows a processor to execute code directly from external flash memory. " [CROSSOVER TO MEMORY EXPANSION WITH ADESTO ECOXiP AND NXP’S i.MX RT CROSSOVER PROCESSORS].

Please, let us know if this information was helpful or not.

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
2,889件の閲覧回数
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

The execution of code on the S32G274A is mainly being done on the internal SRAM.

The main idea of the external Flash is used to store the code and send it to internal SRAM in the boot process.

If you would like to use the external Flash for code execution, there is a feature called XIP (eXecute-In-Place) which is used for this purpose.

"The eXecute in Place, or XiP, is a capability that allows a processor to execute code directly from external flash memory. " [CROSSOVER TO MEMORY EXPANSION WITH ADESTO ECOXiP AND NXP’S i.MX RT CROSSOVER PROCESSORS].

Please, let us know if this information was helpful or not.

0 件の賞賛
返信
2,874件の閲覧回数
SSyb
Contributor III
Hi @Daniel-Aguirre, thanks for the quick response.
SO I think we will then stay on the main road for the time being and load the code into RAM before executing it. Just in case we want to dig deeper into the XIP feature: I found in the S32G274A Reference manual a brief section about flash sequences, titled "4 x I/O read enhance performance mode (XIP) (Macronix)". Is this sequence then all the magic behind XIP ? of is there more described somewhere else ?
best regards, Stefan
0 件の賞賛
返信
2,784件の閲覧回数
BGauthier
Contributor I

I'm not sure if you are running U-BOOT or not.

But if you do, you can:

  • setenv xw_file IPCF_Example_S32G274A_M7_0.bin
  • setenv xw_load_addr 0x34300000
  • setenv xw_load_firmware dcache off; mw.q ${xw_sram_address} 0x0 0x100000; fatload mmc 0:1 ${xw_load_addr} ${xw_file}; startm7 ${xw_start_addr}
  • setenv xw_sram_address 0x34000000
  • setenv xw_start_addr 0x34501000
  • setenv bootcmd run ${xw_load_firmware}: ${bootcmd}
  • saveenv

After that, everytime you boot, your S32G target will:

  1. the IPCF_Example_S32G274A_M7_0.bin will be copy from the SD card to sram
  2. the IPCF_Example_S32G274A_M7_0.bin will executed oh the M7
  3. the A53 will boot Linux

 

Thanks,

Bruno

 

0 件の賞賛
返信
2,763件の閲覧回数
SSyb
Contributor III
Hi @BGauthier,
Thanks for the hint ! At this stage of the development we are not yet using the A53 cores or UBOOT, maybe at a later time.
0 件の賞賛
返信