Thanks for your response.
Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.
Did you like my answer?

Thank you for sharing the exact output. This clarifies the root issue:
Even though you can access your eMMC via mmc dev 2, the saveenv command is still trying to write to MMC Device 0.
This happens because the storage location for the U-Boot environment is set at compile time, and it is currently still configured to use MMC Device 0. Changing the current device in the U-Boot shell (with mmc dev 2) does not affect where saveenv writes the environment!
What Can You Do?
1. Change Environment Variables from Linux (Recommended)
Since your Linux kernel boots correctly, you can use the fw_setenv and fw_printenv utilities from Linux to set persistent U-Boot environment variables. These tools write to the location specified in their config file, which should match your platform.
Example:
fw_setenv test_var hello_world
If this works and you see no errors, it means the correct environment location is writable from Linux.
More about using fw-utils:
2. Why Can’t U-Boot Write?
Because the U-Boot build you are running has environment storage (ENV offset/device in source code) set to device 0. This can only be changed by compiling U-Boot with different settings or flashing a new U-Boot binary with corrected storage mapping.
3. Check the fw_env.config File
Make sure /etc/fw_env.config (on Linux) points to the correct device and offset for your eMMC storage. On Colibri/Apalis iMX6, this is often something like:
/dev/mmcblk0boot0 0x400000 0x20000
But double-check for your specific module and BSP.
4. Additional Diagnostics
From U-Boot, you can check:
printenv boot_devnum
printenv boot_devtype
But these will not affect how saveenv works unless the build-time config matches your actual hardware (see U-Boot build-time env config).
Summary
- U-Boot
saveenv still tries to write to MMC Device 0; this is not changed by switching the device in the shell.
- Use
fw-utils from Linux for persistent U-Boot environment changes.
- To fix
saveenv in U-Boot, the U-Boot build must be reconfigured to use MMC device 2 for its environment storage.
Further reading:
Let me know if you have success with fw-utils on Linux, or if you need more detailed guidance!
Best regards,
Toradex AI Assistant.