RobertCNelson / boot-scripts

Just a bunch of useful scripts placed under /opt/scripts/
124 stars 131 forks source link

boot from eMMC not working after using bbb-eMMC-flasher-eewiki-ext4.sh #127

Open lilyjayd opened 1 year ago

lilyjayd commented 1 year ago

Hello,

first of all, I'd like to thank you @RobertCNelson - what you are doing is amazing!

So I followed your instructions for BBB (I skipped only HDMI and u-boot Overlays sections) from here:

https://forum.digikey.com/t/debian-getting-started-with-the-beaglebone-black/12967

It booted completely fine from SD card. And at that time my BBB was also properly booting old u-boot and kernel on eMMC. So I booted again from SD card to flash the fresh software to eMMC via:

wget https://raw.githubusercontent.com/RobertCNelson/boot-scripts/master/tools/eMMC/bbb-eMMC-flasher-eewiki-ext4.sh
chmod +x bbb-eMMC-flasher-eewiki-ext4.sh
sudo /bin/bash ./bbb-eMMC-flasher-eewiki-ext4.sh

After the script finished, I did sync + remove SD card and restart BBB. It did not end well:

U-Boot SPL 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)
Trying to boot from MMC2
mmc_load_image_raw_sector: mmc block read error
spl_register_fat_device: fat register err - -1
spl_load_image_fat: error reading image u-boot.img, err - -1
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

Below, you can find logs from the whole session: boot from SD card with software installed by following instruction on digikey forum, download and execution of bbb-eMMC-flasher-eewiki-ext4.sh script and then restart without SD card inserted.

After that I booted again from SD card and used the bbb-eMMC-flasher-eewiki-ext4.sh once more - with the same result unfortunately. Below logs doesn't cover that second try.

What can be wrong here? Any way to debug and fix that?

U-Boot SPL 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)
Trying to boot from MMC1

U-Boot 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM:  512 MiB
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
Core:  150 devices, 14 uclasses, devicetree: separate
WDT:   Started wdt@44e35000 with servicing (60s timeout)
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... ** File not found /boot/uboot.env **

