S32K44: JTAG disabled by AUTOSAR

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

S32K44: JTAG disabled by AUTOSAR

3,097 Views
ArushThomas
Contributor III

Hi all,

I've got a problem with programming an S32K344 development board. I had previously been testing the AUTOSAR MCAL, and accidentally flashed firmware without configuring the SWD and JTAG pins. It seems this has disabled the SWD and JTAG interfaces, preventing me from flashing any new firmware. I've been attempting to use Segger's J-Link tools to erase the chip, to no success.

I've written a .jlink script and a windows batch file to repeatedly try to connect and erase the chip. There are promising statements in the Jlink log, such as "Debug access enabled", "Successfully connected to selected DAP TAP.", and so on. I've attached the log to this post named "Jlink_CLI_log.txt". Unfortunately, in the end, it says "Locked device detected" and prompts for a 16-byte password. This is despite previously stating, "Device is not locked. Proceeding without the unlock procedure."

As I understand, this 16-byte password is an optional feature available in the S32K3 platform to prevent tampering in deployment environments. I haven't enabled this feature, so I'm looking for further debug methodologies.

I'm wondering if there's some way I can induce a crash or assertion in runtime, during Mcu_Init(), Mcu_InitClock() or early-on in Port_Init()? Might that prevent disabling of JTAG, and provide time to erase the chip?

0 Kudos
Reply
4 Replies

3,068 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @ArushThomas 

Segger specifies that if an authentication key is required to enable debug access but has not yet been specified, a dialog box will appear prompting you to enter the key. For more details, please refer to the section "Specifying the authentication code using the ID Code dialog" in the following link:

SEGGER - NXP S32K3xx

If you are not seeing this behavior, could you please share a screenshot of the error message you are encountering? It seems the log file "Jlink_CLI_log.txt" was not uploaded successfully, so I was not able to analyze it. Could you kindly upload the file again?

 

BR, VaneB

0 Kudos
Reply

2,026 Views
mkayondo
Contributor II

Hi, how did you solve this issue?

0 Kudos
Reply

3,053 Views
ArushThomas
Contributor III

Segger specifies that if an authentication key is required to enable debug access but has not yet been specified, a dialog box will appear prompting you to enter the key.

I am getting the dialog box, prompting for a 16-byte key. And while I'm aware of this authentication feature, I hadn't enabled it. I'm suspecting Segger incorrectly detects an authentication requirement, due to my firmware disabling JTAG soon after connection. Is this a plausible explanation?

Apologies for the missing log file. I've attached it to this reply, along with a screenshot of the dialog box, and the scripts I've been using to attempt a recovery.

0 Kudos
Reply

2,960 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @ArushThomas 

Thank you for sharing the information. I am not an expert in Segger devices, but based on what you have provided, it does not seem like there is an issue with the microcontroller or the software, as the microcontroller is not secured or locked.

