# Support for Toradex Verdin modules?

**URL:** <https://forums.balena.io/t/support-for-toradex-verdin-modules/364723>\
**Category:** balenaOS\
**Tags:** hardware\
**Created:** [October 14, 2022, 6:01pm UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723 "2022-10-14T18:01:17Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![aferm](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aferm](https://forums.balena.io/u/aferm)\
**Post date:** [October 14, 2022, 6:01pm UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/1 "2022-10-14T18:01:17Z")

</div>

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](https://www.balena.io/docs/reference/OS/customer-board-support/).

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.

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [October 18, 2022, 9:50am UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/6 "2022-10-18T09:50:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aferm](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aferm](https://forums.balena.io/u/aferm)\
**Post date:** [February 22, 2023, 10:12pm UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/11 "2023-02-22T22:12:16Z")

</div>

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

```auto
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'

```

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [February 23, 2023, 9:57am UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/12 "2023-02-23T09:57:17Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![aferm](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aferm](https://forums.balena.io/u/aferm)\
**Post date:** [February 23, 2023, 2:40pm UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/14 "2023-02-23T14:40:16Z")

</div>

[log.do\_compile.1724089.log](https://forums.balena.io/uploads/short-url/dxdD7Q9y5ba4zETQPTbLdl0G8uH.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](https://github.com/abferm/balena-toradex-verdin).

---

<div class="post-metadata">

**Author:** ![aferm](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aferm](https://forums.balena.io/u/aferm)\
**Post date:** [March 16, 2023, 7:11pm UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/15 "2023-03-16T19:11:08Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [March 22, 2023, 8:46am UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/17 "2023-03-22T08:46:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aferm](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aferm](https://forums.balena.io/u/aferm)\
**Post date:** [March 29, 2023, 4:47pm UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/18 "2023-03-29T16:47:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [March 30, 2023, 10:45am UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/19 "2023-03-30T10:45:08Z")

</div>

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](https://github.com/balena-os/balena-connectcore/commit/cbf51ecb6da4f5b600a6390e588cf861d7ee0e06)

---

<div class="post-metadata">

**Author:** ![aferm](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aferm](https://forums.balena.io/u/aferm)\
**Post date:** [March 31, 2023, 3:44pm UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/20 "2023-03-31T15:44:54Z")

</div>

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

```auto
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

```

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [April 3, 2023, 12:49pm UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/21 "2023-04-03T12:49:31Z")

</div>

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/ `

---

<div class="post-metadata">

**Author:** ![aferm](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aferm](https://forums.balena.io/u/aferm)\
**Post date:** [April 3, 2023, 1:40pm UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/22 "2023-04-03T13:40:52Z")

</div>

Output with `bash -x`

```auto
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?

---

<div class="post-metadata">

**Author:** ![aferm](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aferm](https://forums.balena.io/u/aferm)\
**Post date:** [April 4, 2023, 7:39pm UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/23 "2023-04-04T19:39:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![alexgg](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@alexgg](https://forums.balena.io/u/alexgg)\
**Post date:** [April 5, 2023, 11:54am UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/24 "2023-04-05T11:54:57Z")

</div>

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](https://github.com/balena-os/balena-yocto-scripts/pull/305) to address this.

---

<div class="post-metadata">

**Author:** ![aferm](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aferm](https://forums.balena.io/u/aferm)\
**Post date:** [April 6, 2023, 8:36pm UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/25 "2023-04-06T20:36:46Z")

</div>

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.

```auto
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

```

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [April 19, 2023, 6:53am UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/26 "2023-04-19T06:53:22Z")

</div>

> [@aferm](#):
>
> `/work/build/tmp/work/verdin_imx8mm-poky-linux/kernel-modules-headers/1.0-r0/temp/log.do_compile`

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?

---

<div class="post-metadata">

**Author:** ![aferm](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@aferm](https://forums.balena.io/u/aferm)\
**Post date:** [April 19, 2023, 7:50pm UTC](https://forums.balena.io/t/support-for-toradex-verdin-modules/364723/27 "2023-04-19T19:50:57Z")

</div>

@floion

```auto
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.

```

```auto
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.

```
