S32K311 FLASH ready for program after functional software reset

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

S32K311 FLASH ready for program after functional software reset

1,909 Views
enricoantonioli
Contributor III

Hello,

I would like to know after how much time (in milliseconds) from a functional reset sofwtare (SW_FUNC) the flash module is ready for accept erasing and programming.

I did not find this information on the datasheet and often after a software functional reset the programming fails due to MCRS error (PEP).

Can anybody help me? If I insert a delay about 10 ms from reset the programming procedure has success. and without delay programming fails.

Best regards

E.

0 Kudos
Reply
7 Replies

1,870 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

I understand it the way that you need to wait until MCSR[DONE] = 1.

davidtosenovjan_0-1727882953395.png

There is no explicit time defined in the documentation.

 

0 Kudos
Reply

1,830 Views
enricoantonioli
Contributor III

Hello David,

Thank you for your answer, but I notice that after reset I must wait for HSE core execute WFI before execute a program or an erase FLASh operation, otherwise it does not works and return the protection error MCRS[PEP].

After the reset and before programming or deleting the FLASH I had to enter the following wait:

while ((IP_MC_ME->PRTN0_CORE2_STAT&MC_ME_PRTN0_CORE2_STAT_WFI_MASK)==0){};/* Waiting for hse core execute WFI */

There is currently no firmware programmed into the HSE and the HSE firmware usage feature flag is disabled.

I did not find any warning about this in either the "S32K3xx Reference Manual" or the "RM00286 HSE_B Firmware Reference Manual".

Can you confirm what I found?

Best regards

E.

0 Kudos
Reply

1,803 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Do you program same block as BAF is located in? In such case there is such limitation as described below

davidtosenovjan_2-1729005827064.png

davidtosenovjan_3-1729005908207.png

davidtosenovjan_0-1729005660558.png

0 Kudos
Reply

1,795 Views
enricoantonioli
Contributor III

Hi David,

my application code can program only the first 512 KB (0x00400000--0x0047FFFF) of the FLASH memory, and if I understand the SBAF use only the address space 0x004F4000--0x004FFFFF.

So why do I still have to wait for HSE enter in WFI state?

I don't have to use the address space reserved for SBAF

Waiting your response

Best Regards

E.

 

 

0 Kudos
Reply

1,766 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

According Table 207 above, Block 0 is locked as well. Notice that there are always two blocks locked even with other S32K3.

Apparently only data flash you could access immediately on S32K311.

0 Kudos
Reply

1,761 Views
enricoantonioli
Contributor III

Hello David,

thank you very much for your clarification, but if you say "Notice that there are always two blocks locked even with other S32K3", I don't understand why in Table 207 for S32K311 Code Flash Block 1 is NA and not 1?

I suppose that for S32K310 too, that has only block 0 this is locked by HSE during SBAF, is it correct?

Best regards

E.

0 Kudos
Reply

1,733 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

This table does not fit to S32K311 (S32K3x1 fits to S32K341), I will report it as documentation error as on this device, blocks are defined differently.

If I can compare with other sub-derivatives, I suppose both code blocks are locked.

0 Kudos
Reply