Debug the Cortex-M33 on iMX93EVK

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

Debug the Cortex-M33 on iMX93EVK

Jump to solution
4,362 Views
Sander-ET
Contributor II

I am trying to get a debug connection to the Cortex-M33 on the iMX93EVK board, using a SEGGER J-Link. I want to be able to debug while Linux is running on the A55. 

I tried debugging the hello_world demo app on the M33 while the A55 is in U-Boot, following the instructions in AN14120. The U-Boot commands:

fatload mmc 1:1 80000000 sdk20-app.bin

cp.b 0x80000000 0x201e0000 0x10000

bootaux 0x1ffe0000

start the firmware and the output shows up on the serial port. But when I try to connect using the SEGGER JLinkGDBServerExe it fails to find the device. The log shows this:

02-00000000-00-00000041-004D: TB9DF640 005:451.096 ******************************************************
02-00000000-00-00000041-004A: TB9DF640 005:451.097 J-Link script: i.MX93 Cortex-M33 core J-Link script
02-00000000-00-00000041-004D: TB9DF640 005:451.098 ******************************************************
02-00000000-00-00000042-0034: TB9DF640 005:451.523 InitTarget() end - Took 426us
02-00000000-00-00000042-004D: TB9DF640 005:452.146 TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
02-00000000-00-00000044-005B: TB9DF640 005:453.793 Failed to identify target. Resetting via Reset pin and trying again.

It uses the iMX93 J-Link script but fails to connect to the target. Attach from VS Code (with MCUXpresso extension) also does not work.

I get the same result when I try to debug while the A55 is in Linux (after changing the kernel DTS to disable lpuart5).

Only when I put the BOOT_MODE to Cortex-M33 (Infinite Loop) can the J-Link find the device, and I can debug the demo app using VS Code.

Why doesn't the J-Link detect the target with the A55 in U-Boot or Linux?

 

Regards,

Sander

0 Kudos
Reply
1 Solution
4,205 Views
Sander-ET
Contributor II

The solution to this problem was to switch off the UART5 from JTAG on the board with the DIP switches SW101.

View solution in original post

0 Kudos
Reply
5 Replies
4,206 Views
Sander-ET
Contributor II

The solution to this problem was to switch off the UART5 from JTAG on the board with the DIP switches SW101.

0 Kudos
Reply
4,339 Views
Chavira
NXP TechSupport
NXP TechSupport

HI @Sander-ET!

What BSP are you using?

Do you tried to right-click the project in the MCUXpresso for VS Code and choose "Attach to debug the project"?

 

Also you can update the environment of u-boot like we recommend in this post. 

 

Best Regards!

Chavira

0 Kudos
Reply
4,326 Views
Sander-ET
Contributor II

For the Cortex-M33 we are using the MCUXpresso SDK from git (MCUX_2.16.100). We try to start the debugger from Visual Studio Code, using the MCUXpresso extension. We tried the right-click Attach and Debug, both fail to connect but reset the board.

For the Cortex-A we build an image using imx-docker (MACHINE="imx93-11x11-lpddr4x-evk", DISTRO="fsl-imx-xwayland", IMAGES="imx-image-core"). We boot this from SD card. The device tree has been modified to disable lpuart5. Is there a way to verify from Linux that lpuart5 really is disabled?

We also tried to debug booting the original (demo) image in eMMC with the A55 in U-Boot. We get no JTAG connection with this image either.

The suggested change of the u-boot environment did not help.

 

Regards,

Sander

0 Kudos
Reply
4,321 Views
Chavira
NXP TechSupport
NXP TechSupport

HI @Sander-ET!

 

What kernel version are you compiling in Yocto and what pre-build image are you using?

 

You can corroborate if the UART5 is not working if the UART is not listed in the folder /dev/ of the iMX

 

 

0 Kudos
Reply
4,317 Views
Sander-ET
Contributor II

The kernel version we build is imx-6.6.36-2.1.0.

I do not know which pre-build image, it came pre-installed when we bought the EVK. It prints "NXP i.MX Release Distro 6.6-scarthgap imx93evk ttyLP0" on startup, and "Linux version 6.6.36-lts-next-gd23d64eea511" on /proc/version

