S32K program can not run after power on,but can run after pull down reset pin

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

S32K program can not run after power on,but can run after pull down reset pin

681 次查看
GawJoe
Contributor I

hi everybody,

My question is why S32K MCAL demo program can not run after power on,but can run after pull down reset pin.And the program also can run with debugger well,I can detect every step in running process.I search some resolvement in NXP Community,but it seems to be not effective. such as add start from flash,change program IDE.The NXP RTD demo works well with no problem.

0 项奖励
回复
1 回复

586 次查看
Nhi_Nguyen
NXP Employee
NXP Employee

Hi GawJoe,

I tried to add toggle led into the example of S32K344, then turn off/turn on power, the program is still work.

I attached the example(with HSE loaded) here. You can refer to it. This if for the package SW32K3_RTD_4.4_R21-11_3.0.0.

Normally, RTD supports to program can run after power off/ on in case chip support internal Fls.

As far as I know, there is 2 ways to boot in RTD. Boot with T32(in case T32 still attached after reset) and Chip boot with available program loaded in it before.

The progress of boot is: 

- Initialize clock for T32, attached CPU to T32.

- Disable Wdog.

- Config Fls, copy data for specific memory, code, data,...

- Config RAM.

- Code application will be load to RAM or Fls depend on option load_to.

- Enable partition clock, core clock, peripheral.

Startup of RTD includes: reallocate VTOR to RAM, copy vector table from Fls to RAM, initialize Stack pointer MSP, Config DTCM where store stack, ITCM, Bss, data, UserMode, main label,...

After reset, Chip will go through HW reset sequence, then look at IVT as diagram below.

Where will chip look at to find IVT? As below (0x00400000).

Some importance fields in IVT:

- It's Image vector table marker

- Core enable.

- Vector table address (VTOR).

Nhi_Nguyen_4-1687182838923.png

In the case, T32 attached, T32 will guide chip to run from Reset-Handler and go to main, through startup of RTD.

Nhi_Nguyen_0-1687180505737.png

In T32 contains option EnReset, so in the case, T32 still attached after Reset, Chip continue to follow under guide of T32(start at Reset_Handler, init DTCM, ITCM, disable Wdg,... go to Main). 

In case turn off/turn on Power, chip boot by itself. So, IVT need to be filled correctly before. For example, Main stack Pointer filled incorrectly, an address in Fls, after Reset, PC can read but when push data to stack, this lead to exception. 

Best regards,

Nhi

 

0 项奖励
回复