Issue with Flashing Image to BBB

Hi
While trying to flash EMMC, I get the following error.
Can you please suggest what can be done.
I am using a 16GB micro SD Card.
It has am335x-eMMC-flasher-debian-11.7-iot-armhf-2023-09-02-4gb.
While flashing, I get the 4 LEDs in Knight Rider fashion. But then all LEDS turn ON/OFF cycle.

This is the message from putty over serial cable, when this happens (looks like no memory), but I wonder what to do next?

[ 3.112984] Key type dns_resolver registered
[ 3.112989] mpls_gso: MPLS GSO support
[ 3.113248] omap_voltage_late_init: Voltage driver support not added
[ 3.113756] ThumbEE CPU extension supported.
[ 3.113780] Registering SWP/SWPB emulation handler
[ 3.114845] registered taskstats version 1
[ 3.114969] zswap: loaded using pool lzo/zbud
[ 3.121097] Btrfs loaded, crc32c=crc32c-generic
[ 3.121194] ima: No TPM chip found, activating TPM-bypass! (rc=-19)
[ 3.121215] ima: Allocated hash algorithm: sha256
[ 3.197238] mmcblk1: mmc1:0001 MK2704 3.53 GiB
[ 3.203870] mmcblk1boot0: mmc1:0001 MK2704 partition 1 2.00 MiB
[ 3.210428] mmcblk1boot1: mmc1:0001 MK2704 partition 2 2.00 MiB
[ 3.216862] mmcblk1rpmb: mmc1:0001 MK2704 partition 3 512 KiB
[ 3.226304] mmcblk1: p1
[ 3.243007] input: tps65217_pwr_but as /devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input1
[ 3.254827] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[ 3.260841] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[ 3.267929] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[ 3.275259] remoteproc remoteproc0: powering up wkup_m3
[ 3.284727] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[ 3.295693] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 00:13:41 UTC (946685621)
[ 3.304765] remoteproc remoteproc0: remote processor wkup_m3 is now up
[ 3.304786] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x193
[ 3.318690] of_cfs_init
[ 3.321316] of_cfs_init: OK
[ 3.325988] ALSA device list:
[ 3.328993] No soundcards found.
[ 3.336910] Freeing unused kernel memory: 1024K
Loading, please wait…
starting version 232
[ 3.801307] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[ 3.818802] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[ 3.830308] random: udevadm: uninitialized urandom read (16 bytes read)
Begin: Loading essential drivers … done.
Begin: Running /scripts/init-premount … done.
Begin: Mounting root file system … Begin: Running /scripts/local-top … done.
Begin: Running /scripts/local-premount … done.
Warning: fsck not present, so skipping root file system
[ 27.688535] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
done.
Begin: Running /scripts/local-bottom … done.
Begin: Running /scripts/init-bottom … done.

Starting eMMC Flasher from microSD media
Version: [1.20180412: all ssh regneration override…]

================================================================================
Prepare environment for flashing
Starting at Sat Jan 1 00:14:06 UTC 2000

==> Giving system time to stablize…
5 4 3 2 1
==> Preparing /tmp
==> Preparing sysctl
==> sysctl: vm.min_free_kbytes=[2653]
==> sysctl: setting: [sysctl -w vm.min_free_kbytes=16384]
vm.min_free_kbytes = 16384

==> Determining root drive
==> console=ttyO0,115200n8 capemgr.enable_partno=DVK530-LCD4-01:00A0 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

==> root_drive=[/dev/mmcblk0p1]
====> Root drive identified at [/dev/mmcblk0p1]
==> Boot Drive [/dev/mmcblk0p1]
==> Figuring out Source and Destination devices
====> Source identified: [/dev/mmcblk0]
====> Destination identified: [/dev/mmcblk1]
==> Figuring out machine
====> Machine is TI_AM335x_BeagleBone_Black
====> Machine is compatible with BeagleBone Black

5 4 3 2 1

========================================
Checking for Valid bbb-eeprom header
==> Valid bbb-eeprom header found [335]

================================================================================
Checking running system
==> Copying: [/dev/mmcblk0] → [/dev/mmcblk1]
==> lsblk:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 14.7G 0 disk
-mmcblk0p1 179:1 0 14.7G 0 part / mmcblk1 179:8 0 3.5G 0 disk -mmcblk1p1 179:9 0 3.5G 0 part
mmcblk1boot0 179:16 0 2M 1 disk
mmcblk1boot1 179:24 0 2M 1 disk
mmcblk1rpmb 179:32 0 512K 0 disk

==> df -h | grep rootfs:

==> Giving you time to check…
10 9 8 7 6 5 4 3 2 1

================================================================================
Preparing drives


==> Erasing: /dev/mmcblk1

[ 50.609731] random: crng init done
[ 50.613180] random: 7 urandom warning(s) missed due to ratelimiting
108+0 records in
108+0 records out
113246208 bytes (113 MB, 108 MiB) copied, 8.80184 s, 12.9 MB/s

108+0 records in
108+0 records out
113246208 bytes (113 MB, 108 MiB) copied, 2.66819 s, 42.4 MB/s

==> Erasing: /dev/mmcblk1 complete


==> Loading /boot/SOC.sh


