Functional SWT_0 reset when execute FLASH express program on S32K311

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

Functional SWT_0 reset when execute FLASH express program on S32K311

Jump to solution
3,605 Views
enricoantonioli
Contributor III

Hello,

I tried to write a function that performs FLASH memory programming using the Express interface that area described in the "21.5.1.4 Express program" of the S32K3xx Reference Manual, Rev. 9, 07/2024  not supported by the current RTD.

The file with the source code is attached.
Unfortunately the writing fails randomly for Functional Reset of SWT_0.
The function is executed in ITCM.
Can someone help me understand where I went wrong in the sequence of the operation?
Thanks

E.

0 Kudos
Reply
1 Solution
3,490 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @enricoantonioli,

The drivers come without any support, we don't have any example where FLASH_WrOnceCrashLog() would be used. I shared it just for a reference. And there seems to be no difference between the driver and you code.

The execution is time is not specified.

You can measure the execution time yourself in your setup and then adjust the SWT_0 timeout.

 

Regards,

Daniel

View solution in original post

0 Kudos
Reply
3 Replies
3,570 Views
danielmartynek
NXP TechSupport
NXP TechSupport

HI @enricoantonioli,

I don't see any possible root cause.

Have a look at the attached project.

In \src\drivers\flash\flash.c, there is FLASH_WrOnceCrashLog().

 

Also, make sure the system clock configuration matches one of the clock options precisely.

RM rev9, Sectio 24.7.2 System clocking configurations

 

Regards,

Daniel

0 Kudos
Reply
3,556 Views
enricoantonioli
Contributor III

Hi Daniel,

thank you for your reply.

The clock settings I am using are below:

  • PLL_PHI0_CLK=120MHz
  • CORE_CLK=PLL_PHI0_CLK/1=120MHz
  • AIPS_PLAT_CLK=PLL_PHI0_CLK/2=60MHz
  • AIPS_SLOW_CLK=PLL_PHI0_CLK/4=30MHz
  • HSE_CLK=PLL_PHI0_CLK/2=60MHz
  • DCM_CLK=PLL_PHI0_CLK/4=30MHz

At the power on, executing code from RAM, I set RWSC = 3 on CTL (Module Control) register, in accordance with what is described in the data sheet "9.5 Flash memory read timing parameters" for S32K311.

The C code depicted in the function that you suggest me, I the same of mine code.

Have you ever tried the function FLASH_WrOnceCrashLog()?

The source C code of the function FLASH_WrOnceCrashLog() I the same of mine code.

I would like a clarification, I don't understand how to call the FLASH_WrOnceCrashLog() function and what should the logs array variable contain?

Could you suggest me an example of using this function, even inside a simple main() function, please?

enricoantonioli_0-1726837353373.png

The datasheet does not report writing times using the express interface. Is there any way faster express writing is than main?

Best regards

E.

0 Kudos
Reply
3,491 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @enricoantonioli,

The drivers come without any support, we don't have any example where FLASH_WrOnceCrashLog() would be used. I shared it just for a reference. And there seems to be no difference between the driver and you code.

The execution is time is not specified.

You can measure the execution time yourself in your setup and then adjust the SWT_0 timeout.

 

Regards,

Daniel

0 Kudos
Reply