S32K3 JTAG password

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

S32K3 JTAG password

7,155 Views
kjy106906
Contributor IV

I want to use the JTAG Password function of S32K312.
Is the following method possible?


S32K312 Secure debug setting (JTAG access not possible)
-> Password sent to MCU via CAN communication
-> MCU escapes Secure debug via Password (JTAG access possible)

Also, is it possible to set S32K312 Secure debug via CAN communication?
(When receiving a specific CAN message, MCU proceeds with setting Secure debug related registers)

If the above method is not possible, should I only enter the Password directly via JTAG to escape Secure debug?

0 Kudos
Reply
9 Replies

7,051 Views
victory
Contributor V

you can do it on mcu as PEMicro script does,  set SDAAP  registers to unlock debug.

0 Kudos
Reply

7,142 Views
ovidiubriscan
Contributor IV

Hi, please check steps inside manual RM758221-HSE-B Firmware Reference Manual, chapter Host debug.

Step 1) Provision the ADKP using the HSE_APP_DEBUG_KEY_ATTR_ID attribute.

Step 2) Set authorization method: password-based or challenge-response based, using the HSE_DEBUG_AUTH_MODE_ATTR_ID system attribute.

Step 3) Set the life cycle to OEM_PROD or IN_FIELD using the HSE_SECURE_LIFECYCLE_ATTR_ID system attribute.