Under which name would the UART5 show up in /dev? There is a /dev/ttyLP0, would the UART5 show up as /dev/ttyLP5 or some other number? 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1989036%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EDebug%20the%20Cortex-M33%20on%20iMX93EVK%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1989036%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20trying%20to%20get%20a%20debug%20connection%20to%20the%20Cortex-M33%20on%20the%20iMX93EVK%20board%2C%20using%20a%20SEGGER%20J-Link.%20I%20want%20to%20be%20able%20to%20debug%20while%20Linux%20is%20running%20on%20the%20A55.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20debugging%20the%20hello_world%20demo%20app%20on%20the%20M33%20while%20the%20A55%20is%20in%20U-Boot%2C%20following%20the%20instructions%20in%26nbsp%3BAN14120.%20The%20U-Boot%20commands%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3Efatload%20mmc%201%3A1%2080000000%20sdk20-app.bin%3C%2FP%3E%3CP%3Ecp.b%200x80000000%200x201e0000%200x10000%3C%2FP%3E%3CP%3Ebootaux%200x1ffe0000%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3Estart%20the%20firmware%20and%20the%20output%20shows%20up%20on%20the%20serial%20port.%20But%20when%20I%20try%20to%20connect%20using%20the%20SEGGER%26nbsp%3BJLinkGDBServerExe%20it%20fails%20to%20find%20the%20device.%20The%20log%20shows%20this%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3E02-00000000-00-00000041-004D%3A%20TB9DF640%20005%3A451.096%20******************************************************%3CBR%20%2F%3E02-00000000-00-00000041-004A%3A%20TB9DF640%20005%3A451.097%20J-Link%20script%3A%20i.MX93%20Cortex-M33%20core%20J-Link%20script%3CBR%20%2F%3E02-00000000-00-00000041-004D%3A%20TB9DF640%20005%3A451.098%20******************************************************%3CBR%20%2F%3E02-00000000-00-00000042-0034%3A%20TB9DF640%20005%3A451.523%20InitTarget()%20end%20-%20Took%20426us%3CBR%20%2F%3E02-00000000-00-00000042-004D%3A%20TB9DF640%20005%3A452.146%20TotalIRLen%20%3D%20%3F%2C%20IRPrint%20%3D%200x..000000000000000000000000%3CBR%20%2F%3E02-00000000-00-00000044-005B%3A%20TB9DF640%20005%3A453.793%20%3CSTRONG%3EFailed%20to%20identify%20target.%3C%2FSTRONG%3E%20Resetting%20via%20Reset%20pin%20and%20trying%20again.%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3EIt%20uses%20the%20iMX93%20J-Link%20script%20but%20fails%20to%20connect%20to%20the%20target.%20%3CEM%3EAttach%3C%2FEM%3E%20from%20VS%20Code%20(with%20MCUXpresso%20extension)%20also%20does%20not%20work.%3C%2FP%3E%3CP%3EI%20get%20the%20same%20result%20when%20I%20try%20to%20debug%20while%20the%20A55%20is%20in%20Linux%20(after%20changing%20the%20kernel%20DTS%20to%20disable%20lpuart5).%3C%2FP%3E%3CP%3EOnly%20when%20I%20put%20the%20BOOT_MODE%20to%20Cortex-M33%20(Infinite%20Loop)%20can%20the%20J-Link%20find%20the%20device%2C%20and%20I%20can%20debug%20the%20demo%20app%20using%20VS%20Code.%3C%2FP%3E%3CP%3EWhy%20doesn't%20the%20J-Link%20detect%20the%20target%20with%20the%20A55%20in%20U-Boot%20or%20Linux%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3ESander%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1992000%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Debug%20the%20Cortex-M33%20on%20iMX93EVK%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1992000%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThe%20solution%20to%20this%20problem%20was%20to%20switch%20off%20the%20UART5%20from%20JTAG%20on%20the%20board%20with%20the%20DIP%20switches%20SW101.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1990239%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Debug%20the%20Cortex-M33%20on%20iMX93EVK%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1990239%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThe%20kernel%20version%20we%20build%20is%26nbsp%3Bimx-6.6.36-2.1.0.%3C%2FP%3E%3CP%3EI%20do%20not%20know%20which%20pre-build%20image%2C%20it%20came%20pre-installed%20when%20we%20bought%20the%20EVK.%20It%20prints%20%22NXP%20i.MX%20Release%20Distro%206.6-scarthgap%20imx93evk%20ttyLP0%22%20on%20startup%2C%20and%20%22Linux%20version%206.6.36-lts-next-gd23d64eea511%22%20on%20%2Fproc%2Fversion%3C%2FP%3E%3CP%3EUnder%20which%20name%20would%20the%20UART5%20show%20up%20in%20%2Fdev%3F%20There%20is%20a%20%2Fdev%2FttyLP0%2C%20would%20the%20UART5%20show%20up%20as%20%2Fdev%2FttyLP5%20or%20some%20other%20number%3F%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1990217%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Debug%20the%20Cortex-M33%20on%20iMX93EVK%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1990217%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHI%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F243013%22%20target%3D%22_blank%22%3E%40Sander-ET%3C%2FA%3E!%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EWhat%20kernel%20version%20are%20you%20compiling%20in%20Yocto%20and%20what%20pre-build%20image%20are%20you%20using%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EYou%20can%20corroborate%20if%20the%20UART5%20is%20not%20working%20if%20the%20UART%20is%20not%20listed%20in%20the%20folder%20%2Fdev%2F%20of%20the%20iMX%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1990001%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Debug%20the%20Cortex-M33%20on%20iMX93EVK%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1990001%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EFor%20the%20Cortex-M33%20we%20are%20using%20the%26nbsp%3BMCUXpresso%20SDK%20from%20git%20(%3CSPAN%3EMCUX_2.16.100)%3C%2FSPAN%3E.%20We%20try%20to%20start%20the%20debugger%20from%20Visual%20Studio%20Code%2C%20using%20the%20MCUXpresso%20extension.%20We%20tried%20the%20right-click%20Attach%20and%20Debug%2C%20both%20fail%20to%20connect%20but%20reset%20the%20board.%3C%2FP%3E%3CP%3EFor%20the%20Cortex-A%20we%20build%20an%20image%20using%20imx-docker%20(MACHINE%3D%22imx93-11x11-lpddr4x-evk%22%2C%26nbsp%3BDISTRO%3D%22fsl-imx-xwayland%22%2C%26nbsp%3BIMAGES%3D%22imx-image-core%22).%20We%20boot%20this%20from%20SD%20card.%20The%20device%20tree%20has%20been%20modified%20to%20disable%20lpuart5.%20Is%20there%20a%20way%20to%20verify%20from%20Linux%20that%20lpuart5%20really%20is%20disabled%3F%3C%2FP%3E%3CP%3EWe%20also%20tried%20to%20debug%20booting%20the%20original%20(demo)%20image%20in%20eMMC%20with%20the%20A55%20in%20U-Boot.%20We%20get%20no%20JTAG%20connection%20with%20this%20image%20either.%3C%2FP%3E%3CP%3EThe%20suggested%20change%20of%20the%20u-boot%20environment%20did%20not%20help.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3ESander%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1989543%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Debug%20the%20Cortex-M33%20on%20iMX93EVK%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1989543%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHI%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F243013%22%20target%3D%22_blank%22%3E%40Sander-ET%3C%2FA%3E!%3C%2FP%3E%0A%3CP%3EWhat%20BSP%20are%20you%20using%3F%3C%2FP%3E%0A%3CP%3EDo%20you%20tried%20to%20right-click%20the%20project%20in%20the%20MCUXpresso%20for%20VS%20Code%20and%20choose%20%22Attach%20to%20debug%20the%20project%22%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EAlso%20you%20can%20update%20the%20environment%20of%20u-boot%20like%20we%20recommend%20in%20this%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-Processors%2FiMX93-A-core-M-core-cannot-be-activated-simultaneously%2Fm-p%2F1886555%22%20target%3D%22_self%22%3Epost.%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBest%20Regards!%3C%2FP%3E%0A%3CP%3EChavira%3C%2FP%3E%3C%2FLINGO-BODY%3E