Colibri IMX7 RPMsg kernel modules not loading

Issue: When deploying a BSP 5 based custom image to the Colibri IMX7 using the Torizoncore CLI tool, the target is unable to boot the Arm-A core with the new image as outlined below:


Background: I am trying to run the RPMsg TTY demo as outlined here on my target Colibri IMX7D 1GB eMMC running on a Colibri Evaluation Board v3.2B, and my host machine is an x86_64 based Ubuntu machine. Below are some additional details:

  • My workdir on my host machine looks like the following:
  • The kernel module I am trying to build is rpmsg and this is what I did to get the rpmsg directory into my root workdir, based on my understanding of this statement: “Point to the source code directory for kernel module tha you want to add to your image…”
    $ cp -i -r linux-toradex/modules/lib/modules/5.4.193-42243-gcf754d7aaa94/build/drivers/rpmsg/ ~/workdir
  • I also added lines 13 to 19 to the ~/workdir/rpmsg/Makefile to make it compile using the $ torizoncore build command:
  • Both the ~/workdir/device-tree-overlays and ~/workdir/linux-toradex directories are checked out to this branch: toradex_5.4-2.3.x-imx
  • This is my tcbuild.yaml file (available for download below):
# >> 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-colibri-imx7-emmc-Tezi_5.7.2+build.20.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/
   kernel:
    modules:
      - source-dir: rpmsg/
        autoload: true
   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-eval-v3.dts
    # >> Device-tree overlays configuration:
     overlays:
      add:
        - device-tree-overlays/overlays/colibri-imx7_disable-uart-b_overlay.dts
        - device-tree-overlays/overlays/colibri-imx7_fix_rpmsg_demo.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}"
  • This is my colibri-imx7_disable-uart-b_overlay.dts device tree overlay file to disable UART-B on the Colibri IMX7 to allow serial debug for M-Core (available for download below):
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
 * Copyright 2020-2021 Toradex
 */

// Disable UART2, aka UART_B on the Colibri iMX7

/dts-v1/;
/plugin/;

/ {
	compatible = "toradex,colibri-imx7d",
		     "toradex,colibri-imx7d-emmc",
		     "toradex,colibri-imx7s";
};

&uart2 {
	status = "disabled";
};
  • This is my colibri-imx7_fix_rpmsg_demo.dts device tree overlay file to resolve a Kernel Panic boot issue that I ran into (available for download below):
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
 * Copyright 2020-2021 Toradex
 */

// Disable UART2, aka UART_B on the Colibri iMX7

/dts-v1/;
/plugin/;

/ {
	compatible = "toradex,colibri-imx7d",
		     "toradex,colibri-imx7d-emmc",
		     "toradex,colibri-imx7s";
};

/ {
	memory {
		linux,usable-memory = <0x80000000 0xff00000>;
	};
};

After deploying, I made sure to enter U-Boot and ensure the m4boot command was empty, so that the M-core doesn’t start. Afterwards, the A-core fails to boot with the error outlined at the top of this post.

I have attached the following files: dmesg logs (logs.txt), tcbuild.yml, colibri-imx7_fix_rpmsg_demo.dts and colibri-imx7_disable-uart-b_overlay.dts
tcbuild.yaml (4.7 KB)
logs.txt (22.4 KB)
colibri-imx7_disable-uart-b_overlay.dts (312 Bytes)
colibri-imx7_fix_rpmsg_demo.dts (346 Bytes)

And attempts to just scp the built kernel modules to the target as outlined here: Build U-Boot and Linux Kernel from Source Code | Toradex Developer Center

failed because the /lib directory on the target is read-only.

If the Torizoncore builder tool method doesn’t work, could I get guidance on how to make the /lib directory on the target read-write capable ? I’ve tried remounting the directory with permission changes, but it doesn’t work for me.

Updating the custom device tree source to the Colibri IMX7 eMMC .dts file resolved the failure to boot into the OS: linux-toradex/arch/arm/boot/dts/imx7d-colibri-emmc-eval-v3.dts instead of linux-toradex/arch/arm/boot/dts/imx7d-colibri-eval-v3.dts

