How to flash the actual content of SD card (no new image) to eMMC?

Hi there,

so far I have been booting my BBB from SD card.
Now I would like to copy the whole content of the SD card to eMMC, and let the board boot and run from there.
I don’t want to flash a new image, I just want to use the same data I used before from SD card, because I installed a lot of programs additionally to the clean image.
How can I achieve that?

Also, I have a Python app that starts automatically with boot and stores a log file.
How can achieve that the log file will be written onto SD card instead of eMMC?

Thanks in advance.

Hi @Steve12 it’s really the same flashing tool, which helps move between microSD and eMMC…

What image are you currently using?

Please report:

cat /etc/dogtag

Newer images have easier tools to do it…

For you python app, configure it use a directory mounted where the new microSD would be mounted…

Regards,

@RobertCNelson , thanky for the info.
Can you please elaborate what exactly should I do to flash the data to eMMC?

Dogtag returns:

BeagleBoard.org Debian Bullseye Minimal Image 2023-03-10

@Steve12 okay, that has all the new stuff…

First make sure bb-beagle-flasher is up to date…

sudo apt update
sudo apt install --only-upgrade bb-beagle-flasher

Next, configure it for microSD → eMMC via:

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

Now, run the ‘flasher’ copy script:

sudo beagle-flasher

it’ll format the eMMC and copy the microSD via rsync logging all data to the console.

Once it completes, just shutdown and verify by removing the microSD… On first-boot-up the ssh keys will be regenerated, so ssh will take a moment…

Regards,

Hi @RobertCNelson ,
I did everything you listed.
Then, after starting beagle-flasher, this is what I got:

