Colibri IMX7 RPMsg kernel modules not loading

Hey @eric.tx ,

In my latest run, I remove the RPMsg kernel module import from my tsbuild.yaml file, and now it looks like this:

# >> NOTES:
# >> Lines containing ">>" are simply comments explaining the properties that
# >> follow; if you don't like these comments run:
# >>   $ grep -v '>>' tcbuild.yaml > tcbuild-clean.yaml
# >> A line not containing ">>" can be uncommented (by removing the hash mark
# >> plus a space from its beginning); also set the corresponding property to
# >> appropriate values.
# >> When uncommenting a line having a property, remember to uncomment all its
# >> parent properties as well; for example: if you uncomment the
# >> 'splash-screen' property, also uncomment its parent property called
# >> 'customization'.

# >> The input section specifies the image to be taken as the base for the
# >> customization.
input:
  easy-installer:
    # >> Choose one of the options (REQUIRED):
    # >> (1) Image as local folder or tarball.
    local: torizon-core-docker-verdin-imx8mp-Tezi_6.6.1+build.14.tar 
    # >> (2) Remote file (optionally with a filename and or a sha256 checksum):
    # remote: "https://artifacts.toradex.com/.../torizon-core-docker-apalis-imx8-Tezi_5.1.0%2Bbuild.1.tar"
    # remote: "https://artifacts.toradex.com/.../torizon-core-docker-colibri-imx6-Tezi_5.0.0-devel-202009%2Bbuild.2.tar;filename=torizon-core-docker-colibri-imx6-Tezi_5.0.0-devel-202009+build.2.tar;sha256sum=368595fa3fb00af9604e70311de3b04df6b30b280deec2f8918c46f479026ddb"
    # >> (3) Image specification (URL will be generated by the tool)
    # toradex-feed:
    #   version: "5.1.0"
    #   release: quarterly
    #   machine: colibri-imx7-emmc
    #   distro: torizon-upstream
    #   variant: torizon-core-docker
    #   build-number: "1"
    #   # build-date: "20210408"

# >> The customization section defines the modifications to be applied to get
# >> the desired output image.
customization:
  # >> Splash screen:
  # splash-screen: custom-splash-screen.png
  # >> Directories overlayed to the base OSTree
  # filesystem:
     # - changes/
   device-tree:
    # >> Directories where to look for include files.
     include-dirs:
      - device-tree-overlays/include
      - linux-toradex/include
    # >> Custom device tree source:
     #custom: linux-toradex/arch/arm/boot/dts/imx7d-colibri-emmc-eval-v3.dts
    # >> Device-tree overlays configuration:
     overlays:
      add:
        - device-tree-overlays/overlays/verdin-imx8mp_hmp_overlay.dts
        - device-tree-overlays/overlays/verdin-imx8-setup.dts

      # >> Whether to ignore all overlays from the base image (or ostree
      # >> archive in the future).
      # clear: false
      # >> Specific overlays not to use from base image (useful only when
      # >> clear is false and not DT has been selected).
      # remove:
        # - apalis-imx8_hdmi_overlay.dtbo
      # >> Overlays to add to output image.
      # add:
      # kernel:
    # >> Custom kernel arguments.
    # arguments:
      # - key1=val1
      # - key2=val2
    # >> Modules to build and possibly load automatically.
    # modules:
      # - source-dir: virtual_touchscreen/
      #   autoload: false