# >> 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-colibri-imx7-emmc-Tezi_5.7.2+build.20.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/
   kernel:
    modules:
      - source-dir: rpmsg/
        autoload: yes
   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-eval-v3.dts
     custom: linux-toradex/arch/arm/boot/dts/imx7d-colibri-emmc-eval-v3.dts
    # >> Device-tree overlays configuration:
     overlays:
      add:
        - device-tree-overlays/overlays/colibri-imx7_disable-uart-b_overlay.dts
        - device-tree-overlays/overlays/colibri-imx7_fix_rpmsg_demo.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}"

But the RPMsg TTY required kernel module still doesn’t exist even after adding the module to the image. I verified the deployed image checksum matches:
On host:

On target:

My .config file is included below, and it has all the RPMsg related config parameters enabled:
config.txt (141.8 KB)

Based on the output of the build command: $ \rm -i -rf output_directory && docker run --rm -it -v /deploy -v "$(pwd)":/workdir -v storage:/storage -v /var/run/docker.sock:/var/run/docker.sock --network=host $(tcb_dynamic_params) torizon/torizoncore-builder:3 build && torizoncore-builder images unpack output_directory && torizoncore-builder deploy --remote-host 192.168.0.102 --remote-username torizon --remote-password temppwd --reboot

Building image as per configuration file 'tcbuild.yaml'...

=>> Handling input section
Unpacking Toradex Easy Installer image.
Copying Toradex Easy Installer image.
Unpacking TorizonCore Toradex Easy Installer image.
Importing OSTree revision 09ab55a03c7e24c8277655005e41c33187ccddc8228c67e79d77745df375b199 from local repository...
1095 metadata, 12610 content objects imported; 414.4 MB content written                                                                                        
0 metadata, 0 content objects imported; 0 bytes content written                                                                                                
Unpacked OSTree from Toradex Easy Installer image:
  Commit checksum: 09ab55a03c7e24c8277655005e41c33187ccddc8228c67e79d77745df375b199
  TorizonCore Version: 5.7.2+build.20

=>> Handling customization section

=> Handling device-tree subsection

=> Selecting custom device-tree 'linux-toradex/arch/arm/boot/dts/imx7d-colibri-emmc-eval-v3.dts'
'imx7d-colibri-emmc-eval-v3.dts' compiles successfully.
warning: removing currently applied device tree overlays
Device tree imx7d-colibri-emmc-eval-v3.dtb successfully applied.

=> Adding device-tree overlay 'device-tree-overlays/overlays/colibri-imx7_disable-uart-b_overlay.dts'
'colibri-imx7_disable-uart-b_overlay.dts' compiles successfully.
/tmp/tmpv7v27bh2: Device Tree Blob version 17, size=66365, boot CPU=0, string block size=5289, DT structure block size=61020
'colibri-imx7_disable-uart-b_overlay.dtbo' can successfully modify the device tree 'imx7d-colibri-emmc-eval-v3.dtb'.
Overlay colibri-imx7_disable-uart-b_overlay.dtbo successfully applied.

=> Adding device-tree overlay 'device-tree-overlays/overlays/colibri-imx7_fix_rpmsg_demo.dts'
'colibri-imx7_fix_rpmsg_demo.dts' compiles successfully.
/tmp/tmplkedf4dp: Device Tree Blob version 17, size=66365, boot CPU=0, string block size=5289, DT structure block size=61020
'colibri-imx7_fix_rpmsg_demo.dtbo' can successfully modify the device tree 'imx7d-colibri-emmc-eval-v3.dtb'.
Overlay colibri-imx7_fix_rpmsg_demo.dtbo successfully applied.

=> Building module located at 'rpmsg/'
make: Entering directory '/workdir/rpmsg'
make -C /storage/linux M=/workdir/rpmsg modules
make[1]: Entering directory '/storage/linux'
  Building modules, stage 2.
  MODPOST 0 modules