** Unable to read "/boot/uboot.env" from mmc0:1 **
Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
BeagleBone Cape EEPROM: no EEPROM at address: 0x54
BeagleBone Cape EEPROM: no EEPROM at address: 0x55
BeagleBone Cape EEPROM: no EEPROM at address: 0x56
BeagleBone Cape EEPROM: no EEPROM at address: 0x57
Net:   eth2: ethernet@4a100000, eth3: usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[A335BNLT] ...
board_rev=[000C] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
Couldn't find partition 0:2 0x82000000
Can't set block device
Couldn't find partition 0:2 0x82000000
Can't set block device
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk mmc@48060000.blk...
Scanning disk mmc@481d8000.blk...
Found 4 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
23 bytes read in 6 ms (2.9 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-5.15.65-bone28 ...
9802240 bytes read in 624 ms (15 MiB/s)
debug: [enable_uboot_overlays=] ...
loading /boot/dtbs/5.15.65-bone28/am335x-boneblack.dtb ...
94864 bytes read in 15 ms (6 MiB/s)
uboot_overlays: add [enable_uboot_overlays=1] to /boot/uEnv.txt to enable...
debug: [console=ttyS0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait] ...
debug: [bootz 0x82000000 - 0x88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0x959200 ]
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8ffe5000, end 8ffff28f ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.15.65-bone28 (tom@tom-tp) (arm-linux-gnueabi-gcc (GCC) 11.3.0, GNU ld (GNU Binutils) 2.38) #1 PREEMPT Fri Sep 16 12:06:18 CEST 2022
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=50c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black
[    0.000000] Memory policy: Data cache writeback
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 48 MiB at 0x9c800000
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000080000000-0x000000009fefffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x000000009fefffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009fefffff]
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129666
[    0.000000] Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:on, heap free:off
[    0.000000] Memory: 450260K/523264K available (10240K kernel code, 1650K rwdata, 3756K rodata, 1024K init, 343K bss, 23852K reserved, 49152K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] ftrace: allocating 45964 entries in 135 pages
[    0.000000] ftrace: allocated 135 pages with 4 groups
[    0.000000] trace event string verifier disabled
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000]  Rude variant of Tasks RCU enabled.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts
[    0.000000] TI gptimer clocksource: always-on /ocp/interconnect@44c00000/segment@200000/target-module@31000
[    0.000002] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000023] clocksource: dmtimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000349] TI gptimer clockevent: 24000000 Hz at /ocp/interconnect@48000000/segment@0/target-module@40000
[    0.001654] Console: colour dummy device 80x30
[    0.001736] Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)
[    0.020431] pid_max: default: 32768 minimum: 301
[    0.020901] LSM: Security Framework initializing
[    0.021047] Yama: becoming mindful.
[    0.021332] AppArmor: AppArmor initialized
[    0.021353] TOMOYO Linux initialized
[    0.021548] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.021569] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.023093] CPU: Testing write buffer coherency: ok
[    0.023173] CPU0: Spectre v2: using BPIALL workaround
[    0.024765] Setting up static identity map for 0x80100000 - 0x80100054
[    0.024981] rcu: Hierarchical SRCU implementation.
[    0.026123] EFI services will not be available.
[    0.026891] devtmpfs: initialized
[    0.043658] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.044077] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.044112] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.049313] pinctrl core: initialized pinctrl subsystem
[    0.051105] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.059572] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.060134] audit: initializing netlink subsys (disabled)
[    0.061278] thermal_sys: Registered thermal governor 'fair_share'
[    0.061295] thermal_sys: Registered thermal governor 'bang_bang'
[    0.061310] thermal_sys: Registered thermal governor 'step_wise'
[    0.061751] cpuidle: using governor menu
[    0.068468] audit: type=2000 audit(0.060:1): state=initialized audit_enabled=0 res=1
[    0.077300] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.095885] raid6: skip pq benchmark and using algorithm neonx8
[    0.095923] raid6: using neon recovery algorithm
[    0.097547] iommu: Default domain type: Translated
[    0.097573] iommu: DMA domain TLB invalidation policy: strict mode
[    0.099234] SCSI subsystem initialized
[    0.099580] usbcore: registered new interface driver usbfs
[    0.099631] usbcore: registered new interface driver hub
[    0.099682] usbcore: registered new device driver usb
[    0.100103] pps_core: LinuxPPS API ver. 1 registered
[    0.100120] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.100145] PTP clock support registered
[    0.101557] Advanced Linux Sound Architecture Driver Initialized.
[    0.102414] NetLabel: Initializing
[    0.102432] NetLabel:  domain hash size = 128
[    0.102440] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    0.102525] NetLabel:  unlabeled traffic allowed by default
[    0.103359] clocksource: Switched to clocksource dmtimer
[    0.205825] VFS: Disk quotas dquot_6.6.0
[    0.205948] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.206874] AppArmor: AppArmor Filesystem Enabled
[    0.227650] NET: Registered PF_INET protocol family
[    0.227918] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.235972] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.236195] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.236225] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.236279] TCP bind hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.236321] TCP: Hash tables configured (established 4096 bind 4096)
[    0.236579] MPTCP token hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.236686] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.236714] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.236984] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.237876] RPC: Registered named UNIX socket transport module.
[    0.237900] RPC: Registered udp transport module.
[    0.237909] RPC: Registered tcp transport module.
[    0.237917] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.237930] NET: Registered PF_XDP protocol family
[    1.226064] Initialise system trusted keyrings
[    1.226462] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    1.233156] zbud: loaded
[    1.236410] NFS: Registering the id_resolver key type
[    1.236486] Key type id_resolver registered
[    1.236496] Key type id_legacy registered
[    1.236643] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.236659] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    1.236945] fuse: init (API version 7.34)
[    1.330859] xor: automatically using best checksumming function   neon
[    1.330892] Key type asymmetric registered
[    1.330903] Asymmetric key parser 'x509' registered
[    1.331032] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    1.331300] io scheduler mq-deadline registered
[    1.334997] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
[    1.342299] CAN device driver interface
[    1.343237] usbcore: registered new interface driver uas
[    1.343515] usbcore: registered new interface driver usb-storage
[    1.343571] usbcore: registered new interface driver ums-alauda
[    1.343608] usbcore: registered new interface driver ums-cypress
[    1.343641] usbcore: registered new interface driver ums-datafab
[    1.343673] usbcore: registered new interface driver ums_eneub6250
[    1.343705] usbcore: registered new interface driver ums-freecom
[    1.343737] usbcore: registered new interface driver ums-isd200
[    1.343769] usbcore: registered new interface driver ums-jumpshot
[    1.343801] usbcore: registered new interface driver ums-karma
[    1.343832] usbcore: registered new interface driver ums-onetouch
[    1.343907] usbcore: registered new interface driver ums-realtek
[    1.343946] usbcore: registered new interface driver ums-sddr09
[    1.343980] usbcore: registered new interface driver ums-sddr55
[    1.344012] usbcore: registered new interface driver ums-usbat
[    1.345738] i2c_dev: i2c /dev entries driver
[    1.345887] Driver for 1-wire Dallas network protocol.
[    1.346781] softdog: initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0)
[    1.346801] softdog:              soft_reboot_cmd=<not set> soft_active_on_boot=0
[    1.347794] cpuidle: enable-method property 'ti,am3352' found operations
[    1.348335] sdhci: Secure Digital Host Controller Interface driver
[    1.348351] sdhci: Copyright(c) Pierre Ossman
[    1.348484] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.348705] ledtrig-cpu: registered to indicate activity on CPUs
[    1.349326] hid: raw HID events driver (C) Jiri Kosina
[    1.349581] usbcore: registered new interface driver usbhid
[    1.349595] usbhid: USB HID core driver
[    1.351004] drop_monitor: Initializing network drop monitor service
[    1.352152] NET: Registered PF_INET6 protocol family
[    1.356659] Segment Routing with IPv6
[    1.356792] In-situ OAM (IOAM) with IPv6
[    1.356910] mip6: Mobile IPv6
[    1.356925] NET: Registered PF_PACKET protocol family
[    1.356951] can: controller area network core
[    1.357037] NET: Registered PF_CAN protocol family
[    1.357431] Key type dns_resolver registered
[    1.357451] mpls_gso: MPLS GSO support
[    1.357622] ThumbEE CPU extension supported.
[    1.357643] Registering SWP/SWPB emulation handler
[    1.357655] omap_voltage_late_init: Voltage driver support not added
[    1.357954] PM: Cannot get wkup_m3_ipc handle
[    1.358664] registered taskstats version 1
[    1.358696] Loading compiled-in X.509 certificates
[    1.359063] zswap: loaded using pool lzo/zbud
[    1.359872] Key type ._fscrypt registered
[    1.359896] Key type .fscrypt registered
[    1.359905] Key type fscrypt-provisioning registered
[    1.367081] Btrfs loaded, crc32c=crc32c-generic, zoned=yes, fsverity=yes
[    1.367243] AppArmor: AppArmor sha1 policy hashing enabled
[    1.388210] remoteproc remoteproc0: wkup_m3 is available
[    1.398451] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    1.402182] ti-sysc: probe of 44e31000.target-module failed with error -16
[    1.405194] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[    1.408229] omap_rtc 44e3e000.rtc: registered as rtc0
[    1.408295] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800)
[    1.416563] ti-sysc: probe of 48040000.target-module failed with error -16
[    1.426791] OMAP GPIO hardware version 0.1
[    1.431836] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[    1.436837] at24 2-0054: supply vcc not found, using dummy regulator
[    1.466825] at24 2-0055: supply vcc not found, using dummy regulator
[    1.493798] at24 2-0056: supply vcc not found, using dummy regulator
[    1.521745] at24 2-0057: supply vcc not found, using dummy regulator
[    1.549458] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[    1.560100] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator
[    1.571606] omap_rng 48310000.rng: Random Number Generator ver. 20
[    1.572061] random: crng init done
[    1.615404] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[    1.617319] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[    1.617714] cpsw-switch 4a100000.switch: initialized cpsw ale version 1.4
[    1.617737] cpsw-switch 4a100000.switch: ALE Table size 1024
[    1.617830] cpsw-switch 4a100000.switch: cpts: overflow check period 1250 (jiffies)
[    1.617849] cpsw-switch 4a100000.switch: CPTS: ref_clk_freq:250000000 calc_mult:2147483648 calc_shift:29 error:0 nsec/sec
[    1.617958] cpsw-switch 4a100000.switch: Detected MACID = d0:39:72:41:ca:40
[    1.619180] cpsw-switch 4a100000.switch: initialized (regs 0x4a100000, pool size 256) hw_ver:0019010C 1.12 (0)
[    1.632921] debugfs: Directory '49000000.dma' with parent 'dmaengine' already present!
[    1.632971] edma 49000000.dma: TI EDMA DMA engine driver
[    1.638606] am335x-phy-driver 47401300.usb-phy: supply vcc not found, using dummy regulator
[    1.638907] am335x-phy-driver 47401300.usb-phy: dummy supplies not allowed for exclusive requests
[    1.645762] am335x-phy-driver 47401b00.usb-phy: supply vcc not found, using dummy regulator
[    1.646052] am335x-phy-driver 47401b00.usb-phy: dummy supplies not allowed for exclusive requests
[    1.660946] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
[    1.661238] omap-sham 53100000.sham: will run requests pump with realtime priority
[    1.664303] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
[    1.664693] omap-aes 53500000.aes: will run requests pump with realtime priority
[    1.669646] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    1.674793] l3-aon-clkctrl:0000:0: failed to disable
[    1.678208] PM: Cannot get wkup_m3_ipc handle
[    1.680476] printk: console [ttyS0] disabled
[    1.680581] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 18, base_baud = 3000000) is a 8250
[    2.912483] printk: console [ttyS0] enabled
[    2.939946] tps65217-pmic: Failed to locate of_node [id: -1]
[    2.954599] tps65217-bl: Failed to locate of_node [id: -1]
[    2.963063] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[    2.968961] at24 0-0050: supply vcc not found, using dummy regulator
[    2.976010] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    2.983265] i2c 0-0070: Fixing up cyclic dependency with 4830e000.lcdc
[    3.109805] tda998x 0-0070: found TDA19988
[    3.116716] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    3.124641] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22)
[    3.135095] tilcdc 4830e000.lcdc: bound 0-0070 (ops 0xc0ba1d14)
[    3.141160] remoteproc remoteproc0: powering up wkup_m3
[    3.147495] sdhci-omap 481d8000.mmc: supply vqmmc not found, using dummy regulator
[    3.155187] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
[    3.163550] sdhci-omap 48060000.mmc: Got CD GPIO
[    3.169632] [drm] Initialized tilcdc 1.0.0 20121205 for 4830e000.lcdc on minor 0
[    3.178248] sdhci-omap 48060000.mmc: supply vqmmc not found, using dummy regulator
[    3.186196] remoteproc remoteproc0: remote processor wkup_m3 is now up
[    3.192766] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192
[    3.200222] tilcdc 4830e000.lcdc: [drm] Cannot find any crtc or sizes
[    3.211492] mmc1: SDHCI controller on 481d8000.mmc [481d8000.mmc] using External DMA
[    3.226936] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
[    3.232772] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1
[    3.240506] mmc0: SDHCI controller on 48060000.mmc [48060000.mmc] using External DMA
[    3.249033] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[    3.257529] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.264845] usb usb1: Product: MUSB HDRC host driver
[    3.269889] usb usb1: Manufacturer: Linux 5.15.65-bone28 musb-hcd
[    3.276062] usb usb1: SerialNumber: musb-hdrc.1
[    3.281544] hub 1-0:1.0: USB hub found
[    3.285511] hub 1-0:1.0: 1 port detected
[    3.299048] PM: bootloader does not support rtc-only!
[    3.305133] tps6521x_pwrbutton tps65217-pwrbutton: DMA mask not set
[    3.312499] input: tps65217_pwr_but as /devices/platform/ocp/44c00000.interconnect/44c00000.interconnect:segment@200000/44e0b000.target-module/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0
[    3.334475] ALSA device list:
[    3.337721]   No soundcards found.
[    3.341807] Waiting for root device /dev/mmcblk0p1...
[    3.351196] mmc0: new high speed SDHC card at address 0007
[    3.358148] mmcblk0: mmc0:0007 SL16G 14.5 GiB
[    3.363628] mmc1: new high speed MMC card at address 0001
[    3.371320]  mmcblk0: p1
[    3.374314] mmcblk1: mmc1:0001 MMC04G 3.60 GiB
[    3.383216]  mmcblk1: p1
[    3.386948] mmcblk1boot0: mmc1:0001 MMC04G 2.00 MiB
[    3.394218] mmcblk1boot1: mmc1:0001 MMC04G 2.00 MiB
[    3.401112] mmcblk1rpmb: mmc1:0001 MMC04G 128 KiB, chardev (242:0)
[    3.435705] EXT4-fs (mmcblk0p1): INFO: recovery required on readonly filesystem
[    3.443108] EXT4-fs (mmcblk0p1): write access will be enabled during recovery
[   16.044213] EXT4-fs (mmcblk0p1): recovery complete
[   16.079963] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[   16.089931] VFS: Mounted root (ext4 filesystem) readonly on device 179:1.
[   16.098257] devtmpfs: mounted
[   16.105751] Freeing unused kernel image (initmem) memory: 1024K
[   16.113647] Checked W+X mappings: passed, no W+X pages found
[   16.119387] Run /sbin/init as init process
[   16.143967] Not activating Mandatory Access Control as /sbin/tomoyo-init does not exist.
[   16.696524] systemd[1]: System time before build time, advancing clock.
[   16.852287] systemd[1]: systemd 247.3-7+deb11u1 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified)
[   16.876285] systemd[1]: Detected architecture arm.

