S32K142 Flash Write Error

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

S32K142 Flash Write Error

Jump to solution
4,890 Views
Ada_Lovelace
Contributor IV

Hi,All

I meet a problem about Flash Writing:

When I set the App address:0x0010000, when I erase and write the value  firstly, it worked.

But when I erase and write Flash secondly, it  causes errors. 

FTFC_FSTAT_CCIF and FTFC_FSTAT_MGSTAT0 set  1. Then I debug the memory view, the address shows "?".

The S32k142 address:

Ada_Lovelace_0-1635227335871.png

 

What should I do to solve the problem?

Snipaste_2021-10-26_13-18-52.pngSnipaste_2021-10-26_13-19-35.pngSnipaste_2021-10-26_13-30-19.pngSnipaste_2021-10-26_13-30-51.png

0 Kudos
Reply
1 Solution
4,851 Views
Ada_Lovelace
Contributor IV

Hi,Daniel

I debug the project,  Flash Erasing do not work,so when I program the Flash firstly,it may write value into the address.But it causes error when I write the different value into the same address.

So I check the Flash Driver Project and Bootloader,I find the different about clock.

So I check the clock about Flash, clock reference is 26.67Mhz, I  set the wrong value,so I change it.

Now it works.

View solution in original post

4 Replies
4,884 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Ada_Lovelace,

Which FTFC command fails with MGSTAT0 = 1?

Do you launch the command from SRAM / DFlash?

 

BR, Daniel

0 Kudos
Reply
4,881 Views
Ada_Lovelace
Contributor IV

When  I write again, it  causes  MGSTAT0.I think it is something wrong with erase?

I do not launch the command from SRAM / DFlash, I use the code Flash address,could you tell me the right way to do the Flash about S32k142?

0 Kudos
Reply
4,868 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Do you use SDK/RTD or your own code?

Can you share the project?

Anyway, the code that launches the FTFC Erase Sector or Program Phrase commands, cannot be in PFlash if the commands erase or program PFlash, because there is only one PFlash partition.

danielmartynek_0-1635247301926.png

danielmartynek_1-1635247342155.png

 

BR, Daniel

 

0 Kudos
Reply
4,852 Views
Ada_Lovelace
Contributor IV

Hi,Daniel

I debug the project,  Flash Erasing do not work,so when I program the Flash firstly,it may write value into the address.But it causes error when I write the different value into the same address.

So I check the Flash Driver Project and Bootloader,I find the different about clock.

So I check the clock about Flash, clock reference is 26.67Mhz, I  set the wrong value,so I change it.

Now it works.