Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

U-Boot C2 env into eMMC

Featured Replies

Hi,

 

maybe someone can give me a hint on this issue. I'm working on U-Boot v2017.11 currently, and just found out that on the Odroid C2 env settings are not changable inside the eMMC, but only at compile time for Uboot. I use an 16GB eMMC, not a sdcard.

So my question is: where and to what values have the following CONFIG_* parameters be set to have env settings changeable by setenv and saveenv in Uboot again?

 

#define CONFIG_ENV_SIZE                 (32 * SZ_1K)
#define CONFIG_ENV_OFFSET               (720 * SZ_1K)
#define CONFIG_SYS_MMC_ENV_DEV          1
#define CONFIG_SYS_MMC_ENV_PART         0

That's what I tried inside the include/configs/odroid-c2.h file, but it doesn't seem to work.

 

EDIT: the variables are not inside the image, after it has been written to eMMC by etcher. After a first reboot, and inside UBoot, I can "saveenv" the standard values and see them afterwards on the eMMC on the right position. I can also change and save them again.

What fails is using fw_printenv inside Linux. With the /etc/fw_env.config file

# <device>   <offset> <length>
/dev/mmcblk0 0xB4000   0x8000 

I get an error message like "Environment does not start on (erase) block boundary".

 

Any help / hint is appreciated.

 

Michael

  • Author

I just checked. In the image produced by compile.sh, there is no data no offset 0xb4000 (all 0x00).

After starting the C2 with this image, and manually "saveenv" in Uboot, I can readout the eMMC by dd, and see the envs correctly stored on offset 0xb4000.

 

This problem seems to be build related - compile.sh does not include the env section on the image in that case?

 

As you get a "CRC error" on the empty env section on booting, it may look like a corrupted memory area.

 

Any ideas on why the scripts does not include the env variables into the image?

 

EDIT: the env area must be 64kB aligned to fit the "erase page boundary". This allows to access the env from Linux by fw_printenv et.al.

# <device>   <offset> <length>
/dev/mmcblk0 0xc0000  0x8000

Still, the image for flashing the SDcard / eMMC does lack the initial settings.

 

EDIT2: I still get a CRC error with that file if accessing the env variables by fw_printenv.

 

If I do a

dd if=/dev/mmcblk0 of=y bs=512 skip=1536 count=64

(which is directly translated from fw_env.config file), I get the variables as they are printed in Uboot. So something seems still to be broken if accessing from fw_printenv, while it seems to work inside Uboot now.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.