make[1]: Leaving directory '/storage/linux'
make: Leaving directory '/workdir/rpmsg'

Kernel module(s) successfully built and ready to deploy.
rpmsg/imx_rpmsg_pingpong.ko is set to be autoloaded on boot.
rpmsg/imx_rpmsg_tty.ko is set to be autoloaded on boot.
All kernel module(s) have been built and prepared.

=>> Handling output section
Applying changes from STORAGE/kernel.
Applying changes from STORAGE/dt.
Commit 537be467e4186002fa736bdb39404a537ff12515e68ccebe48c375affbf7b883 has been generated for changes and is ready to be deployed.
Deploying commit ref: tcbuilder-20240424170956
Pulling OSTree with ref tcbuilder-20240424170956 from local archive repository...
  Commit checksum: 537be467e4186002fa736bdb39404a537ff12515e68ccebe48c375affbf7b883
  TorizonCore Version: 5.7.2+build.20-tcbuilder.20240424170958
  Default kernel arguments: quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3

1095 metadata, 12613 content objects imported; 414.4 MB content written                                                                                       
Pulling done.
Deploying OSTree with checksum 537be467e4186002fa736bdb39404a537ff12515e68ccebe48c375affbf7b883
Bootloader found in unpacked image: U-Boot
Deploying done.
Copy files not under OSTree control from original deployment.
Packing rootfs...
Packing rootfs done.
Updating TorizonCore image in place.

=>> Build command successfully executed!
Storage not empty. Delete current image before continuing? [y/N] y
Copying Toradex Easy Installer image.
Unpacking TorizonCore Toradex Easy Installer image.
Importing OSTree revision 537be467e4186002fa736bdb39404a537ff12515e68ccebe48c375affbf7b883 from local repository...
1095 metadata, 12613 content objects imported; 414.4 MB content written                                                                                        
0 metadata, 0 content objects imported; 0 bytes content written                                                                                                
Unpacked OSTree from Toradex Easy Installer image:
  Commit checksum: 537be467e4186002fa736bdb39404a537ff12515e68ccebe48c375affbf7b883
  TorizonCore Version: 5.7.2+build.20-tcbuilder.20240424170958
Pulling OSTree with ref base (checksum 537be467e4186002fa736bdb39404a537ff12515e68ccebe48c375affbf7b883) from local archive repository...
Starting http server to serve OSTree.
OSTree server listening on "localhost:35005".
Starting OSTree pull on the device...
Deploying new OSTree on the device...
Deploying successfully finished.

Specifically:

=> Building module located at 'rpmsg/'
make: Entering directory '/workdir/rpmsg'
make -C /storage/linux M=/workdir/rpmsg modules
make[1]: Entering directory '/storage/linux'
  Building modules, stage 2.
  MODPOST 0 modules
make[1]: Leaving directory '/storage/linux'
make: Leaving directory '/workdir/rpmsg'

I actually don’t think the rpmsg modules are being built. What is the correct way to define the rpmsg source path in the tcbuild.yml file ?

This is what worked to actually compile the rpmsg kernel module:

  1. Created an rpmsg directory in my root ~/workdir/torizon_imx7_colibri such that the tree looks like this:
  2. Copied imx_rpmsg_tty.c from ~/workdir/torizon_imx7_colibri/linux-toradex/drivers/rpmsg/imx_rpmsg_tty.c to ~/workdir/torizon_imx7_colibri/rpmsg
  3. Created a Makefile in the rpmsg kernel source directory I made that looks like the following:
obj-m := imx_rpmsg_tty.o

SRC := $(shell pwd)

all:
	$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules

clean:
	$(MAKE) -C $(KERNEL_SRC) M=$(SRC) clean
  1. And this time when I run the build and deploy command: $ rm -i -rf output_directory && docker run --rm -it -v /deploy -v "$(pwd)":/workdir -v storage:/storage -v /var/run/docker.sock:/var/run/docker.sock --network=host $(tcb_dynamic_params) torizon/torizoncore-builder:3 build && torizoncore-builder images unpack output_directory && torizoncore-builder deploy --remote-host 192.168.0.102 --remote-username torizon --remote-password temppwd --reboot, the logs indicate that the rpmsg kernel module directory actually builds:
