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!
Solved! Go to Solution.
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
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
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.
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