Welcome to Debian GNU/Linux 11 (bullseye)!

[   16.901951] systemd[1]: Set hostname to <arm>.
[   18.200546] systemd[1]: Queued start job for default target Graphical Interface.
[   18.215290] systemd[1]: Created slice system-getty.slice.
[  OK  ] Created slice system-getty.slice.
[   18.242459] systemd[1]: Created slice system-modprobe.slice.
[  OK  ] Created slice system-modprobe.slice.
[   18.266651] systemd[1]: Created slice system-serial\x2dgetty.slice.
[  OK  ] Created slice system-serial\x2dgetty.slice.
[   18.290017] systemd[1]: Created slice User and Session Slice.
[  OK  ] Created slice User and Session Slice.
[   18.312661] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Started Dispatch Password …ts to Console Directory Watch.
[   18.336596] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Started Forward Password R…uests to Wall Directory Watch.
[   18.361405] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[  OK  ] Set up automount Arbitrary…s File System Automount Point.
[   18.388351] systemd[1]: Reached target Local Encrypted Volumes.
[  OK  ] Reached target Local Encrypted Volumes.
[   18.412363] systemd[1]: Reached target Paths.
[  OK  ] Reached target Paths.
[   18.432160] systemd[1]: Reached target Remote File Systems.
[  OK  ] Reached target Remote File Systems.
[   18.456088] systemd[1]: Reached target Slices.
[  OK  ] Reached target Slices.
[   18.476240] systemd[1]: Reached target Swap.
[  OK  ] Reached target Swap.
[   18.498852] systemd[1]: Listening on Syslog Socket.
[  OK  ] Listening on Syslog Socket.
[   18.521057] systemd[1]: Listening on fsck to fsckd communication Socket.
[  OK  ] Listening on fsck to fsckd communication Socket.
[   18.544684] systemd[1]: Listening on initctl Compatibility Named Pipe.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[   18.569548] systemd[1]: Listening on Journal Audit Socket.
[  OK  ] Listening on Journal Audit Socket.
[   18.593072] systemd[1]: Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket (/dev/log).
[   18.617282] systemd[1]: Listening on Journal Socket.
[  OK  ] Listening on Journal Socket.
[   18.641408] systemd[1]: Listening on udev Control Socket.
[  OK  ] Listening on udev Control Socket.
[   18.664939] systemd[1]: Listening on udev Kernel Socket.
[  OK  ] Listening on udev Kernel Socket.
[   18.689192] systemd[1]: Condition check resulted in Huge Pages File System being skipped.
[   18.704043] systemd[1]: Mounting POSIX Message Queue File System...
         Mounting POSIX Message Queue File System...
[   18.743223] systemd[1]: Mounting Kernel Debug File System...
         Mounting Kernel Debug File System...
[   18.786388] systemd[1]: Mounting Kernel Trace File System...
         Mounting Kernel Trace File System...
[   18.832230] systemd[1]: Starting Restore / save the current clock...
         Starting Restore / save the current clock...
[   18.893217] systemd[1]: Starting Create list of static device nodes for the current kernel...
         Starting Create list of st…odes for the current kernel...
[   18.944974] systemd[1]: Starting Load Kernel Module configfs...
         Starting Load Kernel Module configfs...
[   18.983045] systemd[1]: Starting Load Kernel Module drm...
         Starting Load Kernel Module drm...
[   19.019023] systemd[1]: Starting Load Kernel Module fuse...
         Starting Load Kernel Module fuse...
[   19.051764] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped.
[   19.068078] systemd[1]: Starting File System Check on Root Device...
         Starting File System Check on Root Device...
[   19.116870] systemd[1]: Starting Journal Service...
         Starting Journal Service...
[   19.182267] systemd[1]: Starting Load Kernel Modules...
         Starting Load Kernel Modules...
[   19.244882] systemd[1]: Starting Coldplug All udev Devices...
         Starting Coldplug All udev Devices...
[   19.365425] systemd[1]: Mounted POSIX Message Queue File System.
[  OK  ] Mounted POSIX Message Queue File System.
[   19.406818] systemd[1]: Mounted Kernel Debug File System.
[  OK  ] Mounted Kernel Debug File System.
[   19.438250] systemd[1]: Mounted Kernel Trace File System.
[  OK  ] Mounted Kernel Trace File System.
[   19.496462] systemd[1]: Finished Restore / save the current clock.
[  OK  ] Finished Restore / save the current clock.
[   19.551922] systemd[1]: Finished Create list of static device nodes for the current kernel.
[  OK  ] Finished Create list of st… nodes for the current kernel.
[   19.594493] systemd[1]: modprobe@configfs.service: Succeeded.
[   19.623818] systemd[1]: Finished Load Kernel Module configfs.
[  OK  ] Finished Load Kernel Module configfs.
[   19.662536] systemd[1]: modprobe@drm.service: Succeeded.
[   19.687964] systemd[1]: Finished Load Kernel Module drm.
[  OK  ] Finished Load Kernel Module drm.
[   19.726613] systemd[1]: modprobe@fuse.service: Succeeded.
[   19.751922] systemd[1]: Finished Load Kernel Module fuse.
[  OK  ] Finished Load Kernel Module fuse.
[   19.799895] systemd[1]: Finished File System Check on Root Device.
[  OK  ] Finished File System Check on Root Device.
[   19.839644] systemd[1]: Finished Load Kernel Modules.
[  OK  ] Finished Load Kernel Modules.
[   19.897325] systemd[1]: Mounting FUSE Control File System...
         Mounting FUSE Control File System...
[   19.982901] systemd[1]: Mounting Kernel Configuration File System...
         Mounting Kernel Configuration File System...