=> Building module located at 'rpmsg/'
make: Entering directory '/workdir/rpmsg'
make -C /storage/linux M=/workdir/rpmsg modules
make[1]: Entering directory '/storage/linux'
  CC [M]  /workdir/rpmsg/imx_rpmsg_tty.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC [M]  /workdir/rpmsg/imx_rpmsg_tty.mod.o
  LD [M]  /workdir/rpmsg/imx_rpmsg_tty.ko
make[1]: Leaving directory '/storage/linux'
make: Leaving directory '/workdir/rpmsg'

On the target, the $ sudo modprobe imx_rpmsg_tty, finally runs but faults as outlined below:

Based on the dmesg logs attached to this post (check logs.txt), I think the kernel module is failing to init on line 235 of imx_rpmsg_tty.c:

And the following breakdown of my understanding of the dmesg output:

WARNING: CPU: 0 PID: 1086 at include/linux/rpmsg.h:155 init+0x15/0x1000 [imx_rpmsg_tty]
Modules linked in: imx_rpmsg_tty

This warning is triggered from line 155 of the rpmsg.h header file, within the init function of the imx_rpmsg_tty module.

[   55.510435] [<bf813015>] (init [imx_rpmsg_tty]) from [<c0102c43>] (do_one_initcall+0x43/0x19c)

This line shows the call stack. It indicates that the warning occurred during the initialization (init) function of the imx_rpmsg_tty module.

[   55.510447] [<c0102c43>] (do_one_initcall) from [<c0193f7f>] (do_init_module+0x33/0x178)

This line shows the kernel function (do_init_module) that called the init function of the imx_rpmsg_tty module.

[   55.510466] [<c0195b8b>] (load_module) from [<c019601f>] (sys_finit_module+0x97/0xc0)

It indicates that the warning occurred during the loading of the module (load_module).

Could I request support from your team to verify that the RPMsg TTY actually works on a Colibri IMX7D 1GB eMMC for BSP 5? The scope is increasing to now debug the RPMsg kernel source code.

@Mit,

I have an IMX7 Colibri that should be on my way some time tomorrow. I plan on testing then.

-Eric

1 Like

Thanks @eric.tx , I’ve outlined where I’ve left off below:

Setup:
I’ve included a compressed version of my workdir, that I have been using to build my custom images with the following changes:

  • rpmsg kernel module
  • Device overlay file to disable UART-B: colibri-imx7_disable-uart-b_overlay.dts
  • Device tree overlay file to resolve Kernel Panic issue: colibri-imx7_fix_rpmsg_demo.dts
  • Custom device tree source: imx7d-colibri-emmc-eval-v3.dts (changed from imx7d-colibri-eval-v3.dts to resolve Linux bootloop issue, after deploying custom image with rpmsg kernel modules)

All demo apps for the Colibri IMX7 RPMsg demos were compiled with the following toolchain: export ARMGCC_DIR=~/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi

Note: Files mentioned in the description above can be found here for download for local testing.

Left off with the following state:

  • Able to deploy the custom image with RPMsg Kernel modules, and device tree overlay changes, and can start the M core and A core and have both cores output over UART-A (A with Linux), and UART-B (FreeRTOS demo).
  • Unable to run the $ modprobe command successfully. All modules error out for the same reason:
modprobe: ERROR: could not insert 'imx_rpmsg_pingpong': No such device or address

Hey @Mit,

While follow various steps I was still not able to get imx7 RPMSG to work. While this doesn’t mean it can’t work, there’s just more overhead required.

This is supported by this ticket here where the customer opted to implemented a external mcu connected to the IMX7.

-Eric

Hi @eric.tx,

