gociii / odroid-images

Linux Debian minimal (no GUI) images built with up-to-date kernels primarily for the odroid-u3 & odroid-u3+ SBCs
2 stars 0 forks source link

how to flash to emmc without an TF card adapter #2

Open dsir-minute opened 1 year ago

dsir-minute commented 1 year ago

hi maintainer, sorry to use this tool to ask you the burning question but I'm desparate looking for a tuto on how to flash dietpi on an emmc which is adirectly attached to my odroid U3+ ? thans in advance. CHeers.

gociii commented 1 year ago

@dsir-minute how about https://ameridroid.com/blogs/ameriblogs/writing-an-image-to-your-emmc ? Is this any good?

dsir-minute commented 1 year ago

hi, in your URL, only this sections is relevant for my situation image and it suggest to use petitboot , I think it works for not all odroic boards, mine is U3+

gociii commented 1 year ago

@dsir-minute am afraid I haven't used eMMC in this way and not sure on the steps 100% - However the following steps may be needed to achieve this:

  1. Download the image you want to flash onto your Odroid.
  2. Connect your Odroid to your computer using a USB cable.
  3. Power on the Odroid.
  4. On your computer, open a terminal window and enter the following command to determine the device name of the eMMC: lsblk This should list all the connected storage devices. Look for the device name of the eMMC, which should be something like "/dev/mmcblkX".
  5. Download and install the 'dd' tool on your computer to write the image to the eMMC. You can install it by running the following command: sudo apt-get install coreutils
  6. Unmount the eMMC by running the following command: bash sudo umount /dev/mmcblkX Make sure to replace "X" with the correct device number.
  7. Write the image to the eMMC by running the following command: bash sudo dd if=path/to/image of=/dev/mmcblkX bs=1M conv=sync Make sure to replace "path/to/image" with the actual path to the image you downloaded, and "X" with the correct device number.
  8. Wait for the write process to complete. This may take several minutes.
  9. Once the write process is complete, reboot the Odroid and it should boot from the eMMC with the flashed image.

Again, not sure if this is actually possible, as you mention odroid-u3 is rather an old board and probably doesn't support this method... may require some further researching on the internet...

dsir-minute commented 1 year ago

I am able to boot dietpi from a microsd card with emmc remived. Then i am also able to flash the emmc using dd after i plug it in. Then i shutdown the board, remove the sdcard, and try to boot from the emmc but it silentrly fails. The best thing i ve found is https://odroid.com/dokuwiki/doku.php?id=en:emmc_recovery_u3 , do you have an u3 board you can use to test ? Thks.

dsir-minute commented 1 year ago

The special recovery image before does some obscur magic to write some binary to the emmc boot sector, i d like to be able to do the same from dietpi. Do you know how extract the binary files and the script from their image ?

dsir-minute commented 1 year ago

hi, I extracted the image before, and it contains a few binaries and scripts, as expected here are the scripts.. boot.ini.txt sd_fusing.sh.txt

dsir-minute commented 1 year ago

(i had to add un-needed .txt extension to get github happier)

dsir-minute commented 1 year ago

image

dsir-minute commented 1 year ago

I'll try to apply the process as is 1st (flash the image on SD card , boot from it, and expect some magic will happen)

dsir-minute commented 1 year ago

this guy seems to have figured out how to do... https://haokof.blogspot.com/2017/03/odroid-u3-and-emmc-memory.html

dsir-minute commented 1 year ago

sorry to report a bad news : the process to boot the special sdcard fails to make bootable dietpi emmc

prahal commented 5 months ago

I would split the write image to emmc "user" partition from the boot partition update. The emmc should have a working u-boot from factory. Note the script sd_fuse.sh.txt you shared had offset for SD, not EMMC (ie u-boot is at offset 62 not 63 for EMMC see https://haokof.blogspot.com/2017/03/odroid-u3-and-emmc-memory.html). You have to tweak the sd_fuse script before running it. I believe the emmc_recovery does not make use of the sd_fuse script. The emmc boot partition update is made from U-Boot itself via boot.ini.

Here is a boot script from hardkernel https://github.com/hardkernel/u-boot.git odroid-v2010.12 which can be run from a linux SD image to update the emmc (you still have to boot without the emmc plugged to boot from SD I believe, then you insert the emmc afterward): sd_fusing.sh.txt

The script echo 0 > /sys/block/${1##*/}boot0/force_ro to let write to the emmc boot partition. And if it detect such a partition it uses the correct offset for emmc.

So either just write the distribution image to the emmc to keep the existing u-boot and write the system. Or write the emmc_recovery image to an SD card (you can optionally replace its u-boot.bin on the SD update/ folder to write the u-boot you want, the other files are signed and never need upgrades afaik). Or boot from an SD install on the odroid, then insert the emmc and run the sd_fusing script I gave you downloaded on it.

I am able to boot dietpi from a microsd card with emmc remived. Then i am also able to flash the emmc using dd after i plug it in. Then i shutdown the board, remove the sdcard, and try to boot from the emmc but it silently fails.

Why do you mean by silently fail? Do you have a serial console with U-boot then "Starting kernel..." and nothing after? No messages from U-boot (unlikely else I believe there is no u-boot at the location the CPU expects it)?