[   20.050652] systemd[1]: Started File System Check Daemon to report status.
[  OK  ] Started File System Check Daemon to report status.
[   20.099269] systemd[1]: Starting Remount Root and Kernel File Systems...
         Starting Remount Root and Kernel File Systems...
[   20.154640] systemd[1]: Starting Apply Kernel Variables...
         Starting Apply Kernel Variables...
[   20.205876] systemd[1]: Started Journal Service.
[  OK  ] Started Journal Service.
[  OK  ] Mounted FUSE Control File System.
[  OK  ] Mounted Kernel Configuration File System.
[   20.363194] EXT4-fs (mmcblk0p1): re-mounted. Opts: errors=remount-ro. Quota mode: none.
[  OK  ] Finished Apply Kernel Variables.
[  OK  ] Finished Remount Root and Kernel File Systems.
         Starting Flush Journal to Persistent Storage...
         Starting Load/Save Random Seed...
         Starting Create System Users...
[   20.696458] systemd-journald[162]: Received client request to flush runtime journal.
[  OK  ] Finished Coldplug All udev Devices.
         Starting Helper to synchronize boot up for ifupdown...
[   21.740808] systemd-journald[162]: File /var/log/journal/1f9d3ee72ffc43e19f4c0169d6685112/system.journal corrupted or uncleanly shut down, renaming and replacing.
[  OK  ] Finished Create System Users.
[  OK  ] Finished Load/Save Random Seed.
         Starting Create Static Device Nodes in /dev...
[  OK  ] Finished Flush Journal to Persistent Storage.
[  OK  ] Finished Create Static Device Nodes in /dev.
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Reached target Local File Systems.
         Starting Create Volatile Files and Directories...
         Starting Rule-based Manage…for Device Events and Files...
[  OK  ] Finished Create Volatile Files and Directories.
         Starting Network Time Synchronization...
         Starting Update UTMP about System Boot/Shutdown...
