Support for Toradex Verdin modules?

Because of hardware shortages, I’ve been looking at new compute platforms. I have found the Toradex Verdin family of modules (particularly the Verdin iMX8M Mini) to be well suited to my needs, but have had some difficulty getting their bsp layers to work with balena OS following this guide.

Could I get some assistance porting balena os to this platform? Preferably with support for their flasher image format for easy provisioning over a local network.

Also, the guide mentions support for Toradex platforms at the bottom, but the linked repository is archived and hasn’t been updated since 2018.

Hello @aferm thanks for contacting us.

As we don’t support the Toradex Verdin compute modules yet we have 2 possibilities:

  • check if there is another hardware available, if this is a possibility
  • or give you support on building the custom board support

Then, what are your hardware requirements? Maybe there is another available hardware in the market already supported on balena that can fit your needs? Let us know if this is a possibility for your project and we can help you to find another compatible hardware.

If there is no other hardware possible for your project, could you please share the errors that you get building the BSP layers?

Let us know how we can help you more!

Thanks

I’ve recently started trying to port this again. I am consistently getting the following error when building the meta-balena-common.

ERROR: mkfs-hostapp-native-1.0-r0 do_compile: ExecutionError('/home/aferm/Repositories/petropower/balena-toradex-verdin/build/tmp/work/x86_64-linux/mkfs-hostapp-native/1.0-r0/temp/run.do_compile.1724089', 1, None, None)
ERROR: Logfile of failure stored in: /home/aferm/Repositories/petropower/balena-toradex-verdin/build/tmp/work/x86_64-linux/mkfs-hostapp-native/1.0-r0/temp/log.do_compile.1724089
Log data follows:
| DEBUG: Executing shell function do_compile
| #1 [internal] load build definition from Dockerfile
| #1 transferring dockerfile: 219B done
| #1 DONE 0.0s
| 
| #2 [internal] load .dockerignore
| #2 transferring context: 2B done
| #2 DONE 0.0s
| 
| #3 [internal] load metadata for docker.io/library/debian:stretch
| #3 ERROR: failed to authorize: failed to fetch anonymous token: Get "https://auth.docker.io/token?scope=repository%3Alibrary%2Fdebian%3Apull&service=registry.docker.io": dial tcp: lookup auth.docker.io on 127.0.0.53:53: dial udp 127.0.0.53:53: connect: network is unreachable
| ------
|  > [internal] load metadata for docker.io/library/debian:stretch:
| ------
| Dockerfile:1
| --------------------
|    1 | >>> FROM debian:stretch
|    2 |
|    3 |     VOLUME /mnt/sysroot/inactive
| --------------------
| ERROR: failed to solve: failed to fetch anonymous token: Get "https://auth.docker.io/token?scope=repository%3Alibrary%2Fdebian%3Apull&service=registry.docker.io": dial tcp: lookup auth.docker.io on 127.0.0.53:53: dial udp 127.0.0.53:53: connect: network is unreachable
| Error response from daemon: invalid reference format
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/aferm/Repositories/petropower/balena-toradex-verdin/build/../layers/meta-balena/meta-balena-common/recipes-containers/mkfs-hostapp-native/mkfs-hostapp-native.bb:do_compile) failed with exit code '1'
1 Like

Thank you @aferm for sharing this here!

Could you please share more of the step where you get this error?

In the meantime let me ask to the devices team how we can help you more!

log.do_compile.1724089.log (1.1 KB)
Here is the complete log from the failed step.
I also just made the repository I’ve been working in public. You can find it here.

@mpous, I’m seeing the same error trying to build the images from the balena-os/balena-raspberrypi repo, so this is likely a problem with my build environment.

The information I’ve found about building custom images seems like it may be out of date, and doesn’t provide much information about how to set up the appropriate environment. Can you point me in the right direction, or put me in contact with the devices team?

Hi. What is the OS you are building on? And what is the command you use to initiate the build?

I have been attempting to build on Ubuntu 22.04 in WSL2 as well as Ubuntu 22.04 on dedicated hardware. I get the same error in both environments. I start the build by running ./balena-yocto-scripts/build/barys as indicated by the readme on the repository.

Can you try building it in a container instead? There are instructions in this commit which should guide you: README: update build methods · balena-os/balena-connectcore@cbf51ec · GitHub

The script mentioned in that commit does not run for me.

aferm@alex-laptop:/tmp/balena/balena-raspberrypi$ ./balena-yocto-scripts/build/balena-build.sh -d fincm3 -s /tmp/balena/balena-raspberrypi/build/
[balena_lib_environment]: Defaulting to balena-cloud.com
aferm@alex-laptop:/tmp/balena/balena-raspberrypi$ echo $?
1

Can you run the command again but with bash -x so that you could see the exact point it is failing at?

bash -x ./balena-yocto-scripts/build/balena-build.sh -d fincm3 -s /tmp/balena/balena-raspberrypi/build/

Output with bash -x

