S32K142: Flash Partition Anomaly

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

S32K142: Flash Partition Anomaly

1,168 次查看
ShaoTianzhi
Contributor II

“I referred to NXP’s Flash partition sample code and wrote the following code. When executed on S32K146, it works normally and can perform partitioning. However, when debugging on S32K142, the program stops at the execution of [ MSCM->OCMDR[0u] |= MSCM_OCMDR_OCM1(0x3u); ]. After clicking break and then go, it continues to execute without crashing. When not debugging, the program also stops here. I would like to ask why this is happening?”

ShaoTianzhi_0-1704176751678.pngShaoTianzhi_1-1704176838437.png

 

0 项奖励
回复
7 回复数

1,145 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@ShaoTianzhi

Could you please to modified the highlight part to S32K142 and then try again.

Senlent_0-1704248906953.png

I could not find any more porblem from the picture you provided, so if this still can't work normally, you may need to test the demo code in IDE:flash_partitioning_s32k142

0 项奖励
回复

1,138 次查看
ShaoTianzhi
Contributor II

Hi@Senlent

I apologize for submitting a picture of another project. In fact, what I wrote here is [#ifdef S32K142_SERIES]. My code was written with reference to [IDE:flash_partitioning_s32k142], but I just omitted the step of erasing ALL Blocks.

ShaoTianzhi_0-1704330730925.png

My confusion is why the code stops at the position of modifying the register.

0 项奖励
回复

1,123 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@ShaoTianzhi

I don't find any problems from the pictures you provided. I would like to ask if your S32K142 has been partitioned before. If it has been partitioned, please erase the partition first and try again.
If you still have problems, I need you to provide sample project code and I will check it for you

0 项奖励
回复

1,084 次查看
ShaoTianzhi
Contributor II

Hi@Senlent

sorry for the later reply,

I have put the program in the attachment, please check.

0 项奖励
回复

1,072 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@ShaoTianzhi

I tried mapping these operations to RAM and it seems to be no problem for me.

Senlent_1-1704941871253.png

Senlent_0-1704941038597.png

 

 

0 项奖励
回复

1,061 次查看
ShaoTianzhi
Contributor II

Hi@Senlent

I have tried according to your method, but when using IAR Debug, a new problem occurred. The code is stuck at the position where the OCMDR register is written. Clicking Break prompts that the CPU did not stop.

ShaoTianzhi_0-1705030223173.png

 

0 项奖励
回复

1,048 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@ShaoTianzhi

I can't run the IAR project. You can test the routine on S32 DS so that I can easily reproduce your problem.
You can check the x.map file to see if the function is correctly mapped into RAM

0 项奖励
回复