[  OK  ] Started Rule-based Manager for Device Events and Files.
[  OK  ] Finished Update UTMP about System Boot/Shutdown.
[  OK  ] Started Network Time Synchronization.
[  OK  ] Reached target System Initialization.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target System Time Set.
[  OK  ] Reached target System Time Synchronized.
[  OK  ] Started Periodic ext4 Onli…ata Check for All Filesystems.
[  OK  ] Started Discard unused blocks once a week.
[  OK  ] Started Daily rotation of log files.
[  OK  ] Reached target Timers.
[  OK  ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
         Starting Avahi mDNS/DNS-SD Stack...
[  OK  ] Started Regular background program processing daemon.
[  OK  ] Started D-Bus System Message Bus.
         Starting Network Manager...
         Starting Remove Stale Onli…t4 Metadata Check Snapshots...
         Starting Authorization Manager...
         Starting System Logging Service...
         Starting User Login Management...
         Starting WPA supplicant...
[  OK  ] Started System Logging Service.
[  OK  ] Started Avahi mDNS/DNS-SD Stack.
[  OK  ] Started WPA supplicant.
[  OK  ] Finished Remove Stale Onli…ext4 Metadata Check Snapshots.
[  OK  ] Started Authorization Manager.
         Starting Modem Manager...
[  OK  ] Started Network Manager.
[  OK  ] Started User Login Management.
         Starting Hostname Service...
[  OK  ] Started Hostname Service.
[  OK  ] Started Modem Manager.
         Starting Network Manager Script Dispatcher Service...
[  OK  ] Started Network Manager Script Dispatcher Service.
[  OK  ] Found device /dev/ttyS0.
[   38.226180] remoteproc remoteproc1: 4a334000.pru is available
[  OK  ] Reached target Hardware activated USB gadget.
[  OK  ] Listening on Load/Save RF …itch Status /dev/rfkill Watch.
[   38.382989] remoteproc remoteproc2: 4a338000.pru is available
[  OK  ] Reached target Sound Card.
[  OK  ] Finished Helper to synchronize boot up for ifupdown.
         Starting Raise network interfaces...
[   39.352964] cpsw-switch 4a100000.switch: starting ndev. mode: dual_mac
[   39.409431] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
[   41.476321] cpsw-switch 4a100000.switch eth0: Link is Up - 100Mbps/Full - flow control off
[   41.484754] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[  OK  ] Finished Raise network interfaces.
[  OK  ] Reached target Network.
         Starting A high performanc… and a reverse proxy server...
         Starting OpenBSD Secure Shell server...
         Starting Permit User Sessions...
[  OK  ] Finished Permit User Sessions.
[  OK  ] Started Getty on tty1.
[  OK  ] Started Serial Getty on ttyS0.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started OpenBSD Secure Shell server.
[  OK  ] Started A high performance…er and a reverse proxy server.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Finished Update UTMP about System Runlevel Changes.

Debian GNU/Linux 11 arm ttyS0

default username:password is [debian:temppwd]

arm login: debian
Password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Sep 12 15:35:26 UTC 2022 on ttyS0
ping debian@arm:~$ ping 8.8.8.8
ping: socket: Operation not permitted
debian@arm:~$ sudo !!
sudo ping 8.8.8.8

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for debian:
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=5.81 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=119 time=5.68 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 5.677/5.744/5.812/0.067 ms
debian@arm:~$
debian@arm:~$ ls
debian@arm:~$ sudo apt install initramfs-tools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
initramfs-tools is already the newest version (0.140).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
debian@arm:~$ sudo apt install dosfstools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
dosfstools is already the newest version (4.2-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
debian@arm:~$ sudo apt install rsync
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
rsync is already the newest version (3.2.3-4+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
debian@arm:~$
debian@arm:~$
debian@arm:~$
debian@arm:~$
debian@arm:~$ cd /opt/
backup/ source/
debian@arm:~$ cd /opt/source/
debian@arm:/opt/source$ ls
list.txt
debian@arm:/opt/source$ cd
debian@arm:~$ ls
master/tools/eMMC/bbb-eMMC-flasher-eewiki-ext4.sh om/RobertCNelson/boot-scripts/
--2022-09-17 19:23:03--  https://raw.githubusercontent.com/RobertCNelson/boot-scripts/master/tools/eMMC/bbb-eMMC-flasher-eewiki-ext4.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14129 (14K) [text/plain]
Saving to: ‘bbb-eMMC-flasher-eewiki-ext4.sh’

bbb-eMMC-flasher-ee 100%[===================>]  13.80K  --.-KB/s    in 0.003s

2022-09-17 19:23:03 (4.92 MB/s) - ‘bbb-eMMC-flasher-eewiki-ext4.sh’ saved [14129/14129]

debian@arm:~$
debian@arm:~$ ls
bbb-eMMC-flasher-eewiki-ext4.sh
debian@arm:~$ chmod +x bbb-eMMC-flasher-eewiki-ext4.sh
debian@arm:~$
debian@arm:~$ sudo /bin/bash ./bbb-eMMC-flasher-eewiki-ext4.sh
-----------------------------
Version: [1.20200709: Fix v5.4.x eeprom read...]
-----------------------------
copying: [/dev/mmcblk0] -> [/dev/mmcblk1]
lsblk:
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0 14.5G  0 disk
└─mmcblk0p1  179:1    0 14.5G  0 part /
mmcblk1      179:256  0  3.6G  0 disk
└─mmcblk1p1  179:257  0  3.6G  0 part
mmcblk1boot0 179:512  0    2M  1 disk
mmcblk1boot1 179:768  0    2M  1 disk
-----------------------------
df -h | grep rootfs:
-----------------------------
update-initramfs: Generating /boot/initrd.img-5.15.65-bone28
Erasing: /dev/mmcblk1
[  334.472276] musb-hdrc musb-hdrc.1: VBUS_ERROR in a_wait_vrise (88, <AValid), retry #3, port1 0008010c
108+0 records in
108+0 records out
113246208 bytes (113 MB, 108 MiB) copied, 10.4652 s, 10.8 MB/s
108+0 records in
108+0 records out
113246208 bytes (113 MB, 108 MiB) copied, 2.85152 s, 39.7 MB/s
Erasing: /dev/mmcblk1 complete
-----------------------------
--2022-09-17 19:26:00--  http://rcn-ee.com/repos/bootloader/am335x_evm/u-boot-am335x_evm-v2019.04-r13.img
Resolving rcn-ee.com (rcn-ee.com)... 45.33.2.10, 2600:3c00::f03c:91ff:fe37:6ad5
Connecting to rcn-ee.com (rcn-ee.com)|45.33.2.10|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://rcn-ee.com/repos/bootloader/am335x_evm/u-boot-am335x_evm-v2019.04-r13.img [following]
--2022-09-17 19:26:01--  https://rcn-ee.com/repos/bootloader/am335x_evm/u-boot-am335x_evm-v2019.04-r13.img
Connecting to rcn-ee.com (rcn-ee.com)|45.33.2.10|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 474352 (463K)
Saving to: ‘/opt/backup/uboot/u-boot-am335x_evm-v2019.04-r13.img’

u-boot-am335x_evm-v 100%[===================>] 463.23K   512KB/s    in 0.9s

2022-09-17 19:26:02 (512 KB/s) - ‘/opt/backup/uboot/u-boot-am335x_evm-v2019.04-r13.img’ saved [474352/474352]

Writing bootloader to [/dev/mmcblk1]
dd if=/opt/backup/uboot/MLO of=/dev/mmcblk1 count=1 seek=1 bs=128k
-----------------------------
0+1 records in
0+1 records out
106400 bytes (106 kB, 104 KiB) copied, 0.0275375 s, 3.9 MB/s
-----------------------------
dd if=/opt/backup/uboot/u-boot.img of=/dev/mmcblk1 count=2 seek=1 bs=384k
-----------------------------
1+1 records in
1+1 records out
474352 bytes (474 kB, 463 KiB) copied, 0.0627223 s, 7.6 MB/s
-----------------------------
Formatting: /dev/mmcblk1
sfdisk: [2.26.x or greater]
sfdisk: [sfdisk from util-linux 2.36.1]
sfdisk: [sfdisk --force /dev/mmcblk1]
sfdisk: [4M,,L,*]
Checking that no-one is using this disk right now ... OK

Disk /dev/mmcblk1: 3.6 GiB, 3867148288 bytes, 7553024 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 0xd1fe30c6.
/dev/mmcblk1p1: Created a new partition 1 of type 'Linux' and of size 3.6 GiB.
/dev/mmcblk1p2: Done.

New situation:
Disklabel type: dos
Disk identifier: 0xd1fe30c6

Device         Boot Start     End Sectors  Size Id Type
/dev/mmcblk1p1 *     8192 7553023 7544832  3.6G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.[  351.113909]  mmcblk1: p1

Syncing disks.
mkfs.ext4  /dev/mmcblk1p1 -L BEAGLEBONE
-----------------------------
mke2fs 1.46.2 (28-Feb-2021)
Discarding device blocks: done
Creating filesystem with 943104 4k blocks and 236176 inodes
Filesystem UUID: 57975418-7408-4914-94ed-bb1dd6c0d301
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: /dev/mmcblk1 complete
-----------------------------
Copying: /dev/mmcblk0p1 -> /dev/mmcblk1p1
[  362.574326] EXT4-fs (mmcblk1p1): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
rsync: / -> /tmp/rootfs/
Copying: Kernel modules
rsync: /lib/modules/5.15.65-bone28/ -> /tmp/rootfs/lib/modules/5.15.65-bone28/
Copying: /dev/mmcblk0p1 -> /dev/mmcblk1p1 complete
-----------------------------
Final System Tweaks:
UUID=57975418-7408-4914-94ed-bb1dd6c0d301
Generating: /etc/fstab
# /etc/fstab: static file system information.
#
UUID=57975418-7408-4914-94ed-bb1dd6c0d301  /  ext4  noatime,errors=remount-ro  0  1
debugfs  /sys/kernel/debug  debugfs  defaults  0  0
-----------------------------
Syncing: /dev/mmcblk1
100000+0 records in
100000+0 records out
51200000 bytes (51 MB, 49 MiB) copied, 1.51721 s, 33.7 MB/s
Syncing: /dev/mmcblk1 complete
-----------------------------
/dev/mmcblk0p1 on / type ext4 (rw,relatime,errors=remount-ro)
devtmpfs on /dev type devtmpfs (rw,relatime,size=225128k,nr_inodes=56282,mode=755)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=100088k,nr_inodes=819200,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=14826)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=50040k,nr_inodes=12510,mode=700,uid=1000,gid=1000)
eMMC has been flashed:
-----------------------------
debian@arm:~$
debian@arm:~$
debian@arm:~$ sync
debian@arm:~$ [ 1065.347728] mmc0: card 0007 removed
[ 1065.987876] EXT4-fs warning (device mmcblk0p1): ext4_end_bio:344: I/O error 10 writing to inode 529553 starting block 2425413)
[ 1066.009499] EXT4-fs warning (device mmcblk0p1): htree_dirblock_to_tree:1067: inode #529521: lblock 0: comm systemd-journal: error -5 reading directory block
[ 1066.053597] Buffer I/O error on device mmcblk0p1, logical block 2425413
[ 1066.084757] EXT4-fs warning (device mmcblk0p1): ext4_end_bio:344: I/O error 10 writing to inode 529553 starting block 2425545)
[ 1066.130858] Buffer I/O error on device mmcblk0p1, logical block 2425545
[ 1066.160797] EXT4-fs warning (device mmcblk0p1): ext4_end_bio:344: I/O error 10 writing to inode 529553 starting block 2425743)
[ 1066.204656] Buffer I/O error on device mmcblk0p1, logical block 2425743
[ 1066.221305] EXT4-fs error (device mmcblk0p1): __ext4_find_entry:1658: inode #263055: comm (md-udevd): reading directory lblock 0
[ 1066.234893] EXT4-fs warning (device mmcblk0p1): ext4_end_bio:344: I/O error 10 writing to inode 529553 starting block 2155520)
[ 1066.246513] EXT4-fs warning (device mmcblk0p1): ext4_end_bio:344: I/O error 10 writing to inode 529553 starting block 2425758)
[ 1066.262259] Aborting journal on device mmcblk0p1-8.
[ 1066.267769] EXT4-fs error (device mmcblk0p1): ext4_journal_check_start:83: comm rs:main Q:Reg: Detected aborted journal
[ 1066.279244] EXT4-fs error (device mmcblk0p1): ext4_journal_check_start:83: comm systemd-journal: Detected aborted journal
[ 1066.290400] Buffer I/O error on device mmcblk0p1, logical block 2425758
[ 1066.304887] Buffer I/O error on dev mmcblk0p1, logical block 1606558, lost sync page write
[ 1066.313289] Buffer I/O error on device mmcblk0p1, logical block 2425759
[ 1066.324645] Buffer I/O error on device mmcblk0p1, logical block 2155520
[ 1066.336655] JBD2: Error -5 detected when updating journal superblock for mmcblk0p1-8.
[ 1066.344715] EXT4-fs warning (device mmcblk0p1): ext4_end_bio:344: I/O error 10 writing to inode 529553 starting block 2425797)
[ 1066.356232] EXT4-fs warning (device mmcblk0p1): ext4_end_bio:344: I/O error 10 writing to inode 529553 starting block 2424872)
[ 1066.372683] Buffer I/O error on dev mmcblk0p1, logical block 0, lost sync page write
[ 1066.382404] EXT4-fs (mmcblk0p1): previous I/O error to superblock detected
[ 1066.389468] EXT4-fs (mmcblk0p1): I/O error while writing superblock
[ 1066.395827] Buffer I/O error on device mmcblk0p1, logical block 2425797
[ 1066.402561] EXT4-fs (mmcblk0p1): previous I/O error to superblock detected
[ 1066.409520] Buffer I/O error on dev mmcblk0p1, logical block 0, lost sync page write
[ 1066.417465] EXT4-fs (mmcblk0p1): Remounting filesystem read-only
[ 1066.423550] Buffer I/O error on device mmcblk0p1, logical block 2425798
[ 1066.430237] Buffer I/O error on device mmcblk0p1, logical block 2424872
[ 1066.436922] EXT4-fs (mmcblk0p1): I/O error while writing superblock
[ 1066.444266] EXT4-fs warning (device mmcblk0p1): ext4_end_bio:344: I/O error 10 writing to inode 529553 starting block 2425800)
[ 1066.456247] Buffer I/O error on dev mmcblk0p1, logical block 0, lost sync page write
[ 1066.468024] Buffer I/O error on device mmcblk0p1, logical block 2425800
[ 1066.480158] EXT4-fs warning (device mmcblk0p1): ext4_end_bio:344: I/O error 10 writing to inode 529553 starting block 2424885)
[ 1066.532999] EXT4-fs (mmcblk0p1): I/O error while writing superblock
[ 1066.550300] EXT4-fs (mmcblk0p1): ext4_writepages: jbd2_start: 2147483567 pages, ino 529553; err -30
[ 1066.650693] EXT4-fs error (device mmcblk0p1): __ext4_find_entry:1658: inode #263055: comm (md-udevd): reading directory lblock 0
[ 1066.859779] EXT4-fs error (device mmcblk0p1): __ext4_find_entry:1658: inode #263055: comm (md-udevd): reading directory lblock 0
[ 1066.876772] EXT4-fs error (device mmcblk0p1): __ext4_find_entry:1658: inode #654081: comm cron: reading directory lblock 0
[ 1066.915881] EXT4-fs error (device mmcblk0p1): __ext4_find_entry:1658: inode #654081: comm cron: reading directory lblock 0
[ 1066.976071] EXT4-fs error (device mmcblk0p1): __ext4_find_entry:1658: inode #523293: comm cron: reading directory lblock 0
[ 1067.008994] EXT4-fs error (device mmcblk0p1): __ext4_find_entry:1658: inode #654081: comm cron: reading directory lblock 0
[ 1067.063982] EXT4-fs error (device mmcblk0p1): __ext4_find_entry:1658: inode #654081: comm cron: reading directory lblock 0

