FLS driver: write data to flash section unsuccessfully

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

FLS driver: write data to flash section unsuccessfully

跳至解决方案
1,809 次查看
zp001
Contributor III

Hello,

I'm studying the FLS example of RTD2.0.1  with S32DS V3.5, and there is a problem that the data couldn't  be wrote in time, I have to restart device via S32DS , then the data is right and write successfully.

I'd like to know what's the reason.

Here is my FLS example project.

Thanks!

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,769 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @zp001,

The cache is a topic on its own.

But basically, if the cache is disabled, the core will need to read the flash instead of the cache, and that is slower.

The cache can be invalidated by address after each write to the flash.

There is this API of the low-level Cache_Ip driver.

Cache_Ip_InvalidateByAddr();

So, you can keep the cache enabled, but invalidate the part of it that has been reprogrammed.

 

Regards,

Daniel

 

 

 

 

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,789 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello,

This is probably caused by the Cache that is enabled by the MPU in the startup code.

In other words, you probably read the Cache and not the PFlash.

Try disabling the Cache in the MPU, system.c file.

Change rasr[2]=0x060B002BUL  to rasr[2] = 0x0608002BUL

 

Thanks,

BR, Daniel

 

0 项奖励
回复
1,782 次查看
zp001
Contributor III

Hi Daniel,

Thank you for your reply!

I just verified the solutiion, the sample code run normally.

I'd like to know if disable Cache in the MPU, what's the scope of influence and why the official FLS sample doesn't disable Cache in the startup phase.

0 项奖励
回复
1,770 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @zp001,

The cache is a topic on its own.

But basically, if the cache is disabled, the core will need to read the flash instead of the cache, and that is slower.

The cache can be invalidated by address after each write to the flash.

There is this API of the low-level Cache_Ip driver.

Cache_Ip_InvalidateByAddr();

So, you can keep the cache enabled, but invalidate the part of it that has been reprogrammed.

 

Regards,

Daniel

 

 

 

 

0 项奖励
回复