Thank you for your efforts on this project. I have a couple of questions I’d like to discuss:

  1. I came across a post where a developer discontinued their project with the M4-A7 RPMsg communication: Toradex Community Post. Has anyone been successful in establishing communication without using additional hardware, like an external MCU? Would it make sense for us to consider a different HMP platform, or should we keep working with the Colibri IMX7?
  2. What are the next steps we should consider? If it’s helpful, I can spend some time reviewing the RPMsg kernel module source code to identify potential issues.

Thanks,
Mit

Hey @mit,

I will do some research into which modules has been better tested via the RPMSG. From looking at our community, It looks like the IMX8MP Verdin is a good candidate (Tickets people have created that have been marked solved). Is there a particular reason why the Colibri IMX7 was chosen for your project?

-Eric

Hey @eric.tx ,

We started with the Colibri IMX7 based on the discussion here: NXP i.MX 7 Computer on Module - Colibri iMX7 — Zephyr Project Documentation.

I’ve ordered the following Verdin IMX8 SoM and evaluation board:

Could I get confirmation that this hardware setup is what is recommended to try out RPMsg demos on the IMX8 platform ? Once I get confirmation on the IMX8 order, we can mark this thread as closed and I can start a new thread for the IMX8 development.

Best,
Mit

Hey @mit,

I just did some testing for the hello world and rpmsg_pingpong demos on the Verdin IMX8MP, with Torizon OS 6.6.0, and on the Dahlia board.

Hello_world worked as expected, and for the ping-pong demo there were some modifications needed to get it to run. I followed the advice of this community ticket here to get it to work:

The Development board shouldn’t make a difference in getting these to work (via Dahlia board)

-Eric

Hi @eric.tx ,

Thanks for validating on the IMX8 platform - will give this a try once my hardware comes in and report back if there are issues.

Best,
Mit

Hi @eric.tx ,

I wanted to follow up with my attempts to get the RPMsg functional on the Verdin iMX8M Plus Quad 8GB on the Verdin Development Board v1.1F:

Problem: I am able to compile, and start the RPMsg demos on the A and M cores. But the M core does not seem to be responsive after the initial debug message is sent out.

Above you can see that the Ping-Pong demo and String Echo demo starts after the run m4boot command is sent out from the bootloader, but there is no response afterwards. In the section below I’ve outlined by setup:

Setup:

  1. Working directory:

device-tree-overlays and linux-toradex have been checked out to the following branch: toradex_5.15-2.2.x-imx as outlined here: Embedded Linux Support Strategy | Toradex Developer Center

My tcbuild.yaml file contains the following:

# >> 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/
   kernel:
    modules:
      - source-dir: rpmsg/
        autoload: no
   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

      # >> 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}"

The Torizon Core version was chosen without containers from here: Download Links | Toradex Developer Center

The rpmsg kernel module was copied over from the following directory: linux-toradex/drivers/rpmsg/ with the following Makefile modifications:

# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_RPMSG)		+= rpmsg_core.o
obj-$(CONFIG_RPMSG_CHAR)	+= rpmsg_char.o
obj-$(CONFIG_RPMSG_CTRL)	+= rpmsg_ctrl.o
obj-$(CONFIG_RPMSG_NS)		+= rpmsg_ns.o
obj-$(CONFIG_RPMSG_MTK_SCP)	+= mtk_rpmsg.o
qcom_glink-objs			:= qcom_glink_native.o qcom_glink_ssr.o
obj-$(CONFIG_RPMSG_QCOM_GLINK) += qcom_glink.o
obj-$(CONFIG_RPMSG_QCOM_GLINK_RPM) += qcom_glink_rpm.o
obj-$(CONFIG_RPMSG_QCOM_GLINK_SMEM) += qcom_glink_smem.o
obj-$(CONFIG_RPMSG_QCOM_SMD)	+= qcom_smd.o
obj-$(CONFIG_RPMSG_VIRTIO)	+= virtio_rpmsg_bus.o
obj-$(CONFIG_HAVE_IMX_RPMSG)	+= imx_rpmsg.o
obj-$(CONFIG_IMX_RPMSG_PINGPONG)	+= imx_rpmsg_pingpong.o
obj-$(CONFIG_IMX_RPMSG_TTY)	+= imx_rpmsg_tty.o