# >> The output section defines properties of the output image.
output:
  # >> OSTree deployment configuration (relevant also for Easy Installer output).
  # ostree:
    # branch: my-dev-branch
    # commit-subject: "OSTree commit subject"
    # commit-body: "OSTree commit body"
  # >> Parameters for deploying to an Easy Installer image.
  easy-installer:
    # >> Output directory of the customized image (REQUIRED):
    local: output_directory
    # >> Information used by Toradex Easy Installer:
    # name: "My customized image"
    # description: "My customized image (description)"
    # licence: files/custom-licence.html
    # release-notes: files/custom-release-notes.html
    # accept-licence: true
    # autoinstall: true
    # autoreboot: true
    # bundle:
      # >> Choose one of the options:
      # >> (1) Specify a docker-compose file whose referenced images will be downloaded.
      # >>     Properties platform, username, password and registry are optional.
      # compose-file: files/docker-compose.yml
      # platform: linux/arm/v7
      # username: "${USERNAME}"
      # password: "${PASSWORD}"
      # registry: hub.docker.com
      # >> (2) Specify a local directory containing the bundled images (previously
      # >>     obtained by 'torizoncore-builder bundle' command).
      # dir: bundle/
    # >> Provisioning configuration:
    # provisioning:
      # >> For "online" mode, properties "shared-data" and "online-data" must be specified.
      # >> For "offline" mode, property "shared-data" must be specified alone.
      # mode: "online"
      # shared-data: "shared-data.tar.gz"
      # online-data: "${ONLINE_PROVISIONING_DATA:?online provisioning data not supplied}"

I’ve gone into the bootloader and started the Ping-Pong demo on the M core:

I’ve started the RPMsg ping pong task on the A core:

But still no output from the M core.

Best,
Mit

Hey @eric.tx ,

Do I have to make any of the changes mentioned here: https://variwiki.com/index.php?title=MCUXpresso_VSCode#Debug_RPMSG_demos

I’m trying to debug why the RPMsg “Link is up” message is not appearing on the M core side as outlined on line 120 of: ~/cortex-m/boards/evkmimx8mp/multicore_examples/rpmsg_lite_pingpong_rtos/linux_remote/main_remote.c

Best,
Mit

Hey @mit,

No, this is for a different SoM and different NXP chip (IMX8MM vs IMX8MP)

Can you share your uboot environmental variables and toolchain version?

-Eric

Hey @eric.tx ,

Thanks for the clarification, below are the requested information:

  1. Toolchain version: gcc-arm-11.2-2022.02-x86_64-arm-none-eabi

And this is the demo that I am building:

  1. Below are my uboot parameters:
Verdin iMX8MP # printenv
altbootcmd=env set rollback 1; run bootcmd
arch=arm
baudrate=115200
board=verdin-imx8mp
board_name=verdin-imx8mp
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_efi_bootmgr=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_file=Image
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr
boot_scripts=boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc1 mmc2 dhcp 
bootcmd=run bootcmd_mmc2
bootcmd_dhcp=devtype=dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mfg=fastboot 0
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_mmc2=devnum=2; run mmc_boot
bootcmd_usb0=devnum=0; run usb_boot
bootcount=1
bootdelay=1
bootfstype=ext4
bootlimit=3
carrier_serial#=11349823
console=ttymxc2
cpu=armv8
devplist=1
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
eth1addr=00:14:2d:f6:d6:2d
ethact=ethernet@30bf0000
ethaddr=00:14:2d:e6:d6:2d
ethprime=eth0
fastboot_dev=mmc2
fdt_addr_r=0x50200000
fdt_board=dev
fdt_high=0xffffffffffffffff
fdtcontroladdr=ffb00e80
fdtfile=imx8mp-verdin-wifi-dev.dtb
fileaddr=50280000
filesize=3cd
initrd_addr=0x43800000
initrd_high=0xffffffffffffffff
ipaddr=192.168.10.2
kernel_addr_r=0x48200000
kernel_comp_addr_r=0x40200000
kernel_comp_size=0x08000000
load_cmd=ext4load mmc 2:1
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadaddr=0x48200000
loadm4image=ext4load mmc 2:1 0x48200000 /ostree/deploy/torizon/var/rpmsg_lite_pingpong_rtos_linux_remote.bin
m4boot=ext4load mmc 2:1 0x48200000 /ostree/deploy/torizon/var/rpmsg_lite_pingpong_rtos_linux_remote.bin; cp.b 0x48200000 0x7e0000 19000; dcache flush; bootaux 0x7e0000
m4image=/ostree/deploy/torizon/var/rpmsg_lite_pingpong_rtos_linux_remote.bin
m4image_size=19000
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
netmask=255.255.255.0
preboot=test -n ${fdtfile} || setenv fdtfile imx8mp-verdin-${variant}-${fdt_board}.dtb
ramdisk_addr_r=0x50300000
rollback=0
rootpath=/srv/nfs
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_efi_bootmgr;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x50280000
serial#=15128109
serverip=192.168.10.1
setup=setenv setupargs console=tty1 console=${console},${baudrate} consoleblank=0 earlycon
soc=imx8m
soc_type=imx8mp
update_uboot=askenv confirm Did you load flash.bin (y/N)?; if test "$confirm" = "y"; then setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200; mmc dev 2 1; mmc write ${loadaddr} 0x0 ${blkcnt}; fi
upgrade_available=0
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
variant=wifi
vendor=toradex
ver=U-Boot 2022.04-6.6.1+git.d262075124dc (Jan 01 1970 - 00:00:00 +0000)

