Problem in debugging rpmsg

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

Problem in debugging rpmsg

2,852 Views
biafra
Senior Contributor I

Hi everyone,

 

I'm working on a custom board based on i.MX8M mini with Eclipse, GNU Arm Embedded toolchain and Segger J-Link.

I'm having a problem on debugging rpmsg using pingpong example.

With linux running, I load the program using the debugger, the program starts and initializes the rpmsg, but it waits indefinitely in the rpmsg_lite_wait_for_link_up() function. The same program loaded from linux with remoteproc works fine.

The is compiled for intenal RAM (0x1FFE000).

 

Did anyone already see this behaviour?

 

Many thanks

Biafra

7 Replies

2,798 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @biafra,

I hope you are doing well.
 
Please make sure that you have configured menuconfig options as shown in 2.8.4 Menu Configuration Options in i.MX Linux Reference Manual and followed the below steps,
 
=> setenv fdt_file imx8mm-evk-rpmsg.dtb
 
Please make sure that you have compiled m4 binary using any of the debug release (build_ddr_debug.sh or build_debug.sh or build_flash_debug.sh)
 
This issue could arise if the linux module is not loaded correctly after the linux boot, and m4 core still waiting for rpmsg-lite channel link up.
 
Please make sure that kernel module is loaded correctly using modprobe utility in linux.
$ modprobe imx_rpmsg_pingpong
 
Thanks & Regards,
Dhruvit Vasavada

2,792 Views
biafra
Senior Contributor I

Hi @Dhruvit,

 

Many thanks for your answer.

 

These are the steps I do when it works:

  • Linux boot
  • I load and start the M4 program:

 

echo -n ~/ > /sys/module/firmware_class/parameters/path
echo -n linux_remote.elf > /sys/class/remoteproc/remoteproc0/firmware
echo start > /sys/class/remoteproc/remoteproc0/state

remoteproc remoteproc0: powering up imx-rproc
remoteproc remoteproc0: Booting fw image linux_remote_2_13.elf, size 3534088
 remoteproc0#vdev0buffer: assigned reserved memory node vdevbuffer@78400000
virtio_rpmsg_bus virtio0: rpmsg host is online
 remoteproc0#vdev0buffer: registered virtio0 (type 7)
remoteproc remoteproc0: remote processor imx-rproc is now up
virtio_rpmsg_bus virtio0: creating channel rpmsg-openamp-demo-channel addr 0x1e

 

  • At the same time in the M4 terminal console there are the messages:

 

RPMSG Ping-Pong FreeRTOS RTOS API Demo...
RPMSG Share Base Addr is 0x78000000

Link is up!
Nameservice announce sent.

 

  • At this time I load the ping pong module:

 

modprobe imx_rpmsg_pingpong
90:init
42:rpmsg_pingpong_probe
imx_rpmsg_pingpong virtio0.rpmsg-openamp-demo-channel.-1.30: new channel: 0x400 -> 0x1e!
get 1 (src: 0x1e)
get 3 (src: 0x1e)
get 5 (src: 0x1e)
[...]
get 99 (src: 0x1e)
get 101 (src: 0x1e)
imx_rpmsg_pingpong virtio0.rpmsg-openamp-demo-channel.-1.30: goodbye!

 

  • In the corresponding M4 terminal console there are the messages:

 

Waiting for ping...
Sending pong...
Waiting for ping...
Sending pong...
Waiting for ping...
Sending pong...
[...]
Waiting for ping...
Sending pong...
Waiting for ping...
Sending pong...
Ping pong done, deinitializing...
Looping forever...

 

 

These are the steps I do when it doesn't work:

  • Linux boot
  • Using the IDE (Eclipse & J-Link) I load and start the M4 program
  • These are the only messages displayed in the M4 terminal console:

 

RPMSG Ping-Pong FreeRTOS RTOS API Demo...
RPMSG Share Base Addr is 0x78000000

 

  • Then I load the ping pong module and these are the only messages displayed in the linux console:

 

modprobe imx_rpmsg_pingpong
90:init

 

 

The M4 program is compiled using the MIMX8MM6xxxxx_cm4_ram.ld linker file.

 

Am I making some mistakes?

 

Many thanks

Biafra

 

2,747 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @biafra,

I hope you are doing well.

Please try following the steps below 
  • build m4 binary using (build_debug.sh or build_debug.bat)
  • Stop at u-boot and set fdtfile as  imx8mm-evk-rpmsg.dtb
  • Using the IDE (Eclipse & J-Link) I load and start the M4 program
  • Linux Boot
  • modprobe imx_rpmsg_pingpong
Please make a note that RPMSG demos can be debugged only starting from U-Boot.
Please refer to 5.5 Debug RPMSG demos in Debug RPMSG demos
 
I hope it helps!
 
Thanks & Regards,
Dhruvit Vasavada

2,634 Views
biafra
Senior Contributor I

Hi @Dhruvit,

 

Hi tried your suggestion, but with no luck.

The behaviour is the same as before: the M4 core is not able to hanshake that the link is up, it waits indefintely in the rpmsg_lite_wait_for_link_up() function, even after loading the pingpong module.

 

Many thanks

Biafra

 

2,568 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @biafra,

I hope you are doing well.

Please make sure that you started the M4 application after stopping at the u-boot console and making necessary device tree changes.

Please refer to the steps and Notes mentioned in 5.5 Debug RPMSG demos and 5.6 at Debug RPMSG demos.

Please make sure that you have configured the breakpoint correctly.

Thanks & Regards,
Dhruvit Vasavada

2,551 Views
biafra
Senior Contributor I

HI @Dhruvit,

 

In the previous test I forgot to add

    status = "disabled";

in the imx8mm-cm4 node.

Now I followed all the things you noticed, but the behaviour is still the same.

This time there also the problem that I can use remoteproc: /dev/remoteproc0 doesn't exist.

 

Many thanks

Biafra

 

2,369 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @biafra,

I hope you are doing well.

If the rpmsg node is missing then suggested device tree changes are not required.

Please be careful to set breakpoints or debug step by step in rpmsg demos because when the M core is stopped even the A core is blocked.

Please make sure that you have followed all the steps and notes mentioned in Debug RPMSG demos.

Please provide me with the device tree used for further debugging.

Please refer to the below-mentioned link where rpmsg demos are debugged successfully.

https://community.nxp.com/t5/i-MX-Processors/rpmsg-lite-str-echo-rtos-stuck-at-rpmsg-lite-is-link-up...

Thanks & Regards,
Dhruvit Vasavada.

0 Kudos