S32K312 C40 debugger issue

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

S32K312 C40 debugger issue

Jump to solution
1,647 Views
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 Kudos
Reply
1 Solution
1,629 Views
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

 

View solution in original post

3 Replies
1,000 Views
Novalis
Contributor III

I also had to change rasr[3] for DFLASH

0 Kudos
Reply
1,617 Views
rakketi
Contributor II

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

0 Kudos
Reply
1,630 Views
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