S32K312 C40 debugger issue

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

S32K312 C40 debugger issue

跳至解决方案
3,678 次查看
rakketi
Contributor II

Hello!
I have an issue with S32K312 and C40 Ip when trying to erase parts of the data flash after reading data flash memory. I attached a zip with pictures of the issue. Similar to https://community.nxp.com/t5/S32K/S32K3-Read-Write-Flash-with-C40-Driver/m-p/1380459#M13058


If we start off by doing a erase, write, and read of data flash everything works ok, we can also see in Memory Viewer that the memory updates correctly. (See pictures 1_erase_ok.png, 2_write_ok.png & 3_read_ok.png).

However, if we do a new erase and write after the read operation nothing happens, Memory Viewer doesnt update and if we try to read the memory again we get same results as before. (See picture 4_erase_not_ok.png, 5_write_not_ok.png).

And after a reset of the MCU, data flash is updated to the correct value (See picture 6_memory_update_after_reset.png)

I found a similar issue where they said it was the old version of the SDK that caused it. I'm using S32K312, SDK RTM 3.0.0 together with a PEMicro multilink FX debugger.

 

0 项奖励
回复
1 解答
3,660 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @rakketi,

This is because of the cache.

The cache can be either invalidated.

Call this API Cache_Ip_InvalidateByAddr(CACHE_IP_DATA, TargetAddress, 32) after programming or before reading the data back.

Or disable the cache in MPU setting.

In the "system.c" function "SystemInit", change rasr[2]=0x060B002BUL to rasr[2]=0x0608002BUL.

This sets the whole Flash as non-cacheable.

 

Regards,

Daniel

 

在原帖中查看解决方案

3 回复数
3,031 次查看
Novalis
Contributor III

I also had to change rasr[3] for DFLASH

0 项奖励
回复
3,648 次查看
rakketi
Contributor II

I can confirm that it works. Thanks for the help Daniel.

0 项奖励
回复
3,661 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @rakketi,

This is because of the cache.

The cache can be either invalidated.

Call this API Cache_Ip_InvalidateByAddr(CACHE_IP_DATA, TargetAddress, 32) after programming or before reading the data back.

Or disable the cache in MPU setting.

In the "system.c" function "SystemInit", change rasr[2]=0x060B002BUL to rasr[2]=0x0608002BUL.

This sets the whole Flash as non-cacheable.

 

Regards,

Daniel