Custom image and configblock workflow

I am trying to setup a reproducible and automated way to flash colibri iMX7 modules.

I’d like to be able to plug a new iMX7 module on the evaluation board, powering it on and have it configured and flashed.

For this I was able to write a small script that wait for the USB serial interface to be up, interrupts uboot, configure via dhcp and run update.

This works, I’m just telling you how I do it if you have any suggestions.

Now, my question is about customizing the config block. As I’d like to avoid having to build the entire linux distribution, I downloaded the binary release, and I customize rootfs by modifying config in /etc and adding my binaries. I can get that flashed without issue. But I’d like to know how to configure the module GPIO and pinout in the process.

Is there a way to edit the config blocks and flash them via tftp alongside the image? I am using this image https://developer1.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Images/Colibri-iMX7_LXDE-Image_2.7-20180104.tar.bz2 as base.

I am trying to setup a reproducible and automated way to flash colibri iMX7 modules.

This is exactly what the autoinstall feature of the Toradex Easy Installer tries to address.

I’d like to be able to plug a new iMX7 module on the evaluation board, powering it on and have it configured and flashed.

Yes, all Colibri iMX7 modules ship with the Toradex Easy Installer pre-installed and you may just insert a SD card or USB stick with an image having the autoinstall flag set. Alternatively, even downloading an image directly via Internet is easily possible.

Should a module no longer have the Toradex Easy Installer installed one may start it via distro boot from its boot loader or worst case directly via USB recovery mode.

For this I was able to write a small script that wait for the USB serial interface to be up, interrupts uboot, configure via dhcp and run update.

This works, I’m just telling you how I do it if you have any suggestions.

We really suggest for you to use the Toradex Easy Installer much simplifying any such.

Now, my question is about customizing the config block.

Are you talking about the Toradex factory configuration block holding the MAC address resp. serial number of the module? What exactly do you want to customise about that one?

As I’d like to avoid having to build the entire linux distribution, I downloaded the binary release, and I customize rootfs by modifying config in /etc and adding my binaries. I can get that flashed without issue.

While we do not recommend doing this one may of course “clone” modules e.g. as described in the following article on our developer website.

But I’d like to know how to configure the module GPIO and pinout in the process.

This usually involves customising the device tree.

Is there a way to edit the config blocks and flash them via tftp alongside the image?

I’m not exactly sure what the config block should have to do with any of this.

I am using this image https://developer1.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Images/Colibri-iMX7_LXDE-Image_2.7-20180104.tar.bz2 as base.

Sorry for the late reply, I didn’t see your answer.

I’m only interested in changing the config block for pinout, I’m designing a carrier board which doesn’t use the default pinout (my display is 24bit and I need some GPIO).

I am now building my own image with open embedded, which was quite a beast to tame. I can now build my own images with my custom layer.

I read https://developer.toradex.com/device-tree-customization but it doesn’t explain how to patch the device tree when using openembedded to build the image. I know how to modify the device tree in the kernel source as explained, but how can I do it in my custom openembedded layer?

After browsing this forum, I found the solution on adding my own dts file using an open embedded layer.

I’ll try to configure my display and GPIO and if I fail I’ll open a new question. Thanks.

Perfect. Thanks for your Input.