#!/bin/sh
format=1.0

board=am335x_evm

bootloader_location=dd_spl_uboot_boot
bootrom_gpt=

dd_spl_uboot_count=1
dd_spl_uboot_seek=1
dd_spl_uboot_conf=notrunc
dd_spl_uboot_bs=128k
dd_spl_uboot_backup=/opt/backup/uboot/MLO

dd_uboot_count=2
dd_uboot_seek=1
dd_uboot_conf=notrunc
dd_uboot_bs=384k
dd_uboot_backup=/opt/backup/uboot/u-boot.img

boot_fstype=ext4
conf_boot_startmb=4
conf_boot_endmb=
sfdisk_fstype=L

boot_label=BOOT
rootfs_label=rootfs

kernel
dtb=
serial_tty=ttyO0
usbnet_mem=

#Advanced options
#disable_ssh_regeneration=true


==> Loaded


================================================================================
Writing bootloader to [/dev/mmcblk1]

==> Figuring out options for SPL U-Boot copy …
===> Will use : count=1 seek=1 conv=notrunc bs=128k
==> Figuring out options for U-Boot copy …
===> Will use : count=2 seek=1 conv=notrunc bs=384k
==> Copying SPL U-Boot with dd if=/opt/backup/uboot/MLO of=/dev/mmcblk1 count=1 seek=1 conv=notrunc bs=128k

0+1 records in
0+1 records out
90932 bytes (91 kB, 89 KiB) copied, 0.0207384 s, 4.4 MB/s

==> Copying U-Boot with dd if=/opt/backup/uboot/u-boot.img of=/dev/mmcblk1 count=2 seek=1 conv=notrunc bs=384k

1+1 records in
1+1 records out
447372 bytes (447 kB, 437 KiB) copied, 0.0866162 s, 5.2 MB/s

Writing bootloader completed

================================================================================
Partitionning /dev/mmcblk1

sfdisk: [2.26.x or greater]
==> sfdisk parameters:
sfdisk: [sfdisk from util-linux 2.29.2]
sfdisk: [sfdisk --force /dev/mmcblk1]
sfdisk: [4M,L,*]
==> Partitionning

Checking that no-one is using this disk right now … OK

Disk /dev/mmcblk1: 3.5 GiB, 3791650816 bytes, 7405568 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Created a new DOS disklabel with disk identifier 0xab05e3ec.
/dev/mmcblk1p1: Created a new partition 1 of type ‘Linux’ and of size 3.5 GiB.
/dev/mmcblk1p2: Done.

New situation:

Device Boot Start End Sectors Size Id[ 62.024278] mmcblk1: p1
Type
/dev/mmcblk1p1 * 8192 7405567 7397376 3.5G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

==> Partitionning Completed
==> Generated Partitions:

Disk /dev/mmcblk1: 3.5 GiB, 3791650816 bytes, 7405568 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xab05e3ec

Device Boot Start End Sectors Size Id Type
/dev/mmcblk1p1 * 8192 7405567 7397376 3.5G 83 Linux

================================================================================

================================================================================
Preparing future rootfs to receive files

==> Formatting rootfs with mkfs.ext4 -O ^metadata_csum,^64bit /dev/mmcblk1p1 -L rootfs

mke2fs 1.43.4 (31-Jan-2017)
Discarding device blocks: done
Creating filesystem with 924672 4k blocks and 231536 inodes
Filesystem UUID: e7830791-f3df-4335-9112-fbe5a49275c1
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done


==> Formatting rootfs: /dev/mmcblk1p1 complete
==> Creating temporary rootfs directory (/tmp/rootfs)
==> Mounting /dev/mmcblk1p1 to /tmp/rootfs
[ 77.528205] EXT4-fs (mmcblk1p1): mounted filesystem with ordered data mode. Opts: (null)

================================================================================

================================================================================
Copying: Current rootfs to /dev/mmcblk1p1

==> rsync: / → /tmp/rootfs


==> Copying: Kernel modules
===> Creating directory for modules
===> rsync: /lib/modules/4.14.67+/ → /tmp/rootfs/lib/modules/4.14.67+/

rsync: link_stat “/lib/modules/4.14.67+/*” failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]
writing to [/dev/mmcblk1] failed…
==> Stopping Cylon LEDs …
==> Setting LEDs to
/opt/scripts/tools/eMMC/functions.sh: line 391: 958 Terminated cylon_leds

Regards
Anand

Wow! This could have been a lot easier to read, had you used backticks to enclose your log…

Anyhow, until @RobertCNelson drops by,
might I suggest you try re-writing your SD and trying again?

Your running a custom kernel and missing the modules. Fix that then my script will work.

You shouldn’t say I’m running XYZ… but forget to mention, but I changed wxy.

Hi Robert,

Thank you,

Can you also please suggest a way to erase my EMMC completely at the time of Uboot?. I dont see any prompts coming at the time of uboot to enter any command. I thought I will completely erase the EMMC and then try to install a fresh image over micro SD Card.

Regards
Anu

Hi Robert,

I took an old image, BBB-blank-debian-9.5-iot-armhf-2018-10-07-4gb and reflashed it to the board. Now the BBB works fine.

Thank you,
Anu