SRC := $(shell pwd)

all:
	$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules

clean:
	$(MAKE) -C $(KERNEL_SRC) M=$(SRC) clean

Note: I am able to compile the demos using the MCUXpresso SDK without any issues.

  1. On-board setup:

Once the demo binary has been SCP’d to the /ostree/deploy/torizon/var directory I enter the bootloader and run the following commands, to load in the demo binary to the M core:

Before starting the M core, I run the steps outlined here: Support of rpmsg in TorizonCore on Verdin iMX8MP - #5 by hfranco.tx

On the M debug console, I see the start of the string demo debug message, but I don’t see the entire message as outlined here: Running FreeRTOS on the Cortex-M7 of a Verdin iMX8M Plus | Toradex Developer Center

RPMSG String Echo FreeRTOS RTOS API Demo...

Nameservice sent, ready for incoming messages...
Get Message From Master Side : "hello world!" [len : 12]

A core:

M core:

I can confirm the the RPMsg driver has been loaded, but there is not ttyRPMSG device created:

Is there anything that I’m missing in my setup ?

Hey @mit,

It looks like you are missing this device tree file in your tcbuild.yaml file for the Verdin IMX8MP

Can you to add it and try again?

-Eric

Hey @eric.tx ,

Still running into the same problem as the post above after running through the following steps:

  1. Created a device tree overlay file in ~workdir/verdin_imx8/device-tree-overlays/overlays/verdin-imx8-setup.dts with the following contents from: How to Run a Hello World on the Cortex-M | Toradex Developer Center
/dts-v1/;
/plugin/;

/ {
    compatible = "toradex,verdin-imx8mp-wifi-dahlia",
             "toradex,verdin-imx8mp-wifi",
             "toradex,verdin-imx8mp",
             "fsl,imx8mp";
};

&gpio5 {
    gpio-line-names = "SODIMM_42",
              "SODIMM_46",
              "SODIMM_187",
              "SODIMM_20",
              "SODIMM_22",
              "SODIMM_15",
              "SODIMM_196",
              "SODIMM_200",
              "SODIMM_198",
              "SODIMM_202",
              "SODIMM_164",
              "SODIMM_152",
              "SODIMM_116",
              "SODIMM_128",
              "",
              "",
              "SODIMM_55",
              "SODIMM_53",
              "SODIMM_95",
              "SODIMM_93",
              "SODIMM_14",
              "SODIMM_12",
              "SODIMM_129",
              "SODIMM_131",
              "SODIMM_137",
              "SODIMM_139",
              "SODIMM_147",
              "SODIMM_149",
              "SODIMM_151",
              "SODIMM_153";
};

/* Remove pinctrl_gpio_hog4 and add pinctrl_gpio_hog1 */
&iomuxc {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_gpio1>, <&pinctrl_gpio2>,
            <&pinctrl_gpio3>, <&pinctrl_gpio4>,
            <&pinctrl_gpio7>, <&pinctrl_gpio8>,
            <&pinctrl_gpio_hog1>, <&pinctrl_gpio_hog2>, <&pinctrl_gpio_hog3>,
            <&pinctrl_hdmi_hog>;
};

/* Verdin UART_4 */
/* Used by the M7 and then should not be enabled here. */
&uart4 {
    status = "disabled";
};
  1. Updated the tcbuild.yaml and flashed the board:
# >> 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/
   kernel:
    modules:
      - source-dir: rpmsg/
        autoload: no
   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}"
  1. Verified that the overlays were applied successfully on the target:

Let me know if I am missing anything else in my setup. There are still no ttyRPMSG devices created, and the RPMsg driver is registered on the target.

Best,
Mit

Hey @eric.tx ,

I’ve attached my Verdin iMX8 workdir to assist with the debugging:

Hey @mit,

For the ping-pong module, did you loaded the kernel module? via sudo modprobe imx_rpmsg_pingpong edit correct module You also shouldn’t have to manually include this via the yaml file. With 6.6.1 it should be already available.

-Eric