Bad device specification mmc 0

Hello all,

This is my first time with the beaglebone black. I’m trying to install u-boot from scratch but, when I try to save environment variables using u-boot command line, I get the error “Saving Environment to FAT… ** Bad device specification mmc 0 **”.

Steps followed so far:

  • Build toolchain using crosstool-ng.
  • Checkout uboot v2023.04.
  • Select configuration for beaglebone black: make am335x_evm_defconfig
  • Make the configuration: make DEVICE_TREE=am335x-boneblack
  • Copy MLO and u-boot.img files into BOOT partition of sd card.

Log from serial line when u-boot is executed:

U-Boot SPL 2023.04 (Jan 29 2024 - 20:18:18 +0100)
Trying to boot from MMC1
U-Boot 2023.04 (Jan 29 2024 - 20:18:18 +0100)
CPU : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM: 512 MiB
Core: 160 devices, 18 uclasses, devicetree: separate
WDT: Started wdt@44e35000 with servicing every 1000ms (60s timeout)
NAND: 0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*Loading Environment from FAT… ** Bad device specification mmc 0 ***
not set. Validating first E-fuse MAC
Net: eth2: ethernet@4a100000, eth3: usb_ether

Whenever I try to use saveenv command always get the ** Bad device specification mmc 0 ** error message.

I tested it with two different sd cards (both same type, MicroSDHC 32GB UHS-I U1 A1 Class 10, 16GB and 32GB respectively).

What am I missing? Do I need to enable specific options in u-boot config to support such SD cards?

Thanks in advance for the support.

The default am335x_evm_defconfig supports many am335x based devices… you should convfigure your version of u-boot to match your microSD/eMMC device…

For our default image we have saveenv configured in u-boot like shown:

CONFIG_ENV_IS_IN_EXT4=y
CONFIG_ENV_EXT4_INTERFACE="mmc"
CONFIG_ENV_EXT4_DEVICE_AND_PART="0:1"
CONFIG_ENV_EXT4_FILE="/boot/uboot.env"

Regards,

Hello Robert,

Thanks for your comment. I tried to modify the am335x_evm_defconfig as you suggested:

However I still get the message “Saving Environment to EXT4… ** Bad device specification mmc 0 *". I also tried to list the mmc 0:1 partition using the command ls mmc 0:1 * and got the error " Bad device specification mmc 0 **”.
This is how i formated the sd card:

  • /dev/sdb1 fat16 BOOT (boot flag enabled)
  • /dev/sdb2 ext4 ROOTS

Any ideas?

Thanks in advance

Regards

fat is not ex4… Environment is in a Fat filesystem

Hello,

Could you please elaborate? As I said I’m just a beginner. Which are the steps then to store environment variables in a sd card?

Regards

Your Boot Partition is “FAT” not EXT4…

Regards,

Hi,

Sorry but still do not know what is wrong. I basically enabled this configuration:

CONFIG_ENV_IS_IN_EXT4=y
CONFIG_ENV_EXT4_INTERFACE=“mmc”
CONFIG_ENV_EXT4_DEVICE_AND_PART=“0:1”
CONFIG_ENV_EXT4_FILE=“/boot/uboot.env”

What should I do to store environment variables in either FAT(BOOT) or EXT4(ROOTFS) partitions of the sd card? Could you provide the config?

Regards

Change:

CONFIG_ENV_IS_IN_EXT4=y -> CONFIG_ENV_IS_IN_FAT=y

As your boot partition is FAT…

Regards,

Hello,

I also tried to change CONFIG_ENV_IS_IN_FAT and mmc device partition number with different values but same error message about bad device specification. Do not know how to continue to be honest.

Regards

While in u-boot shell, please run ‘saveenv’ and share the full output…

Regards,

Hello Robert,

This is the output:

image

Regards

Any ideas?

Regards