debian@arm:~$ [ 1072.037711] EXT4-fs error: 5 callbacks suppressed
[ 1072.037740] EXT4-fs error (device mmcblk0p1): __ext4_find_entry:1658: inode #654081: comm gmain: reading directory lblock 0
[ 1076.038454] EXT4-fs error (device mmcblk0p1): __ext4_find_entry:1658: inode #654081: comm gmain: reading directory lblock 0

U-Boot SPL 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)
Trying to boot from MMC2
mmc_load_image_raw_sector: mmc block read error
spl_register_fat_device: fat register err - -1
spl_load_image_fat: error reading image u-boot.img, err - -1
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
lilyjayd commented 1 year ago

Hello again,

I think I have found a root cause of this problem. The thing is that in the instruction we copy combined uboot and dtb file to SD card:

sudo mkdir -p /media/rootfs/opt/backup/uboot/
sudo cp -v ./u-boot/MLO /media/rootfs/opt/backup/uboot/
sudo cp -v ./u-boot/u-boot-dtb.img /media/rootfs/opt/backup/uboot/

but the script is looking for u-boot.img, not u-boot-dtb.img which we copied to SD card:

    if [ ! -f /opt/backup/uboot/u-boot.img ] ; then
        mkdir -p /opt/backup/uboot/
        wget --directory-prefix=/opt/backup/uboot/ http://rcn-ee.com/repos/bootloader/am335x_evm/${http_uboot}
        mv /opt/backup/uboot/${http_uboot} /opt/backup/uboot/u-boot.img
    fi

and since it did not find u-boot.img, it will download and install image from rcn-ee.com, as we an see in my session log:

113246208 bytes (113 MB, 108 MiB) copied, 2.85152 s, 39.7 MB/s
Erasing: /dev/mmcblk1 complete
-----------------------------
--2022-09-17 19:26:00--  http://rcn-ee.com/repos/bootloader/am335x_evm/u-boot-am335x_evm-v2019.04-r13.img
Resolving rcn-ee.com (rcn-ee.com)... 45.33.2.10, 2600:3c00::f03c:91ff:fe37:6ad5
Connecting to rcn-ee.com (rcn-ee.com)|45.33.2.10|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://rcn-ee.com/repos/bootloader/am335x_evm/u-boot-am335x_evm-v2019.04-r13.img [following]
--2022-09-17 19:26:01--  https://rcn-ee.com/repos/bootloader/am335x_evm/u-boot-am335x_evm-v2019.04-r13.img
Connecting to rcn-ee.com (rcn-ee.com)|45.33.2.10|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 474352 (463K)
Saving to: ‘/opt/backup/uboot/u-boot-am335x_evm-v2019.04-r13.img’

u-boot-am335x_evm-v 100%[===================>] 463.23K   512KB/s    in 0.9s

2022-09-17 19:26:02 (512 KB/s) - ‘/opt/backup/uboot/u-boot-am335x_evm-v2019.04-r13.img’ saved [474352/474352]

Writing bootloader to [/dev/mmcblk1]
dd if=/opt/backup/uboot/MLO of=/dev/mmcblk1 count=1 seek=1 bs=128k

which will ultimately end up in having my own MLO flashed with some u-boot-am335x_evm-v2019.04-r13.img instead of my u-boot-dtb.img. When I flashed manually my original MLO and u-boot-dtb.img, my target boots correctly from eMMC.

I can fix that problem in the script if that's ok for you. This can be also fixed by changing the instruction to:

sudo cp -v ./u-boot/u-boot-dtb.img /media/rootfs/opt/backup/uboot/u-boot.img

Please let me know which option you prefer :)

lilyjayd commented 1 year ago

Unfortunately, when I changed filename:

/opt/backup/uboot/u-boot-dtb.img -> /opt/backup/uboot/u-boot.img

and run bbb-eMMC-flasher-eewiki-ext4.sh again, target still can't be booted properly, with a different message this time:

U-Boot SPL 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)
Trying to boot from MMC2

Logs from the flashing with script below:

debian@arm:~$ sudo /bin/bash ./bbb-eMMC-flasher-eewiki-ext4.sh
-----------------------------
Version: [1.20200709: Fix v5.4.x eeprom read...]
-----------------------------
copying: [/dev/mmcblk0] -> [/dev/mmcblk1]
lsblk:
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0 14.5G  0 disk
└─mmcblk0p1  179:1    0 14.5G  0 part /
mmcblk1      179:256  0  3.6G  0 disk
└─mmcblk1p1  179:257  0  3.6G  0 part
mmcblk1boot0 179:512  0    2M  1 disk
mmcblk1boot1 179:768  0    2M  1 disk
-----------------------------
df -h | grep rootfs:
-----------------------------
update-initramfs: Generating /boot/initrd.img-5.15.65-bone28
Erasing: /dev/mmcblk1
108+0 records in
108+0 records out
113246208 bytes (113 MB, 108 MiB) copied, 10.4449 s, 10.8 MB/s
108+0 records in
108+0 records out
113246208 bytes (113 MB, 108 MiB) copied, 2.81274 s, 40.3 MB/s
Erasing: /dev/mmcblk1 complete
-----------------------------
Writing bootloader to [/dev/mmcblk1]
dd if=/opt/backup/uboot/MLO of=/dev/mmcblk1 count=1 seek=1 bs=128k
-----------------------------
0+1 records in
0+1 records out
106400 bytes (106 kB, 104 KiB) copied, 0.0132925 s, 8.0 MB/s
-----------------------------
dd if=/opt/backup/uboot/u-boot.img of=/dev/mmcblk1 count=2 seek=1 bs=384k
-----------------------------
2+0 records in
2+0 records out
786432 bytes (786 kB, 768 KiB) copied, 0.0787425 s, 10.0 MB/s
-----------------------------
Formatting: /dev/mmcblk1
sfdisk: [2.26.x or greater]
sfdisk: [sfdisk from util-linux 2.36.1]
sfdisk: [sfdisk --force /dev/mmcblk1]
sfdisk: [4M,,L,*]
Checking that no-one is using this disk right now ... OK