All the above steps can be implemented in a DID/UDS routine no issue with that. After the 3rd step you ECU will be JTAG locked. You will need to provide the same password to debug tooling (Lauterbach Trace32 for ex, . 

 

0 Kudos
Reply

7,111 Views
kjy106906
Contributor IV

Thank you.
After Step 3, if JTAG is locked, can I unlock JTAG by entering the password through UDS.?
Or is JTAG unlock only possible through Debug Tool?
We are using T32. Do you know the relevant guide?

0 Kudos
Reply

7,095 Views
ovidiubriscan
Contributor IV
Hi, morning, this depends on your project strategy, both ways are possible, UDS adviceable to be behind a security access mechanism. But be aware Jtag unlock is only effective up to the next reset, any kind (which is a pain .., normally you want to unlock to debug stuff, hot attach or sleep/wakeup imposible to debug, reflash SW almost impossible). Permanent unlock of Jtag is not possible (like in older NXP architectures or in Tricore).
regards,
0 Kudos
Reply

7,090 Views
kjy106906
Contributor IV

Thank you very much.

1. Please briefly explain how to unlock the Lock by JTAG PASSWORD with an external UDS message.

2. Should I input the JTAG PASSWORD with a tool like T32 through JTAG? Or is it possible to input it with a UDS message?

3. Is the reason why reprogramming is impossible because reprogramming requires a reset?

0 Kudos
Reply

7,087 Views
ovidiubriscan
Contributor IV
1. You can do it with a $31 service , 31 01 <16bytes jtag_passwd>, or even with a $22 (RDBI), at the end you just need a trigger to your custom C API which will do the unlock procedure.
2. T32 is another easier option (and there are examples on how to do it, check S32_JTAG_WRITE.cmm inside HSE_DEMOAPP_S32K3XX_0_2_1_0) , this may be preferred method.
3. Normally when you do an attach o system up in T32 depends on the scripts behind but normally a reset happens, also when flashing process the scripts behind \demo\arm\flash\s32k3.cmm do some resets which will brake your "unlock" situation.
0 Kudos
Reply

4,557 Views
NileshDharap
Contributor III
Hello,
Where can I find this "S32_JTAG_WRITE.cmm inside HSE_DEMOAPP_S32K3XX_0_2_1_0)" ?
I am working on unlocking JTAG to automate whenever I open the trace32.
0 Kudos
Reply

4,548 Views
ovidiubriscan
Contributor IV
You have it here : c:\NXP\HSE_DEMOAPP_S32K344_0_2_55_0\demo_security_installer\scripts\S32_JTAG_WRITE.cmm
0 Kudos
Reply

4,526 Views
NileshDharap
Contributor III
I see it directly accesses JTAG to unlock.
Can we use the same to unlock if the JTAG is locked with HSE module ?
If yes, can it have a mechanism where it reads a file where password is stored and unlock using it.
Or how can I insert a password ?
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1968462%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K3%20JTAG%20password%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1968462%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20want%20to%20use%20the%20JTAG%20Password%20function%20of%20S32K312.%3CBR%20%2F%3EIs%20the%20following%20method%20possible%3F%3C%2FP%3E%3CP%3E%3CBR%20%2F%3ES32K312%20Secure%20debug%20setting%20(JTAG%20access%20not%20possible)%3CBR%20%2F%3E-%26gt%3B%20Password%20sent%20to%20MCU%20via%20CAN%20communication%3CBR%20%2F%3E-%26gt%3B%20MCU%20escapes%20Secure%20debug%20via%20Password%20(JTAG%20access%20possible)%3C%2FP%3E%3CP%3EAlso%2C%20is%20it%20possible%20to%20set%20S32K312%20Secure%20debug%20via%20CAN%20communication%3F%3CBR%20%2F%3E(When%20receiving%20a%20specific%20CAN%20message%2C%20MCU%20proceeds%20with%20setting%20Secure%20debug%20related%20registers)%3C%2FP%3E%3CP%3EIf%20the%20above%20method%20is%20not%20possible%2C%20should%20I%20only%20enter%20the%20Password%20directly%20via%20JTAG%20to%20escape%20Secure%20debug%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2170242%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20JTAG%20password%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2170242%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EI%20see%20it%20directly%20accesses%20JTAG%20to%20unlock.%3CBR%20%2F%3ECan%20we%20use%20the%20same%20to%20unlock%20if%20the%20JTAG%20is%20locked%20with%20HSE%20module%20%3F%3CBR%20%2F%3EIf%20yes%2C%20can%20it%20have%20a%20mechanism%20where%20it%20reads%20a%20file%20where%20password%20is%20stored%20and%20unlock%20using%20it.%3CBR%20%2F%3EOr%20how%20can%20I%20insert%20a%20password%20%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2170181%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20JTAG%20password%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2170181%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EYou%20have%20it%20here%20%3A%20c%3A%5CNXP%5CHSE_DEMOAPP_S32K344_0_2_55_0%5Cdemo_security_installer%5Cscripts%5CS32_JTAG_WRITE.cmm%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2170167%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20JTAG%20password%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2170167%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHello%2C%3CBR%20%2F%3EWhere%20can%20I%20find%20this%20%22S32_JTAG_WRITE.cmm%20inside%20HSE_DEMOAPP_S32K3XX_0_2_1_0)%22%20%3F%3CBR%20%2F%3EI%20am%20working%20on%20unlocking%20JTAG%20to%20automate%20whenever%20I%20open%20the%20trace32.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1971730%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%20S32K3%20JTAG%20password%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1971730%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Eyou%20can%20do%20it%20on%20mcu%20as%20PEMicro%20script%20does%2C%26nbsp%3B%20set%20SDAAP%26nbsp%3B%20registers%20to%20unlock%20debug.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1971098%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20JTAG%20password%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1971098%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E1.%20You%20can%20do%20it%20with%20a%20%2431%20service%20%2C%2031%2001%20%26lt%3B16bytes%20jtag_passwd%26gt%3B%2C%20or%20even%20with%20a%20%2422%20(RDBI)%2C%20at%20the%20end%20you%20just%20need%20a%20trigger%20to%20your%20custom%20C%20API%20which%20will%20do%20the%20unlock%20procedure.%3CBR%20%2F%3E2.%20T32%20is%20another%20easier%20option%20(and%20there%20are%20examples%20on%20how%20to%20do%20it%2C%20check%20S32_JTAG_WRITE.cmm%20inside%20HSE_DEMOAPP_S32K3XX_0_2_1_0)%20%2C%20this%20may%20be%20preferred%20method.%3CBR%20%2F%3E3.%20Normally%20when%20you%20do%20an%20attach%20o%20system%20up%20in%20T32%20depends%20on%20the%20scripts%20behind%20but%20normally%20a%20reset%20happens%2C%20also%20when%20flashing%20process%20the%20scripts%20behind%20%5Cdemo%5Carm%5Cflash%5Cs32k3.cmm%20do%20some%20resets%20which%20will%20brake%20your%20%22unlock%22%20situation.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1971049%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20JTAG%20password%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1971049%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20very%20much.%3C%2FP%3E%3CP%3E1.%20Please%20briefly%20explain%20how%20to%20unlock%20the%20Lock%20by%20JTAG%20PASSWORD%20with%20an%20external%20UDS%20message.%3C%2FP%3E%3CP%3E2.%20Should%20I%20input%20the%20JTAG%20PASSWORD%20with%20a%20tool%20like%20T32%20through%20JTAG%3F%20Or%20is%20it%20possible%20to%20input%20it%20with%20a%20UDS%20message%3F%3C%2FP%3E%3CP%3E3.%26nbsp%3BIs%20the%20reason%20why%20reprogramming%20is%20impossible%20because%20reprogramming%20requires%20a%20reset%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1971022%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20JTAG%20password%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1971022%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHi%2C%20morning%2C%20this%20depends%20on%20your%20project%20strategy%2C%20both%20ways%20are%20possible%2C%20UDS%20adviceable%20to%20be%20behind%20a%20security%20access%20mechanism.%20But%20be%20aware%20Jtag%20unlock%20is%20only%20effective%20up%20to%20the%20next%20reset%2C%20any%20kind%20(which%20is%20a%20pain%20..%2C%20normally%20you%20want%20to%20unlock%20to%20debug%20stuff%2C%20hot%20attach%20or%20sleep%2Fwakeup%20imposible%20to%20debug%2C%20reflash%20SW%20almost%20impossible).%20Permanent%20unlock%20of%20Jtag%20is%20not%20possible%20(like%20in%20older%20NXP%20architectures%20or%20in%20Tricore).%3CBR%20%2F%3Eregards%2C%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1970715%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20JTAG%20password%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1970715%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you.%3CBR%20%2F%3EAfter%20Step%203%2C%20if%20JTAG%20is%20locked%2C%20can%20I%20unlock%20JTAG%20by%20entering%20the%20password%20through%20UDS.%3F%3CBR%20%2F%3EOr%20is%20JTAG%20unlock%20only%20possible%20through%20Debug%20Tool%3F%3CBR%20%2F%3EWe%20are%20using%20T32.%20Do%20you%20know%20the%20relevant%20guide%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1968775%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3%20JTAG%20password%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1968775%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%20please%20check%20steps%20inside%20manual%26nbsp%3BRM758221-HSE-B%20Firmware%20Reference%20Manual%2C%20chapter%26nbsp%3BHost%20debug.%3C%2FP%3E%3CP%3EStep%201)%20Provision%20the%20ADKP%20using%20the%20HSE_APP_DEBUG_KEY_ATTR_ID%20attribute.%3C%2FP%3E%3CP%3EStep%202)%20Set%20authorization%20method%3A%20password-based%20or%20challenge-response%20based%2C%20using%20the%20HSE_DEBUG_AUTH_MODE_ATTR_ID%20system%20attribute.%3C%2FP%3E%3CP%3EStep%203)%20Set%20the%20life%20cycle%20to%20OEM_PROD%20or%20IN_FIELD%20using%20the%20HSE_SECURE_LIFECYCLE_ATTR_ID%20system%20attribute.%3C%2FP%3E%3CP%3EAll%20the%20above%20steps%20can%20be%20implemented%20in%20a%20DID%2FUDS%20routine%20no%20issue%20with%20that.%20After%20the%203rd%20step%20you%20ECU%20will%20be%20JTAG%20locked.%20You%20will%20need%20to%20provide%20the%20same%20password%20to%20debug%20tooling%20(Lauterbach%20Trace32%20for%20ex%2C%20.%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E