aferm@alex-laptop:/tmp/balena/balena-raspberrypi$ bash -x ./balena-yocto-scripts/build/balena-build.sh -d fincm3 -s /tmp/balena/balena-raspberrypi/build/
+ DOCKER=docker
++ basename ./balena-yocto-scripts/build/balena-build.sh
+ script_name=balena-build.sh
+++ dirname ./balena-yocto-scripts/build/balena-build.sh
++ cd ./balena-yocto-scripts/build
++ pwd
+ script_dir=/tmp/balena/balena-raspberrypi/balena-yocto-scripts/build
++ cd /tmp/balena/balena-raspberrypi/balena-yocto-scripts/build/../..
++ pwd
+ work_dir=/tmp/balena/balena-raspberrypi
+ source /tmp/balena/balena-raspberrypi/balena-yocto-scripts/build/../automation/include/balena-lib.inc
++ set -e
++ VERBOSE=0
++ '[' 0 = verbose ']'
++++ dirname /tmp/balena/balena-raspberrypi/balena-yocto-scripts/build/../automation/include/balena-lib.inc
+++ cd /tmp/balena/balena-raspberrypi/balena-yocto-scripts/build/../automation/include
+++ pwd
++ include_dir=/tmp/balena/balena-raspberrypi/balena-yocto-scripts/automation/include
+++ cat /proc/self/cgroup
+++ grep -q docker
+++ cd /tmp/balena/balena-raspberrypi/balena-yocto-scripts/automation/include/../../..
+++ pwd
++ device_dir=/tmp/balena/balena-raspberrypi
+++ cd /tmp/balena/balena-raspberrypi/balena-yocto-scripts/automation/include
+++ git rev-parse --short=7 HEAD
++ BALENA_YOCTO_SCRIPTS_REVISION=fe6beaf
++ NAMESPACE=balena
+ BUILD_CONTAINER_NAME=yocto-build-234
+ trap 'docker_build_cleanup fail' SIGINT SIGTERM
+ main -d fincm3 -s /tmp/balena/balena-raspberrypi/build/
+ local _device_type
+ local _api_env
+ local _token
+ local _shared_dir
+ local _bitbake_args
+ local _bitbake_targets
+ local _barys_args
+ local _keep_helpers=0
+ '[' 4 -lt 1 ']'
+ getopts hd:a:t:s:b:i:g:k c
+ case "${c}" in
+ _device_type=fincm3
+ getopts hd:a:t:s:b:i:g:k c
+ case "${c}" in
+ _shared_dir=/tmp/balena/balena-raspberrypi/build/
+ getopts hd:a:t:s:b:i:g:k c
+ _device_type=fincm3
+ '[' -z fincm3 ']'
++ balena_lib_environment
++ local _api_env
++ '[' -n '' ']'
++ echo '[balena_lib_environment]: Defaulting to balena-cloud.com'
[balena_lib_environment]: Defaulting to balena-cloud.com
++ _api_env=balena-cloud.com
++ export BALENARC_BALENA_URL=balena-cloud.com
++ BALENARC_BALENA_URL=balena-cloud.com
++ echo balena-cloud.com
+ _api_env=balena-cloud.com
++ balena_lib_token balena-cloud.com
++ local _api_env=balena-cloud.com
++ '[' -z balena-cloud.com ']'
++ '[' balena-cloud.com = balena-staging.com ']'
++ '[' balena-cloud.com = balena-cloud.com ']'
++ '[' -n '' ']'
++ '[' -z '' ']'
++ '[' -f /home/aferm/.balena/token ']'
++ return
+ _token=

It appears to be searching for a balena token. Do I need an API token to build the OS?

This was indeed the problem. After installing the balena cli and signing in, I have been able to build the fin image using the balena-build.sh script.

I suggest you add this to the instructions, and have the script print a useful message to the terminal when the user is not signed in.

HI @aferm thanks for reporting this. Indeed, the balena token is an optional argument and the script should not end if it’s not provided. I have opened a PR to address this.

I keep getting the following error logs from the kernel-modules-headers task. I’ve added a bbappend for the kernel based off of the one in the balena-raspberrypi repo, but I’m not entirely sure it is being applied. The Customer Board Support guide does not go into detail on what the kernel recipies should do.

NOTE: recipe kernel-modules-headers-1.0-r0: task do_compile: Started
ERROR: kernel-modules-headers-1.0-r0 do_compile: ExecutionError('/work/build/tmp/work/verdin_imx8mm-poky-linux/kernel-modules-headers/1.0-r0/temp/run.do_compile.4649', 1, None, None)
ERROR: Logfile of failure stored in: /work/build/tmp/work/verdin_imx8mm-poky-linux/kernel-modules-headers/1.0-r0/temp/log.do_compile.4649
Log data follows:
| DEBUG: Executing shell function do_compile
| gen_mod_headers: Missing kernel configuration.
| WARNING: exit code 1 from a shell command.
NOTE: recipe kernel-modules-headers-1.0-r0: task do_compile: Failed

Can you check the log in
/work/build/tmp/work/verdin_imx8mm-poky-linux/kernel-modules-headers/1.0-r0/temp/run.do_compile
and see if you find more info about the build failure?

@floion

cat build/tmp/work/verdin_imx8mm-poky-linux/kernel-modules-headers/1.0-r0/temp/log.do_compile
DEBUG: Executing shell function do_compile
gen_mod_headers: Missing kernel configuration.
WARNING: exit code 1 from a shell command.
cat build/tmp/work/verdin_imx8mm-poky-linux/kernel-modules-headers/1.0-r0/temp/log.do_compile.1769753 
DEBUG: Executing shell function do_compile
gen_mod_headers: Missing kernel configuration.
WARNING: exit code 1 from a shell command.