FLS driver: write data to flash section unsuccessfully

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FLS driver: write data to flash section unsuccessfully

Jump to solution
1,808 Views
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!

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,768 Views
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

 

 

 

 

View solution in original post

0 Kudos
Reply
3 Replies
1,788 Views
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 Kudos
Reply
1,781 Views
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 Kudos
Reply
1,769 Views
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 Kudos
Reply