IAR memory window not change after flash program

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

IAR memory window not change after flash program

493件の閲覧回数
qimao-marvin
Contributor II

p:S32K146

IAR:9.30.1

In the OTA progress, after erase ,the data at the which address is 0x20000 all become 0xff,but after program like 8 bytes for one time , the data at the 0x20000 looked at the memory window of IAR is still 0xff,but after 128 or 256 bytes later, the data is the expected data programmed.However ,at the end of the OTA, when tried to read the flash back by the link,the ata is the same with the file downloaded by the can.

below is the memory window of the IAR

qimaomarvin_0-1749836869286.jpeg

qimaomarvin_1-1749837034338.jpeg

 

below is the flash code example:

qimaomarvin_2-1749837061857.jpegqimaomarvin_3-1749837071804.jpeg

 

0 件の賞賛
返信
3 返答(返信)

433件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @qimao-marvin,

It’s possible that the issue is due to either: The IDE memory view not being refreshed, or the effect of cache or the prefetch buffer.

Is the cache enabled?
If so, it might be affecting what you see in memory.

danielmartynek_0-1750062979319.png

Prefetch buffer is enabled by default. You can disable it (from SRAM) using the following configuration:

MSCM->OCMDR[0u] |= MSCM_OCMDR_OCM1(0x3u);
MSCM->OCMDR[1u] |= MSCM_OCMDR_OCM1(0x3u);


Try reading the memory directly from the core and compare it with the flash content to verify consistency.

In our department, we don’t use the IDE, so we can’t confirm its behavior.
If the issue persists, it might be worth contacting IAR support to check whether the memory view needs to be manually refreshed.

 

Regards,

Daniel   

0 件の賞賛
返信

412件の閲覧回数
qimao-marvin
Contributor II

In the init function of falsh ,the register PCCCR will be set 

0x85000001U(Invalidate cache & enable write buffer, cache);
So in order to refresh the memory or read the data directly from flash not from bus, is it be ok to invalid the cache before and after flash program ? or do you have any other better suggestions?
Thanks
0 件の賞賛
返信

394件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @qimao-marvin,

Yes, but there’s also the prefetch buffer—as I mentioned, this is a separate cache.
However, it’s only a 128-bit buffer and can be updated simply by reading data from a different location.

 

Regards,

Daniel

 

 

 

 

0 件の賞賛
返信