How to save ethaddr changes?

Working on a ConnectCore ccimx6sbc and booting from SD card images created using DEY 2.4, I find that each time I swap SD cards the u-boot environment is reset to defaults. These defaults include MAC addresses in ethaddr that don’t match the values for the hardware as printed on the device label.

I can change the value, and it’s persistent until I swap or rewrite the SD card, whereupon the MAC addresses are again reset the defaults (seen below).

After I set the values (setenv ethaddr 00:01:02:03:04:05, for example), I do a saveenv, and the message indicates that the values have been saved to eMMC and redundant eMMC. But after rewriting the SD card with a new image, I’m back to the default value (00:04:f3:ff:ff:fa).

Using default environment

In: serial
Out: serial
Err: serial
ConnectCore 6 SOM variant 0x02: Consumer quad-core 1.2GHz, 4GB eMMC, 1GB DDR3, -20/+70C, Wireless, Bluetooth, Kinetis
Board: ConnectCore 6 SBC, version 3, ID 129
Boot device: SD2
PMIC: DA9063, Device: 0x61, Variant: 0x60, Customer: 0x00, Config: 0x56
WARNING: Dummy default MAC in ‘ethaddr’
WARNING: Dummy default MAC in ‘wlanaddr’
WARNING: Dummy default MAC in ‘btaddr’
=> printenv wlanaddr
=> printenv ethaddr

When you bootstrap your module to boot from SD, SD is the only storage memory it sees at boot time and NVRAM partition is also stored on SD. When you swap SD card and insert a new one, all your changes are gone with the SD card you’ve ejected. Booting from a new SD card, it sees no NVRAM partition and recreates it from scratch. You can probably clone SD card so the new one has the NVRAM partition, but you can set new environment manually as well. Bottom line, when you swap SD cards, you swap NVRAM setting including MAC. IF new card doesn’t have it, it will be reset to defaults. There is no workaround for this.