--------------------------------------------------------------------------------
Version: [1.20221010.1, rsync add -H option for hardlinks, final image running out of space...]
--------------------------------------------------------------------------------
cat /etc/default/beagle-flasher:
--------------------------------------------------------------------------------
#debug_over_display=tty0
source=/dev/mmcblk0
destination=/dev/mmcblk1
rfs_partition=single
rfs_rootfs_type=ext4
rfs_rootfs_startmb=4
bootloader=/opt/u-boot/bb-u-boot-am335x-evm/install-mmcblk1.sh
flash_back=beaglebone-black-emmc-to-microsd
--------------------------------------------------------------------------------
INFO: Preparing sysctl
INFO: [sysctl: vm.min_free_kbytes=[2793]
INFO: [sysctl: setting: [sysctl -w vm.min_free_kbytes=16384]
vm.min_free_kbytes = 16384
--------------------------------------------------------------------------------
INFO: [lsblk -i]
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0     179:0    0  3.8G  0 disk
`-mmcblk0p1 179:1    0  3.7G  0 part /
--------------------------------------------------------------------------------
INFO: copying [/dev/mmcblk0] -> [/dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: [source=/dev/mmcblk0] is a valid block device
ERROR: [destination=/dev/mmcblk1] does not exist
--------------------------------------------------------------------------------
Example: /etc/default/beagle-flasher
--------------------------------------------------------------------------------
source=/dev/mmcblk0
destination=/dev/mmcblk1
rfs_partition=single
rfs_rootfs_type=ext4
rfs_rootfs_startmb=4
bootloader=/opt/u-boot/bb-u-boot-am335x-evm/install-mmcblk1.sh
flash_back=beaglebone-black-emmc-to-microsd
--------------------------------------------------------------------------------
debian@BeagleBone:~$

I admit I have deleted first blocks from eMMC in order to run the system always from SD card, without the need to press boot button at each boot.

What should I do now?

So it’s only seeing one drive… Are you running from the eMMC right now with the microSD NOT plugged in?

Regards,

No, currently I’m running from SD card, at least I think so :thinking:

If I remove the SD card from slot, the LEDs do not light up at all.

What does the output of [sudo beagle-version] report? wondering if eMMC is disabled for some reason…

Regards,

This is beagle-version output:

eeprom:[A335BNLT00C01020BBBK2091]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Bullseye Minimal Image 2023-03-10]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot SPL 2022.04-gd0771d53 (Jul 21 2022 - 02:13:23 +0000)]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
kernel:[5.10.168-ti-r61]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[disable_uboot_overlay_emmc=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[disable_uboot_overlay_audio=1]
uboot_overlay_options:[disable_uboot_overlay_wireless=1]
uboot_overlay_options:[disable_uboot_overlay_adc=1]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20210821.0-0~bullseye+20210821]
pkg:[bb-customizations]:[1.20221108.0-0~bullseye+20221108]
pkg:[bb-usb-gadgets]:[1.20230414.0-0~bullseye+20230414]
pkg:[bb-wl18xx-firmware]:[1.20230414.0-0~bullseye+20230414]
pkg:[kmod]:[28-1]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
pkg:[firmware-ti-connectivity]:[20210315-3]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal input netdev bluetooth gpio admin i2c tisdk weston-launch cloud9ide]
cmdline:[console=ttyS0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[   10.971550] remoteproc remoteproc0: wkup_m3 is available
[   37.587353] remoteproc remoteproc0: powering up wkup_m3
[   37.587390] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
[   37.590069] remoteproc remoteproc0: remote processor wkup_m3 is now up
[   62.115360] remoteproc remoteproc1: 4a334000.pru is available
[   62.131446] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[   62.115360] remoteproc remoteproc1: 4a334000.pru is available
[   62.131446] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pinctrl-single
[   10.472616] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[   10.474393] gpio-of-helper ocp:cape-universal: Failed to get gpio property of 'P8_03'
[   10.474426] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
[   11.153752] gpio-of-helper ocp:cape-universal: Allocated GPIO id=0 name='P8_03'
[   11.153992] gpio-of-helper ocp:cape-universal: Allocated GPIO id=1 name='P8_04'
[   11.154172] gpio-of-helper ocp:cape-universal: Allocated GPIO id=2 name='P8_05'
[   11.154339] gpio-of-helper ocp:cape-universal: Allocated GPIO id=3 name='P8_06'
[   11.154807] gpio-of-helper ocp:cape-universal: Allocated GPIO id=4 name='P8_07'
[   11.154986] gpio-of-helper ocp:cape-universal: Allocated GPIO id=5 name='P8_08'
[   11.155297] gpio-of-helper ocp:cape-universal: Allocated GPIO id=6 name='P8_09'
[   11.155491] gpio-of-helper ocp:cape-universal: Allocated GPIO id=7 name='P8_10'
[   11.155687] gpio-of-helper ocp:cape-universal: Allocated GPIO id=8 name='P8_11'
[   11.155880] gpio-of-helper ocp:cape-universal: Allocated GPIO id=9 name='P8_12'
[   11.156132] gpio-of-helper ocp:cape-universal: Allocated GPIO id=10 name='P8_13'
[   11.156318] gpio-of-helper ocp:cape-universal: Allocated GPIO id=11 name='P8_14'
[   11.156495] gpio-of-helper ocp:cape-universal: Allocated GPIO id=12 name='P8_15'
[   11.156667] gpio-of-helper ocp:cape-universal: Allocated GPIO id=13 name='P8_16'
[   11.156842] gpio-of-helper ocp:cape-universal: Allocated GPIO id=14 name='P8_17'
[   11.157030] gpio-of-helper ocp:cape-universal: Allocated GPIO id=15 name='P8_18'
[   11.157198] gpio-of-helper ocp:cape-universal: Allocated GPIO id=16 name='P8_19'
[   11.157390] gpio-of-helper ocp:cape-universal: Allocated GPIO id=17 name='P8_20'
[   11.157556] gpio-of-helper ocp:cape-universal: Allocated GPIO id=18 name='P8_21'
[   11.157730] gpio-of-helper ocp:cape-universal: Allocated GPIO id=19 name='P8_22'
[   11.157914] gpio-of-helper ocp:cape-universal: Allocated GPIO id=20 name='P8_23'
[   11.158078] gpio-of-helper ocp:cape-universal: Allocated GPIO id=21 name='P8_24'
[   11.158247] gpio-of-helper ocp:cape-universal: Allocated GPIO id=22 name='P8_25'
[   11.158409] gpio-of-helper ocp:cape-universal: Allocated GPIO id=23 name='P8_26'
[   11.158586] gpio-of-helper ocp:cape-universal: Allocated GPIO id=24 name='P8_27'
[   11.158764] gpio-of-helper ocp:cape-universal: Allocated GPIO id=25 name='P8_28'
[   11.158937] gpio-of-helper ocp:cape-universal: Allocated GPIO id=26 name='P8_29'
[   11.159241] gpio-of-helper ocp:cape-universal: Allocated GPIO id=27 name='P8_30'
[   11.159424] gpio-of-helper ocp:cape-universal: Allocated GPIO id=28 name='P8_31'
[   11.159619] gpio-of-helper ocp:cape-universal: Allocated GPIO id=29 name='P8_32'
[   11.159803] gpio-of-helper ocp:cape-universal: Allocated GPIO id=30 name='P8_33'
[   11.159984] gpio-of-helper ocp:cape-universal: Allocated GPIO id=31 name='P8_34'
[   11.160160] gpio-of-helper ocp:cape-universal: Allocated GPIO id=32 name='P8_35'
[   11.160331] gpio-of-helper ocp:cape-universal: Allocated GPIO id=33 name='P8_36'
[   11.160506] gpio-of-helper ocp:cape-universal: Allocated GPIO id=34 name='P8_37'
[   11.160682] gpio-of-helper ocp:cape-universal: Allocated GPIO id=35 name='P8_38'
[   11.160857] gpio-of-helper ocp:cape-universal: Allocated GPIO id=36 name='P8_39'
[   11.161033] gpio-of-helper ocp:cape-universal: Allocated GPIO id=37 name='P8_40'
[   11.161215] gpio-of-helper ocp:cape-universal: Allocated GPIO id=38 name='P8_41'
[   11.161382] gpio-of-helper ocp:cape-universal: Allocated GPIO id=39 name='P8_42'
[   11.161552] gpio-of-helper ocp:cape-universal: Allocated GPIO id=40 name='P8_43'
[   11.161725] gpio-of-helper ocp:cape-universal: Allocated GPIO id=41 name='P8_44'
[   11.161893] gpio-of-helper ocp:cape-universal: Allocated GPIO id=42 name='P8_45'
[   11.162065] gpio-of-helper ocp:cape-universal: Allocated GPIO id=43 name='P8_46'
[   11.162228] gpio-of-helper ocp:cape-universal: Allocated GPIO id=44 name='P9_11'
[   11.162430] gpio-of-helper ocp:cape-universal: Allocated GPIO id=45 name='P9_12'
[   11.162597] gpio-of-helper ocp:cape-universal: Allocated GPIO id=46 name='P9_13'
[   11.162775] gpio-of-helper ocp:cape-universal: Allocated GPIO id=47 name='P9_14'
[   11.162947] gpio-of-helper ocp:cape-universal: Allocated GPIO id=48 name='P9_15'
[   11.163219] gpio-of-helper ocp:cape-universal: Allocated GPIO id=49 name='P9_16'
[   11.163418] gpio-of-helper ocp:cape-universal: Allocated GPIO id=50 name='P9_17'
[   11.163581] gpio-of-helper ocp:cape-universal: Allocated GPIO id=51 name='P9_18'
[   11.163765] gpio-of-helper ocp:cape-universal: Allocated GPIO id=52 name='P9_19'
[   11.163940] gpio-of-helper ocp:cape-universal: Allocated GPIO id=53 name='P9_20'
[   11.164119] gpio-of-helper ocp:cape-universal: Allocated GPIO id=54 name='P9_21'
[   11.164289] gpio-of-helper ocp:cape-universal: Allocated GPIO id=55 name='P9_22'
[   11.164455] gpio-of-helper ocp:cape-universal: Allocated GPIO id=56 name='P9_23'
[   11.164637] gpio-of-helper ocp:cape-universal: Allocated GPIO id=57 name='P9_24'
[   11.165122] gpio-of-helper ocp:cape-universal: Allocated GPIO id=58 name='P9_25'
[   11.165323] gpio-of-helper ocp:cape-universal: Allocated GPIO id=59 name='P9_26'
[   11.165499] gpio-of-helper ocp:cape-universal: Allocated GPIO id=60 name='P9_27'
[   11.165696] gpio-of-helper ocp:cape-universal: Allocated GPIO id=61 name='P9_28'
[   11.165875] gpio-of-helper ocp:cape-universal: Allocated GPIO id=62 name='P9_29'
[   11.166066] gpio-of-helper ocp:cape-universal: Allocated GPIO id=63 name='P9_30'
[   11.166233] gpio-of-helper ocp:cape-universal: Allocated GPIO id=64 name='P9_31'
[   11.166423] gpio-of-helper ocp:cape-universal: Allocated GPIO id=65 name='P9_41'
[   11.166600] gpio-of-helper ocp:cape-universal: Allocated GPIO id=66 name='P9_91'
[   11.166767] gpio-of-helper ocp:cape-universal: Allocated GPIO id=67 name='P9_42'
[   11.166940] gpio-of-helper ocp:cape-universal: Allocated GPIO id=68 name='P9_92'
[   11.166950] gpio-of-helper ocp:cape-universal: ready
dmesg | grep wlcore
lsusb
Bus 001 Device 002: ID 0d8c:0014 C-Media Electronics, Inc. Audio Adapter (Unitek Y-247A)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

well that explains where you eMMC went…

Regards,

Ah, your right, I disabled eMMC because I needed the GPIOs from P8_20 to 25 for my project.

So if I want to use eMMC, then I should comment out the line
disable_uboot_overlay_emmc = 1
in uEnv.txt and do not use pins P8_20 to 25, right?

Correct, so eMMC is out… I guess we are left with usb storage for secondary media.