Disk /dev/mmcblk1: 3.6 GiB, 3867148288 bytes, 7553024 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 0xbbfd1b2a.
/dev/mmcblk1p1: Created a new partition 1 of type 'Linux' and of size 3.6 GiB.
/dev/mmcblk1p2: Done.

New situation:
Disklabel type: dos
Disk identifier: 0xbbfd1b2a

Device         Boot Start     End Sectors  Size Id Type
/dev/mmcblk1p1 *     8192 7553023 7544832  3.6G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.[  892.838821]  mmcblk1: p1

Syncing disks.
mkfs.ext4  /dev/mmcblk1p1 -L BEAGLEBONE
-----------------------------
mke2fs 1.46.2 (28-Feb-2021)
Discarding device blocks: done
Creating filesystem with 943104 4k blocks and 236176 inodes
Filesystem UUID: 08731777-64bc-4355-9979-096138b1d314
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: /dev/mmcblk1 complete
-----------------------------
Copying: /dev/mmcblk0p1 -> /dev/mmcblk1p1
[  904.861620] EXT4-fs (mmcblk1p1): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
rsync: / -> /tmp/rootfs/
[  911.673850] musb-hdrc musb-hdrc.1: VBUS_ERROR in a_wait_vrise (88, <AValid), retry #3, port1 0008010c
Copying: Kernel modules
rsync: /lib/modules/5.15.65-bone28/ -> /tmp/rootfs/lib/modules/5.15.65-bone28/
Copying: /dev/mmcblk0p1 -> /dev/mmcblk1p1 complete
-----------------------------
Final System Tweaks:
UUID=08731777-64bc-4355-9979-096138b1d314
Generating: /etc/fstab
# /etc/fstab: static file system information.
#
UUID=08731777-64bc-4355-9979-096138b1d314  /  ext4  noatime,errors=remount-ro  0  1
debugfs  /sys/kernel/debug  debugfs  defaults  0  0
-----------------------------
Syncing: /dev/mmcblk1
100000+0 records in
100000+0 records out
51200000 bytes (51 MB, 49 MiB) copied, 1.50836 s, 33.9 MB/s
Syncing: /dev/mmcblk1 complete
-----------------------------
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=221716k,nr_inodes=55429,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=50044k,mode=755)
/dev/mmcblk0p1 on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=15390)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=50040k,nr_inodes=12510,mode=700,uid=1000,gid=1000)
eMMC has been flashed:
-----------------------------
debian@arm:~$ sync
debian@arm:~$ shutdown
Failed to set wall message, ignoring: Interactive authentication required.
Failed to call ScheduleShutdown in logind, no action will be taken: Interactive authentication required.
debian@arm:~$ sudo shutdown
Shutdown scheduled for Sat 2022-09-17 23:36:27 UTC, use 'shutdown -c' to cancel.
debian@arm:~$ date
Sat Sep 17 23:36:25 UTC 2022
debian@arm:~$          Stopping Session 1 of user debian.
[  OK  ] Removed slice system-modprobe.slice.
[  OK  ] Stopped target Graphical Interface.
[  OK  ] Stopped target Multi-User System.
[  OK  ] Stopped target Login Prompts.
[  OK  ] Stopped target Sound Card.
[  OK  ] Stopped target Timers.
[  OK  ] Stopped Periodic ext4 Onli…ata Check for All Filesystems.
[  OK  ] Stopped Discard unused blocks once a week.
[  OK  ] Stopped Daily rotation of log files.
[  OK  ] Stopped Daily Cleanup of Temporary Directories.
[  OK  ] Stopped target System Time Synchronized.
[  OK  ] Stopped target System Time Set.
[  OK  ] Stopped target Hardware activated USB gadget.
[  OK  ] Closed Load/Save RF Kill Switch Status /dev/rfkill Watch.
         Stopping Modem Manager...
         Stopping Avahi mDNS/DNS-SD Stack...
         Stopping Regular background program processing daemon...
         Stopping Getty on tty1...
         Stopping A high performanc… and a reverse proxy server...
         Stopping System Logging Service...
         Stopping Serial Getty on ttyS0...
         Stopping OpenBSD Secure Shell server...
         Stopping Load/Save Random Seed...
[  OK  ] Stopped Avahi mDNS/DNS-SD Stack.
[  OK  ] Stopped Regular background program processing daemon.
[  OK  ] Stopped System Logging Service.
[  OK  ] Stopped Modem Manager.
[  OK  ] Stopped Getty on tty1.
[  OK  ] Stopped Serial Getty on ttyS0.
[  OK  ] Stopped OpenBSD Secure Shell server.
[  OK  ] Stopped Load/Save Random Seed.
[  OK  ] Stopped A high performance…er and a reverse proxy server.
[  OK  ] Stopped Session 1 of user debian.
[  OK  ] Removed slice system-getty.slice.
[  OK  ] Removed slice system-serial\x2dgetty.slice.
         Stopping Authorization Manager...
         Stopping User Login Management...
         Stopping User Manager for UID 1000...
[  OK  ] Stopped Authorization Manager.
[  OK  ] Stopped User Manager for UID 1000.
         Stopping User Runtime Directory /run/user/1000...
[  OK  ] Stopped User Login Management.
[  OK  ] Unmounted /run/user/1000.
[  OK  ] Reached target Unmount All Filesystems.
[  OK  ] Stopped User Runtime Directory /run/user/1000.
[  OK  ] Removed slice User Slice of UID 1000.
         Stopping Permit User Sessions...
[  OK  ] Stopped Permit User Sessions.
[  OK  ] Stopped target Network.
[  OK  ] Stopped target Remote File Systems.
         Stopping Network Manager...
         Stopping Raise network interfaces...
         Stopping WPA supplicant...
[  OK  ] Stopped WPA supplicant.
[  OK  ] Stopped Network Manager.
         Stopping D-Bus System Message Bus...
[  OK  ] Stopped D-Bus System Message Bus.
[  OK  ] Stopped target Basic System.
[  OK  ] Stopped target Paths.
[  OK  ] Stopped target Slices.
[  OK  ] Removed slice User and Session Slice.
[  OK  ] Stopped target Sockets.
[  OK  ] Closed Avahi mDNS/DNS-SD Stack Activation Socket.
[  OK  ] Closed D-Bus System Message Bus Socket.
[  OK  ] Stopped target System Initialization.
[  OK  ] Stopped target Local Encrypted Volumes.
[  OK  ] Stopped Dispatch Password …ts to Console Directory Watch.
[  OK  ] Stopped Forward Password R…uests to Wall Directory Watch.
[  OK  ] Stopped target Swap.
[  OK  ] Closed Syslog Socket.
         Stopping Restore / save the current clock...
         Stopping Network Time Synchronization...
         Stopping Update UTMP about System Boot/Shutdown...