From the image you shared, it appears to be a debugger configuration. I recommend reviewing the section titled 'Specifying the authentication code using the ID Code dialog' from the previously shared link. Could you please verify the situation by following the steps described there?

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2135812%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K44%3A%20JTAG%20disabled%20by%20AUTOSAR%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2135812%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3EI've%20got%20a%20problem%20with%20programming%20an%20S32K344%20development%20board.%20I%20had%20previously%20been%20testing%20the%20AUTOSAR%20MCAL%2C%20and%20accidentally%20flashed%20firmware%20without%20configuring%20the%20SWD%20and%20JTAG%20pins.%20It%20seems%20this%20has%20disabled%20the%20SWD%20and%20JTAG%20interfaces%2C%20preventing%20me%20from%20flashing%20any%20new%20firmware.%20I've%20been%20attempting%20to%20use%20Segger's%20J-Link%20tools%20to%20erase%20the%20chip%2C%20to%20no%20success.%3C%2FP%3E%3CP%3EI've%20written%20a%20.jlink%20script%20and%20a%20windows%20batch%20file%20to%20repeatedly%20try%20to%20connect%20and%20erase%20the%20chip.%20There%20are%20promising%20statements%20in%20the%20Jlink%20log%2C%20such%20as%20%22Debug%20access%20enabled%22%2C%20%22Successfully%20connected%20to%20selected%20DAP%20TAP.%22%2C%20and%20so%20on.%20I've%20attached%20the%20log%20to%20this%20post%20named%20%22Jlink_CLI_log.txt%22.%20Unfortunately%2C%20in%20the%20end%2C%20it%20says%20%22Locked%20device%20detected%22%20and%20prompts%20for%20a%2016-byte%20password.%20This%20is%20despite%20previously%20stating%2C%20%22Device%20is%20not%20locked.%20Proceeding%20without%20the%20unlock%20procedure.%22%3C%2FP%3E%3CP%3EAs%20I%20understand%2C%20this%2016-byte%20password%20is%20an%20optional%20feature%20available%20in%20the%20S32K3%20platform%20to%20prevent%20tampering%20in%20deployment%20environments.%20I%20haven't%20enabled%20this%20feature%2C%20so%20I'm%20looking%20for%20further%20debug%20methodologies.%3C%2FP%3E%3CP%3EI'm%20wondering%20if%20there's%20some%20way%20I%20can%20induce%20a%20crash%20or%20assertion%20in%20runtime%2C%20during%26nbsp%3B%3CSPAN%3EMcu_Init()%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EMcu_InitClock()%20or%20early-on%20in%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EPort_Init()%3F%20Might%20that%20prevent%20disabling%20of%20JTAG%2C%20and%20provide%20time%20to%20erase%20the%20chip%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2137629%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K44%3A%20JTAG%20disabled%20by%20AUTOSAR%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2137629%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F227167%22%20target%3D%22_blank%22%3E%40ArushThomas%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20sharing%20the%20information.%20I%20am%20not%20an%20expert%20in%20Segger%20devices%2C%20but%20based%20on%20what%20you%20have%20provided%2C%20it%20does%20not%20seem%20like%20there%20is%20an%20issue%20with%20the%20microcontroller%20or%20the%20software%2C%20as%20the%20microcontroller%20is%20not%20secured%20or%20locked.%3C%2FP%3E%0A%3CP%3EFrom%20the%20image%20you%20shared%2C%20it%20appears%20to%20be%20a%20debugger%20configuration.%20I%20recommend%20reviewing%20the%20section%20titled%20'Specifying%20the%20authentication%20code%20using%20the%20ID%20Code%20dialog'%20from%20the%20previously%20shared%20link.%20Could%20you%20please%20verify%20the%20situation%20by%20following%20the%20steps%20described%20there%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2136826%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K44%3A%20JTAG%20disabled%20by%20AUTOSAR%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2136826%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CBLOCKQUOTE%3E%3CP%3E%3CSPAN%3ESegger%20specifies%20that%20if%20an%20authentication%20key%20is%20required%20to%20enable%20debug%20access%20but%20has%20not%20yet%20been%20specified%2C%20a%20dialog%20box%20will%20appear%20prompting%20you%20to%20enter%20the%20key.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3EI%20am%20getting%20the%20dialog%20box%2C%20prompting%20for%20a%2016-byte%20key.%20And%20while%20I'm%20aware%20of%20this%20authentication%20feature%2C%20I%20hadn't%20enabled%20it.%20I'm%20suspecting%20Segger%20incorrectly%20detects%20an%20authentication%20requirement%2C%20due%20to%20my%20firmware%20disabling%20JTAG%20soon%20after%20connection.%20Is%20this%20a%20plausible%20explanation%3F%3C%2FP%3E%3CP%3EApologies%20for%20the%20missing%20log%20file.%20I've%20attached%20it%20to%20this%20reply%2C%20along%20with%20a%20screenshot%20of%20the%20dialog%20box%2C%20and%20the%20scripts%20I've%20been%20using%20to%20attempt%20a%20recovery.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2136783%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K44%3A%20JTAG%20disabled%20by%20AUTOSAR%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2136783%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F227167%22%20target%3D%22_blank%22%3E%40ArushThomas%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESegger%20specifies%20that%20if%20an%20authentication%20key%20is%20required%20to%20enable%20debug%20access%20but%20has%20not%20yet%20been%20specified%2C%20a%20dialog%20box%20will%20appear%20prompting%20you%20to%20enter%20the%20key.%20For%20more%20details%2C%20please%20refer%20to%20the%20section%20%22Specifying%20the%20authentication%20code%20using%20the%20ID%20Code%20dialog%22%20in%20the%20following%20link%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fkb.segger.com%2FNXP_S32K3xx%23Debug_Authentication%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ESEGGER%20-%26nbsp%3BNXP%20S32K3xx%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20not%20seeing%20this%20behavior%2C%20could%20you%20please%20share%20a%20screenshot%20of%20the%20error%20message%20you%20are%20encountering%3F%20It%20seems%20the%20log%20file%20%22Jlink_CLI_log.txt%22%20was%20not%20uploaded%20successfully%2C%20so%20I%20was%20not%20able%20to%20analyze%20it.%20Could%20you%20kindly%20upload%20the%20file%20again%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%2C%20VaneB%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2269722%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K44%3A%20JTAG%20disabled%20by%20AUTOSAR%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2269722%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%20how%20did%20you%20solve%20this%20issue%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E