Set Config Block with Toradex Easy Installer on iMX6

Hello,
i generate a custom CE8 image and will flash it with the Toradex Easy Installer on the iMX6. That step is basical working, if i use the nk.nb0 file form the image builder.

Now i search for a way, to set the Config Block with the Toradex Easy Installer.
Is there any posibility to do this?

Thanks in advance

The Toradex Easy Installer does not have this built in. What you can do is running a script that does the job with the first boot with the update tool, there is some documentation available about this here:

Where is the documentation? Please provide a link.

The basic information about installer scripts are on the page describing the Toradex-Easy-Installer.
For Colibri iMX6 and Apalis iMX6 there is already a wrapup script wrapup.sh included in our standard image download package.

You should not remove this script, but you can extend it with your code. The following extension should do the job of flashing the config block.

...
IMAGE_FOLDER=$4
...
OFFSET=$(($(cat /sys/block/mmcblk0boot0/size)-127))
echo "Writing configblock.bin to offset ${OFFSET}" 
dd if=${IMAGE_FOLDER}/configblock.bin of=/dev/mmcblk0boot0 count=126 seek=$OFFSET

Make sure you put the file configblock.bin into the same folder as the original image and bootloader.

Update 22.01.2018: fixed values for WinCE Config Block size.

Shouldn’t the offset be OFFSET=$(($(cat /sys/block/mmcblk0boot0/size)-127))? Information from Flash Layout page: First sector of Config block = boot partion size - 127. And shouldn’t the count be 126?

@zorro, I added the link in the answer above.

Yes, your values are correct for WinCE, I fixed the post. The script above has been used to write the U-Boot environment, which is only 8KB long, that is where -17/count=16 came from.

In Windows CE you can save config block from the update tool, but in this case the tool will add a 16bytes offset to the actual contents of the flash.

In this case things get a bit more complicated (thanks to @michaelg to help sorting that out) because you need to skip those 16 bytes when reading the input file.

You can do that by passing bs=16 command line parameter to dd (the dd version we have in the easy installer does not support different sizes for input and output blocks) and add skip=1 to skip the first 16bytes. This would lead to 16 blocks also on the output, so you’ll have to mutiply the seek offset accordingly.

This should work for config block file exported by windows CE update tool (backup.cfg is the default name for config block exported via update tool):

 OFFSET=OFFSET=$(($(($(cat /sys/block/mmcblk0boot0/size)-127))*32))

 echo "Writing configblock.bin to offset ${OFFSET}" 

 dd if=${IMAGE_FOLDER}/backup.cfg of=/dev/mmcblk0boot0 bs=16 skip=1 count=4032 seek=$OFFSET

Here:
Toradex Documents - iMX6 Easy Installer template for custom images

you can find a template that can be used to install a custom Windows CE setup (image, registry, config block) using the Easy Installer. You’ll have to add your own image and configuration files and copy to a removable storage device.
Check the readme.txt file inside the download package for more detailed instructions.