[  OK  ] Stopped Network Time Synchronization.
[  OK  ] Stopped Restore / save the current clock.
[  OK  ] Stopped Update UTMP about System Boot/Shutdown.
[  OK  ] Stopped Create Volatile Files and Directories.
[  OK  ] Stopped Raise network interfaces.
[  OK  ] Stopped target Local File Systems.
[  OK  ] Stopped target Local File Systems (Pre).
[  OK  ] Stopped Apply Kernel Variables.
[  OK  ] Stopped Load Kernel Modules.
[  OK  ] Stopped Create Static Device Nodes in /dev.
[  OK  ] Stopped Create System Users.
[  OK  ] Stopped Remount Root and Kernel File Systems.
[  OK  ] Reached target Shutdown.
[  OK  ] Reached target Final Step.
[  OK  ] Finished Power-Off.
[  OK  ] Reached target Power-Off.
[ 1194.684832] systemd-shutdown[1]: Syncing filesystems and block devices.
[ 1201.797902] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[ 1201.820415] systemd-journald[221]: Received SIGTERM from PID 1 (systemd-shutdow).
[ 1203.729289] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[ 1203.780209] systemd-shutdown[1]: Unmounting file systems.
[ 1203.799811] [2316]: Remounting '/' read-only in with options 'errors=remount-ro'.
[ 1204.816047] EXT4-fs (mmcblk0p1): re-mounted. Opts: errors=remount-ro. Quota mode: none.
[ 1204.855634] systemd-shutdown[1]: All filesystems unmounted.
[ 1204.861456] systemd-shutdown[1]: Deactivating swaps.
[ 1204.866863] systemd-shutdown[1]: All swaps deactivated.
[ 1204.872239] systemd-shutdown[1]: Detaching loop devices.
[ 1204.878442] systemd-shutdown[1]: All loop devices detached.
[ 1204.884195] systemd-shutdown[1]: Stopping MD devices.
[ 1204.889885] systemd-shutdown[1]: All MD devices stopped.
[ 1204.895343] systemd-shutdown[1]: Detaching DM devices.
[ 1204.901055] systemd-shutdown[1]: All DM devices detached.
[ 1204.906577] systemd-shutdown[1]: All filesystems, swaps, loop devices, MD devices and DM devices detached.
[ 1204.925003] systemd-shutdown[1]: Syncing filesystems and block devices.
[ 1204.934414] systemd-shutdown[1]: Powering off.
[ 1204.968878] reboot: Power down

U-Boot SPL 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)
Trying to boot from MMC2

U-Boot SPL 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)
Trying to boot from MMC2

U-Boot SPL 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)
Trying to boot from MMC2

U-Boot SPL 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)
Trying to boot from MMC2

U-Boot SPL 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)
Trying to boot from MMC2

I pressed reset button couple of times. So to sum up, I have MLO and u-boot.img (which is renamed u-boot-dtb.img) in /opt/backup/uboot/ directory on a software booted from SD card. When I manually install this new u-boot via:

sudo dd if=MLO of=${DISK} count=2 seek=1 bs=128k
sudo dd if=u-boot.img of=${DISK} count=4 seek=1 bs=384k

(I do not install rootfs) then it is working fine - BBB is booted and looking for sources to boot:

U-Boot SPL 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)
Trying to boot from MMC2

U-Boot 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM:  512 MiB
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
Core:  150 devices, 14 uclasses, devicetree: separate
WDT:   Started wdt@44e35000 with servicing (60s timeout)
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
BeagleBone Cape EEPROM: no EEPROM at address: 0x54
BeagleBone Cape EEPROM: no EEPROM at address: 0x55
BeagleBone Cape EEPROM: no EEPROM at address: 0x56
BeagleBone Cape EEPROM: no EEPROM at address: 0x57
Net:   Could not get PHY for ethernet@4a100000: addr 0
eth2: ethernet@4a100000, eth3: usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[A335BNLT] ...
board_rev=[000C] ...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc1(part 0) is current device
** No partition table - mmc 1 **
Couldn't find partition mmc 1:1
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc1(part 0) is current device
gpio: pin 54 (gpio 54) value is 1
** No partition table - mmc 1 **
Couldn't find partition mmc 1:1
Checking for: /uEnv.txt ...
** No partition table - mmc 1 **
Couldn't find partition mmc 1:1
Checking for: /boot/uEnv.txt ...
** No partition table - mmc 1 **
Couldn't find partition mmc 1:1
** No partition table - mmc 1 **
Couldn't find partition mmc 1:2
** No partition table - mmc 1 **
Couldn't find partition mmc 1:3
** No partition table - mmc 1 **
Couldn't find partition mmc 1:4
** No partition table - mmc 1 **
Couldn't find partition mmc 1:5
** No partition table - mmc 1 **
Couldn't find partition mmc 1:6
** No partition table - mmc 1 **
Couldn't find partition mmc 1:7
starting USB...
Bus usb@47401800: Port not available.
USB is stopped. Please issue 'usb start' first.
starting USB...
Bus usb@47401800: Port not available.
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
musb-hdrc: peripheral reset irq lost!
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5

but when I run the script which I believe installs the same MLO and u-boot.img (plus rootfs), then this is not working and ends up with u-boot hangs at:

U-Boot SPL 2022.04-00037-ge0d31da5 (Sep 16 2022 - 11:02:51 +0200)
Trying to boot from MMC2
RobertCNelson commented 1 year ago

Hi @lilyjayd sorry about this, with bullseye, i've rewritten the eMMC flasher to be more modular, i really need to go back on buster and remove all the old scripts..

The debian package is "bb-beagle-flasher"

sudo apt update ; sudo apt install bb-beagle-flasher

pushed out to buster, bullseye, focal, and jammy..

The main script is:

https://github.com/rcn-ee/repos/blob/master/bb-beagle-flasher/suite/bullseye/debian/beagle-flasher

to configure for your board, you copy one of the config files to:

/etc/default/beagle-flasher

BBB: microSD -> eMMC

BBB: eMMC -> microSD

BBAI: microSD -> eMMC

BBAI: eMMC -> microSD

sudo cp -v /etc/beagle-flasher/beaglebone-black-microsd-to-emmc /etc/default/beagle-flasher

https://github.com/rcn-ee/repos/blob/master/bb-beagle-flasher/suite/bullseye/debian/beaglebone-black-microsd-to-emmc

For the BBB it'll pull in the u-boot here:

bootloader=/opt/u-boot/bb-u-boot-am335x-evm/install-mmcblk1.sh

https://github.com/rcn-ee/repos/blob/master/bb-u-boot-am335x-evm-debian-11-ubuntu-2004-2204/suite/bullseye/debian/install-mmcblk1.sh

From debian userspace then just run:

sudo beagle-flasher

Regards,

lilyjayd commented 1 year ago

Thanks @RobertCNelson. It went smooth with default MLO and u-boot-dtb.img from package you've mentioned:

INFO: [/bin/bash /opt/u-boot/bb-u-boot-am335x-evm/install-mmcblk1.sh]
dd if=/opt/u-boot/bb-u-boot-am335x-evm/MLO of=/dev/mmcblk1 count=2 seek=1 bs=128k
0+1 records in
0+1 records out
106028 bytes (106 kB, 104 KiB) copied, 0.0133077 s, 8.0 MB/s
dd if=/opt/u-boot/bb-u-boot-am335x-evm/u-boot-dtb.img of=/dev/mmcblk1 count=4 seek=1 bs=384k
2+1 records in
2+1 records out
987236 bytes (987 kB, 964 KiB) copied, 0.10033 s, 9.8 MB/s

U-Boot SPL 2022.04-gd0771d53 (Jul 21 2022 - 02:13:23 +0000)
Trying to boot from MMC2

U-Boot 2022.04-gd0771d53 (Jul 21 2022 - 02:13:23 +0000)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM:  512 MiB
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
Core:  150 devices, 14 uclasses, devicetree: separate
WDT:   Started wdt@44e35000 with servicing (60s timeout)
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
[...]

Tomorrow I'll try with my own MLO and uboot image. And by the way, do you perhaps have some helper tools or instructions with modern approach for doing kernel + rootfs over tftp on BBB? Years ago I was doing that with dnsmasq and nfs version 2, but things changed a little bit since then, so maybe there's a better way now.