Update U-boot from linux

Hi,

I would like to update u-boot on mmc from running linux. The system was first flashed with an Image via the Toradex Easy Installer.
From the json file for the Toradex Easy Installer the following can be seen:

 {
            "content": {
                "filesystem_type": "raw",
                "rawfiles": [
                    {
                        "filename": "SPL",
                        "dd_options": "seek=2"
                    },
                    {
                        "filename": "u-boot.img",
                        "dd_options": "seek=138"
                    }
                ]
            },
            "name": "mmcblk0boot0"
        }

Can I just manually dd the files to the partition like that:

echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=SPL of=/dev/mmcblk0boot0 bs=512 seek=2
dd if=u-boot.img of=/dev/mmcblk0boot0 bs=512 seek=138

Will that not overwrite the Toradex factory configuration block at the end?
Where starts and ends the config block? What does the Toradex Easy Installer do with the uEnv.txt to update the config?

Regards,
Matthias

hi @mkock

Please have a look here.

Thanks and best regards, Jaski

Hi @jaski.tx ,

thanks for the link. The commands above are correct. I have made some comments for myself, that I want so share.

The current memory layout in blocks of 512 bytes:

 <------------------------  /dev/mmcblk0boot0  ------------------------------>
 0-------2------------138---------------4079 -----------------4095------------4096
 |       |SPL         |u-boot.img       |u-boot Environment   |Toradex config |
 ------------------------------------------------------------------------------

More details in:
cat /etc/fw_env.config

Best regards,
Matthias

Thanks for your Input and sharing this Information. Best regards, Jaski