Environment size: 4986/8188 bytes

And I can confirm that my binaries exist in the specified path:

Verdin iMX8MP # ext4ls mmc 2:1 /ostree/deploy/torizon/var
<DIR>       4096 .
<DIR>       4096 ..
<DIR>       4096 rootdirs
<DIR>       4096 lib
<DIR>       4096 tmp
<SYM>         11 lock
<SYM>          6 run
               0 .ostree-selabeled
<SYM>         17 log
<DIR>       4096 sota
<DIR>       4096 volatile
<DIR>       4096 roothome
<DIR>       4096 usrlocal
<DIR>       4096 cache
<DIR>       4096 spool
           18608 hello_world.bin
             190 .updated
           40412 rpmsg_lite_pingpong_rtos_linux_remote.bin
           39220 rpmsg_lite_str_echo_rtos.bin

Seperately, should I disable Wifi from the device tree to resolve this error that keeps printing to the console ? :

Let me know what you think !

Best,
Mit

Hey @eric.tx ,

Some things that I tried today to try to resolve the issue:

I ran through the following: Need help to set up rpmsg on dalhia board with imx8m-plus - #5 by henrique.tx

  1. Heterogeneous Multi-core Processing (HMP) Documentation Overview | Toradex Developer Center
  2. Setting Up MCUXpresso SDK and Toolchain for Cortex-M development | Toradex Developer Center
  3. How to Load Compiled Binaries into Cortex-M | Toradex Developer Center
  4. How to Run Hello World on the Cortex-M | Toradex Developer Center
  5. Cortex-M RPMsg Guide | Toradex Developer Center
  6. How to Use RemoteProc | Toradex Developer Center

And made sure that the RPMsg memory addresses for vdev0vring0, vdev0vring1, rsc_table, vdevbuffer were all based off the 0x55000000U as defined in ~sdk/multicore_examples/rpmsg_lite_str_echo_rtos/board.h:

/* Shared memory base for RPMsg communication. */
#define VDEV0_VRING_BASE      (0x55000000U)
#define RESOURCE_TABLE_OFFSET (0xFF000)

And I’m still unable to establish the RPMsg link. On the A core side I only see the following:

# dmesg | grep -i rpmsg
[    0.045793] imx rpmsg driver is registered.

and not:

# dmesg | grep -i rpmsg
[    0.045793] imx rpmsg driver is registered.
[    1.329068] virtio_rpmsg_bus virtio0: rpmsg host is online
[    1.329111] virtio_rpmsg_bus virtio0: creating channel rpmsg-virtual-tty-channel-1

as outlined here: Cortex-M RPMsg Guide | Toradex Developer Center

]

Let me know what you think.

Best,
Mit

Hey @mit,

Just an update, still looking into this.

-Eric

Hey @mit,

I found a variable name error in our “How to Load Compiled Binaries into Cortex-M”

For the Application Start, you want to run the newly created cm_boot . Not the "run m4boot" . This change was made because m4boot was a little unclear when working with a Cortex M7. I put in a change request for the website to reflect the correction.

Aside from this change, following the instructions works as expected.

-Eric