JTAG Debugging - rpmsg_lite IMX8MP

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

JTAG Debugging - rpmsg_lite IMX8MP

705 Views
AndyCapon
Contributor III

Hi,

Taking as an example the "String Echo FreeRTOS RTOS API Demo". VS Code/MCUXpresso

If I start the debugger (launch) at uboot then all works fine but rebooting the linux side every time is a bit of a pain.

If the debugger (launch) is started after boot then rpmsg_lite_wait_for_link_up() will always hang.

The only way round this I have found is to scp the elf file to the board and then attach the debugger to the board after doing:

echo stop > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/state 
echo debugme.elf > /sys/devices/platform/imx8mp-echo start > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/state
cat /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/state

Is it meant to be like this or is there a trick to get over this and stick to the JTAG programming without using remoteproc?

Thanks

Andy

Labels (1)
Tags (1)
0 Kudos
Reply
3 Replies

641 Views
AndyCapon
Contributor III

Thanks @Zhiming_Liu 

Already doing all that.

Interesting that knowledge base article, I had also tried rpmsg_lite_is_link_up() which failed, also tried without rpmsg_lite_wait_for_link_up() and the link_state in the rpmsg_lite_instance was not set, I'll try without blocking but I guessed before it would be the same...

Thanks

Andy

0 Kudos
Reply

640 Views
AndyCapon
Contributor III

Ah, that knowledge base article is about something different, sorry I misunderstood what you said before and thought it was to do with the link problem.

I don't seem to get the problem in the KB, everything works as long as I get past the link issue. I'm going to look at exactly what remoteproc is doing...

0 Kudos
Reply

644 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @AndyCapon 

If you are using rpmsg str echo demo, you need to load imx_rpmsg_tty driver before you launch JLink in Linux. 

  • Boot into linux
  • modprobe imx_rpmsg_tty
  • Launch JLink

 

If you meet imx rproc kick error in linux, this knowledge base maybe helpful.

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/imx-rproc-kick-failed-0-err-62-during-JL...

Best Regards,
Zhiming

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2300031%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EJTAG%20Debugging%20-%20rpmsg_lite%20IMX8MP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2300031%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3ETaking%20as%20an%20example%20the%20%22%3CSPAN%3EString%20Echo%20FreeRTOS%20RTOS%20API%20Demo%22.%20VS%20Code%2FMCUXpresso%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22inherit%22%3EIf%20I%20start%20the%20debugger%20(launch)%20at%20uboot%20then%20all%20works%20fine%20but%20rebooting%20the%20linux%20side%26nbsp%3B%3C%2FFONT%3Eevery%20time%20is%20a%20bit%20of%20a%20pain.%3C%2FP%3E%3CP%3EIf%20the%20debugger%20(launch)%20is%20started%20after%20boot%20then%20%3CSPAN%3Erpmsg_lite_wait_for_link_up()%20will%20always%20hang.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20only%20way%20round%20this%20I%20have%20found%20is%20to%20scp%20the%20elf%20file%20to%20the%20board%20and%20then%20attach%20the%20debugger%20to%20the%20board%20after%20doing%3A%3C%2FSPAN%3E%3C%2FP%3E%3CPRE%3E%3CSPAN%3Eecho%20stop%20%26gt%3B%20%2Fsys%2Fdevices%2Fplatform%2Fimx8mp-cm7%2Fremoteproc%2Fremoteproc0%2Fstate%3CSPAN%20class%3D%22%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Eecho%20debugme.elf%20%26gt%3B%20%2Fsys%2Fdevices%2Fplatform%2Fimx8mp-%3C%2FSPAN%3E%3CSPAN%3Eecho%20start%20%26gt%3B%20%2Fsys%2Fdevices%2Fplatform%2Fimx8mp-cm7%2Fremoteproc%2Fremoteproc0%2Fstate%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Ecat%20%2Fsys%2Fdevices%2Fplatform%2Fimx8mp-cm7%2Fremoteproc%2Fremoteproc0%2Fstate%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%3EIs%20it%20meant%20to%20be%20like%20this%20or%20is%20there%20a%20trick%20to%20get%20over%20this%20and%20stick%20to%20the%20JTAG%20programming%20without%20using%20remoteproc%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EAndy%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2300031%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MXRT%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2300188%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20JTAG%20Debugging%20-%20rpmsg_lite%20IMX8MP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2300188%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAh%2C%20that%20knowledge%20base%20article%20is%20about%20something%20different%2C%20sorry%20I%20misunderstood%20what%20you%20said%20before%20and%20thought%20it%20was%20to%20do%20with%20the%20link%20problem.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20don't%20seem%20to%20get%20the%20problem%20in%20the%20KB%2C%20everything%20works%20as%20long%20as%20I%20get%20past%20the%20link%20issue.%20I'm%20going%20to%20look%20at%20exactly%20what%20remoteproc%20is%20doing...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2300167%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20JTAG%20Debugging%20-%20rpmsg_lite%20IMX8MP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2300167%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F151788%22%20target%3D%22_blank%22%3E%40Zhiming_Liu%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlready%20doing%20all%20that.%3C%2FP%3E%3CP%3EInteresting%20that%20knowledge%20base%20article%2C%20I%20had%20also%20tried%26nbsp%3B%3CSPAN%3Erpmsg_lite_is_link_up()%20which%20failed%2C%20also%20tried%20without%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Erpmsg_lite_wait_for_link_up()%20and%20the%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Elink_state%20in%20the%20r%3C%2FSPAN%3E%3CSPAN%3Epmsg_lite_instance%20was%20not%20set%2C%20I'll%20try%20without%20blocking%20but%20I%20guessed%20before%20it%20would%20be%20the%20same...%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EAndy%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2300137%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20JTAG%20Debugging%20-%20rpmsg_lite%20IMX8MP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2300137%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%2F55163%22%20target%3D%22_blank%22%3E%40AndyCapon%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20you%20are%20using%20rpmsg%20str%20echo%20demo%2C%20you%20need%20to%20load%20imx_rpmsg_tty%20driver%20before%20you%20launch%20JLink%20in%20Linux.%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EBoot%20into%20linux%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3Emodprobe%20imx_rpmsg_tty%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3ELaunch%20JLink%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIf%20you%20meet%26nbsp%3Bimx%20rproc%20kick%20error%20in%20linux%2C%20this%20knowledge%20base%20maybe%20helpful.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-Processors-Knowledge-Base%2Fimx-rproc-kick-failed-0-err-62-during-JLink-rpmsg-debug%2Fta-p%2F2130567%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-Processors-Knowledge-Base%2Fimx-rproc-kick-failed-0-err-62-during-JLink-rpmsg-debug%2Fta-p%2F2130567%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3EZhiming%3C%2FP%3E%3C%2FLINGO-BODY%3E