S32K3 HSE Installation: differences between FULL MEM and AB SWAP

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

S32K3 HSE Installation: differences between FULL MEM and AB SWAP

Jump to solution
2,296 Views
lucazanuttini
Contributor II

Dear NXP support team,

I want to implement a sequence to install the HSE depending on its type (FULL MEM or AB SWAP), without the need to develop an application with IVT. It is assumed that the UTEST feature usage flag is already programmed.

FULL MEM installation via MU interface (meant for first installation, not for recovering):

1. Write 0xA5 on register DCMRWP1

2. Issue a functional reset.

3. Wait until Bit 1 in HSE_CONFIG_GPR3 is set

4. Wait for answer '0xFF00F00F' response on MU Rx register.

5. Writing value ‘0xF0F00F0F’ on MU Tx register.

6. Wait for answer ‘0xDADABABA’ on MU Rx register.

7. Write the Pink Image Location on MU Tx register.

8. Wait until Bit 1 in HSE_CONFIG_GPR3 is cleared.

9. Issue a functional reset.

10. Wait until HSE_STATUS_INIT_OK of GPR 3 is set.

FULL MEM Installation by placing the pink file at IVT_START:

1. Issue a functional reset.

2. Wait until HSE_STATUS_INIT_OK of GPR 3 is set.

AB SWAP installation via MU interface (meant for first installation, not for recovering):

1. Write 0xA5 on register DCMRWP1

2. Issue a functional reset.

3. Wait until Bit 1 in HSE_CONFIG_GPR3 is set

4. Wait for answer '0xFF00F00F' response on MU Rx register.

5. Writing value ‘0xF0F00F0F’ on MU Tx register.

6. Wait for answer ‘0xDADABABA’ on MU Rx register.

7. Write the Pink Image Location on MU Tx register.

8. Wait until Bit 1 in HSE_CONFIG_GPR3 is cleared.

9. Issue a functional reset.

10. Wait until bit WFI of MC_ME_PRTN0_CORE2_STAT is set.

11. Issue a functional reset.

12. Wait until HSE_STATUS_INIT_OK of GPR is set.

AB SWAP Installation by placing the pink file at IVT_START:

1. Issue a functional reset.

2. Wait until bit WFI of MC_ME_PRTN0_CORE2_STAT is set.

3. Issue a functional reset.

4. Wait until HSE_STATUS_INIT_OK of GPR is set.

Could you please review the above sequences and confirm whether they are correct or need correction (especially steps that involve MC_ME_PRTN0_CORE2_STAT register)?


Thanks in advance for your help.


Best Regards,

Luca

 

Tags (1)
0 Kudos
Reply
1 Solution
2,144 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

If you see Figure 9. Installation boot flow, it ends by WFI even FW-IMG is not present in secure NVM. 

So I would say it'll be set anyway. However if you want to have it bulletproof, you can use timeout as well (what I guess you would do anyway in the production code).

View solution in original post

0 Kudos
Reply
8 Replies
2,237 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

It seems quite good. 

Why you have changed HSE_STATUS_INIT_OK by WFI of MC_ME_PRTN0_CORE2_STAT  in the second-to-last reset? 

I guess it could be used as well this way.

0 Kudos
Reply
2,232 Views
lucazanuttini
Contributor II

Hello David,

Because the HSE_STATUS_INIT_OK  does not become set after the first functional reset. I need to issue another functional reset. I checked it with S32K312 and S32K358. Can you confirm it?

0 Kudos
Reply
2,189 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Yes, I see. It should be suitable solution.

0 Kudos
Reply
2,183 Views
lucazanuttini
Contributor II

Do you recommend polling another flag instead of WFI of MC_ME_PRTN0_CORE2_STAT? I need to figure out how to determine when the SBAF has completed the first installation process before issuing the second functional reset.

0 Kudos
Reply
2,179 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

"The HSE enters in wait-for-interrupt mode (WFI) when there is no pending service request or internal task to be executed." so yes, it could be used. 

I originally thought of using timeout, but using WFI will be a better solution.

