rpmsg_lite_str_echo_rtos stuck at rpmsg_lite_is_link_up() when run from debugger with Linux running?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

rpmsg_lite_str_echo_rtos stuck at rpmsg_lite_is_link_up() when run from debugger with Linux running?

跳至解决方案
2,463 次查看
paulw2
Contributor II

Hi,

rpmsg_lite_str_echo_rtos from SDK_2.9.1_EVK-MIMX8MM on evkmimx8mm board - 5.4-zeus

I can successfully load and run rpmsg_lite_str_echo_rtos_imxcm4.elf using remoteproc from A53 Linux and  can send RPMsg messsages to the M4 using /dev/ttyRPMSG30.

However, with Linux booted on the A53 when I load and run the same M4 firmware
using JTAG debugger, the "RPMSG String Echo FreeRTOS RTOS API Demo..." message is printed on the M4 console but nothing else and RPMsg between Linux on A53 and M4 does not work.

As I can debug the rpmsg_lite_str_echo_rtos firmware, set breakpoints, etc, I see that main_remote.c:app_task() remains stuck in while (0 == rpmsg_lite_is_link_up(my_rpmsg))

main_remote.c:app_task()

while (0 == rpmsg_lite_is_link_up(my_rpmsg))
;

Please could someone explain this ?

If I interrupt the boot process and break into u-boot, load rpmsg_lite_str_echo_rtos using the JTAG debugger, then boot to Linux, RPMsg works OK (as it does when loaded and run using remoteproc) and I can debug the firmware OK too.

I’d really appreciate an explanation of why RPMsg does not work when the M4 firmware is loaded via JAG debugger while Linux is running on the A53 and hopefully how to overcome this problem.

Thanks in advance.

0 项奖励
1 解答
2,434 次查看
AldoG
NXP TechSupport
NXP TechSupport

Hello,

I believe this already reached you, if not please check the following, the steps team have shared for this to work are the following:
 

  • u-boot=> setenv fdt_file imx8mm-evk-rpmsg.dtb #It still works to start your C-M program here, but that might necessitate subtle changes below.
  • Boot Linux. Login.
  • modprobe imx_rpmsg_tty
  • cd /sys/class/remoteproc/remoteproc0 #For convenience — most of our remoteproc pseudo-files are here.
  • echo /run/media/mmcblk1p1/ >/sys/module/firmware_class/parameters/path
  • echo imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.elf >firmware #Note: *.elf, not *.bin.
  • cat state #It should report offline
  • Load C-M program via JTAG
  • echo start >state
  • Load a new C-M program via JTAG
  • echo stop >state
  • echo start >state   


Then you just need to repeat steps 10 -12 if you disconnect the debugger to load a new image.

Best regards,
Aldo.

在原帖中查看解决方案

3 回复数
2,435 次查看
AldoG
NXP TechSupport
NXP TechSupport

Hello,

I believe this already reached you, if not please check the following, the steps team have shared for this to work are the following:
 

  • u-boot=> setenv fdt_file imx8mm-evk-rpmsg.dtb #It still works to start your C-M program here, but that might necessitate subtle changes below.
  • Boot Linux. Login.
  • modprobe imx_rpmsg_tty
  • cd /sys/class/remoteproc/remoteproc0 #For convenience — most of our remoteproc pseudo-files are here.
  • echo /run/media/mmcblk1p1/ >/sys/module/firmware_class/parameters/path
  • echo imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.elf >firmware #Note: *.elf, not *.bin.
  • cat state #It should report offline
  • Load C-M program via JTAG
  • echo start >state
  • Load a new C-M program via JTAG
  • echo stop >state
  • echo start >state   


Then you just need to repeat steps 10 -12 if you disconnect the debugger to load a new image.

Best regards,
Aldo.

2,014 次查看
Earthshine
Contributor II

I'm running into this same problem, and having problems using this work-around.  Specifically:

  • echo /media/usb-drive/rpmsg_lite_str_echo_rtos_imxcm7.out >firmware #my ELF file from IAR EWARM.
    • state is running, so this fails.  I do "echo stop > state" and then can do this step.
  • cat state #It should report offline
  • Load C-M program via JTAG
    • This isn't explicitly stated, but after the load I have to also do a "run" (using IAR EWARM) or else the Linux console is unresponsive.
  • echo start >state
    • I get: [ 310.724906] remoteproc remoteproc0: powering up imx-rproc
      [ 310.730463] remoteproc remoteproc0: Direct firmware load for /media/usb-drive/rpmsg_lite_str_echo_rtos_imxcm7.out failed with error -2
      [ 310.742608] remoteproc remoteproc0: request_firmware failed: -2
      [ 310.748576] remoteproc remoteproc0: Boot failed: -2
      -sh: echo: write error: No such file or directory

rpmsg_lite_str_echo_rtos_imxcm7.out is my ELF file, and it is indeed located in /media/usb-drive.  Thoughts, suggestions?

 

0 项奖励
2,428 次查看
paulw2
Contributor II

Thanks Aldo, yes, this process works for me.

0 项奖励