0 Kudos
Reply
2,172 Views
lucazanuttini
Contributor II

Can the WFI flag be used even if the HSE has not been installed yet? In fact, the HSE firmware will only be executed after the second functional reset.
My intention is to check the SBAF status, whether it has finished or is still decrypting the pink file.
Sorry for asking this several times, but I just want to make sure my question is completely clear as the flow will be used in mass production.

0 Kudos
Reply
2,145 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

If you see Figure 9. Installation boot flow, it ends by WFI even FW-IMG is not present in secure NVM. 

So I would say it'll be set anyway. However if you want to have it bulletproof, you can use timeout as well (what I guess you would do anyway in the production code).

0 Kudos
Reply
2,126 Views
lucazanuttini
Contributor II

Hello David,

Thank you for the hint. I haven't looked at figure 9 in detail before. 

I will wait until the WFI bit is set. If it's not set (which I assume should never happen), I'll consider it an error and return an appropriate response.

For your information, I’ll be performing the sequence as an external programmer communicating via SWD. If, for any reason, the customer forgets to load the FW-IMG, the HSE_STATUS_OK bit will not be set at the end of the sequence, and an error will be returned in any case.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2188339%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K3%20HSE%20Installation%3A%20differences%20between%20FULL%20MEM%20and%20AB%20SWAP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2188339%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDear%20NXP%20support%20team%2C%3C%2FP%3E%3CP%3EI%20want%20to%20implement%20a%20sequence%20to%20install%20the%20HSE%20depending%20on%20its%20type%20(FULL%20MEM%20or%20AB%20SWAP)%2C%20without%20the%20need%20to%20develop%20an%20application%20with%20IVT.%20It%20is%20assumed%20that%20the%20UTEST%20feature%20usage%20flag%20is%20already%20programmed.%3C%2FP%3E%3CP%3E%3CEM%3E%3CU%3EFULL%20MEM%20installation%20via%20MU%20interface%20(meant%20for%20first%20installation%2C%20not%20for%20recovering)%3A%3C%2FU%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E1.%20Write%200xA5%20on%20register%20DCMRWP1%3C%2FP%3E%3CP%3E2.%20Issue%20a%20functional%20reset.%3C%2FP%3E%3CP%3E3.%20Wait%20until%20Bit%201%20in%20HSE_CONFIG_GPR3%20is%20set%3C%2FP%3E%3CP%3E4.%20Wait%20for%20answer%20'0xFF00F00F'%20response%20on%20MU%20Rx%20register.%3C%2FP%3E%3CP%3E5.%20Writing%20value%20%E2%80%980xF0F00F0F%E2%80%99%20on%20MU%20Tx%20register.%3C%2FP%3E%3CP%3E6.%20Wait%20for%20answer%20%E2%80%980xDADABABA%E2%80%99%20on%20MU%20Rx%20register.%3C%2FP%3E%3CP%3E7.%20Write%20the%20Pink%20Image%20Location%20on%20MU%20Tx%20register.%3C%2FP%3E%3CP%3E8.%20Wait%20until%20Bit%201%20in%20HSE_CONFIG_GPR3%20is%20cleared.%3C%2FP%3E%3CP%3E9.%20Issue%20a%20functional%20reset.%3C%2FP%3E%3CP%3E10.%20Wait%20until%20HSE_STATUS_INIT_OK%20of%20GPR%203%20is%20set.%3C%2FP%3E%3CP%3E%3CU%3E%3CEM%3EFULL%20MEM%20Installation%20by%20placing%20the%20pink%20file%20at%20IVT_START%3A%3C%2FEM%3E%3C%2FU%3E%3C%2FP%3E%3CP%3E1.%20Issue%20a%20functional%20reset.%3C%2FP%3E%3CP%3E2.%20Wait%20until%20HSE_STATUS_INIT_OK%20of%20GPR%203%20is%20set.%3C%2FP%3E%3CP%3E%3CU%3E%3CEM%3EAB%20SWAP%20installation%20via%20MU%20interface%20(meant%20for%20first%20installation%2C%20not%20for%20recovering)%3A%3C%2FEM%3E%3C%2FU%3E%3C%2FP%3E%3CP%3E1.%20Write%200xA5%20on%20register%20DCMRWP1%3C%2FP%3E%3CP%3E2.%20Issue%20a%20functional%20reset.%3C%2FP%3E%3CP%3E3.%20Wait%20until%20Bit%201%20in%20HSE_CONFIG_GPR3%20is%20set%3C%2FP%3E%3CP%3E4.%20Wait%20for%20answer%20'0xFF00F00F'%20response%20on%20MU%20Rx%20register.%3C%2FP%3E%3CP%3E5.%20Writing%20value%20%E2%80%980xF0F00F0F%E2%80%99%20on%20MU%20Tx%20register.%3C%2FP%3E%3CP%3E6.%20Wait%20for%20answer%20%E2%80%980xDADABABA%E2%80%99%20on%20MU%20Rx%20register.%3C%2FP%3E%3CP%3E7.%20Write%20the%20Pink%20Image%20Location%20on%20MU%20Tx%20register.%3C%2FP%3E%3CP%3E8.%20Wait%20until%20Bit%201%20in%20HSE_CONFIG_GPR3%20is%20cleared.%3C%2FP%3E%3CP%3E9.%20Issue%20a%20functional%20reset.%3C%2FP%3E%3CP%3E10.%20Wait%20until%20bit%20WFI%20of%20MC_ME_PRTN0_CORE2_STAT%20is%20set.%3C%2FP%3E%3CP%3E11.%20Issue%20a%20functional%20reset.%3C%2FP%3E%3CP%3E12.%20Wait%20until%20HSE_STATUS_INIT_OK%20of%20GPR%20is%20set.%3C%2FP%3E%3CP%3E%3CU%3E%3CEM%3EAB%20SWAP%20Installation%20by%20placing%20the%20pink%20file%20at%20IVT_START%3A%3C%2FEM%3E%3C%2FU%3E%3C%2FP%3E%3CP%3E1.%20Issue%20a%20functional%20reset.%3C%2FP%3E%3CP%3E2.%20Wait%20until%20bit%20WFI%20of%20MC_ME_PRTN0_CORE2_STAT%20is%20set.%3C%2FP%3E%3CP%3E3.%20Issue%20a%20functional%20reset.%3C%2FP%3E%3CP%3E4.%20Wait%20until%20HSE_STATUS_INIT_OK%20of%20GPR%20is%20set.%3C%2FP%3E%3CP%3ECould%20you%20please%20review%20the%20above%20sequences%20and%20confirm%20whether%20they%20are%20correct%20or%20need%20correction%20(especially%20steps%20that%20involve%20MC_ME_PRTN0_CORE2_STAT%20register)%3F%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EThanks%20in%20advance%20for%20your%20help.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EBest%20Regards%2C%3C%2FP%3E%3CP%3ELuca%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2190523%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20HSE%20Installation%3A%20differences%20between%20FULL%20MEM%20and%20AB%20SWAP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2190523%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20David%2C%3C%2FP%3E%3CP%3EThank%20you%20for%20the%20hint.%20I%20haven't%20looked%20at%20figure%209%20in%20detail%20before.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20will%20wait%20until%20the%20WFI%20bit%20is%20set.%20If%20it's%20not%20set%20(which%20I%20assume%20should%20never%20happen)%2C%20I'll%20consider%20it%20an%20error%20and%20return%20an%20appropriate%20response.%3C%2FP%3E%3CP%3EFor%20your%20information%2C%20I%E2%80%99ll%20be%20performing%20the%20sequence%20as%20an%20external%20programmer%20communicating%20via%20SWD.%20If%2C%20for%20any%20reason%2C%20the%20customer%20forgets%20to%20load%20the%20FW-IMG%2C%20the%20HSE_STATUS_OK%20bit%20will%20not%20be%20set%20at%20the%20end%20of%20the%20sequence%2C%20and%20an%20error%20will%20be%20returned%20in%20any%20case.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2190106%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20HSE%20Installation%3A%20differences%20between%20FULL%20MEM%20and%20AB%20SWAP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2190106%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIf%20you%20see%26nbsp%3BFigure%209.%E2%80%87Installation%20boot%20flow%2C%20it%20ends%20by%20WFI%20even%20FW-IMG%20is%20not%20present%20in%20secure%20NVM.%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20I%20would%20say%20it'll%20be%20set%20anyway.%20However%20if%20you%20want%20to%20have%20it%20bulletproof%2C%20you%20can%20use%20timeout%20as%20well%20(what%20I%20guess%20you%20would%20do%20anyway%20in%20the%20production%20code).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2189915%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20HSE%20Installation%3A%20differences%20between%20FULL%20MEM%20and%20AB%20SWAP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2189915%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECan%20the%20WFI%20flag%20be%20used%20even%20if%20the%20HSE%20has%20not%20been%20installed%20yet%3F%20In%20fact%2C%20the%20HSE%20firmware%20will%20only%20be%20executed%20after%20the%20second%20functional%20reset.%3CBR%20%2F%3EMy%20intention%20is%20to%20check%20the%20SBAF%20status%2C%20whether%20it%20has%20finished%20or%20is%20still%20decrypting%20the%20pink%20file.%3CBR%20%2F%3ESorry%20for%20asking%20this%20several%20times%2C%20but%20I%20just%20want%20to%20make%20sure%20my%20question%20is%20completely%20clear%20as%20the%20flow%20will%20be%20used%20in%20mass%20production.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2189911%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20HSE%20Installation%3A%20differences%20between%20FULL%20MEM%20and%20AB%20SWAP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2189911%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%22The%20HSE%20enters%20in%20wait-for-interrupt%20mode%20(WFI)%20when%20there%20is%20no%20pending%20service%20request%20or%20internal%20task%20to%20be%20executed.%22%20so%20yes%2C%20it%20could%20be%20used.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22HwtZe%22%3E%3CSPAN%20class%3D%22jCAhz%20ChMk0b%22%3E%3CSPAN%20class%3D%22ryNqvb%22%3EI%20originally%20thought%20of%20using%20timeout%2C%20but%20using%20WFI%20will%20be%20a%20better%20solution%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2189896%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20HSE%20Installation%3A%20differences%20between%20FULL%20MEM%20and%20AB%20SWAP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2189896%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDo%20you%20recommend%20polling%20another%20flag%20instead%20of%20WFI%20of%20MC_ME_PRTN0_CORE2_STAT%3F%20I%20need%20to%20figure%20out%20how%20to%20determine%20when%20the%20SBAF%20has%20completed%20the%20first%20installation%20process%20before%20issuing%20the%20second%20functional%20reset.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2189891%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20HSE%20Installation%3A%20differences%20between%20FULL%20MEM%20and%20AB%20SWAP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2189891%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EYes%2C%20I%20see.%20It%20should%20be%20suitable%20solution.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2189281%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20HSE%20Installation%3A%20differences%20between%20FULL%20MEM%20and%20AB%20SWAP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2189281%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20David%2C%3C%2FP%3E%3CP%3EBecause%20the%26nbsp%3B%3CSPAN%3EHSE_STATUS_INIT_OK%26nbsp%3B%3C%2FSPAN%3E%20does%20not%20become%20set%20after%20the%20first%20functional%20reset.%20I%20need%20to%20issue%20another%20functional%20reset.%20I%20checked%20it%20with%20S32K312%20and%20S32K358.%20Can%20you%20confirm%20it%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2189277%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20HSE%20Installation%3A%20differences%20between%20FULL%20MEM%20and%20AB%20SWAP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2189277%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIt%20seems%20quite%20good.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhy%20you%20have%20changed%26nbsp%3BHSE_STATUS_INIT_OK%20by%26nbsp%3BWFI%20of%20MC_ME_PRTN0_CORE2_STAT%26nbsp%3B%20in%26nbsp%3Bthe%20second-to-last%20reset%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20guess%20it%20could%20be%20used%20as%20well%20this%20way.%3C%2FP%3E%3C%2FLINGO-BODY%3E