Hi @mirzak,
great work!
Do you have an idea what needs to be changed to support booting from mmc?
Best regards
Ruben
Hi @mirzak,
great work!
Do you have an idea what needs to be changed to support booting from mmc?
Best regards
Ruben
It might be as easy as adjusting,
MENDER_STORAGE_DEVICE = "/dev/mmcblk1"
to
MENDER_STORAGE_DEVICE = "/dev/mmcblk0"
Though I have not had a chance to test this yet, also the eMMC flash process somewhat convoluted if using the standard tools so it might be easier to flash the eMMC from a booted SD card.
thanks, i will try this.
youāre right, I am currently struggling with uuu tool to flash anything to the device. Without luck so far. Will investigate furtherā¦
Hi guys, Iām Nam from the coral team, @ruben reached out to me so I wanted to come collect more info
I never used mender before, but I saw that you can build this os to a .sdimg
file? I wonder if this .sdimg is anyway different than a normal OS image and whatās the difference between this and the .mender
file? Here something that may works (do this at your own risk):
ums 0 mmc 0
, this will mount the emmc on the board as a usb device on your host machine.U-Boot# ums 0 mmc 0
fdisk -l
to get the correct usb device from the dev board (mine was /dev/sda).$ sudo if=/dev/sda of=mendel_backup.img bs=4M status=progress
$ sudo dd if=path-to-mender-img of=/dev/sda bs=4M status=progress
It is advice to be very careful here because you can wipe out the wrong drive with the āofā parameter
That should be it, at least this works for backup the MendelOS image.
Although Iām a little nervous about giving this solution, because Iām not sure if the sdcard image will work with emmc. You may ends up not being able to boot to emmc at all after transferring that image over.
Hi @Namburger, thank you for following up.
The .sdimg
file is an ordinary OS image with some extra partitions due to Mender requirements (A/B structure). So this is something that you would write to e.g the SD card using similar dd
commands as you mention.
On the u-boot prompt, enter
ums 0 mmc 0
, this will mount the emmc on the board as a usb device on your host machine.
The ums
approach is pretty nice and have used it on several other boards.
You may ends up not being able to boot to emmc at all after transferring that image over.
But it should be possible to restore the eMMC, right? I have not looked at it yet, but at least you could boot an SD card to flash eMMC and it seems like this is something that is recommend as well in coral.ai docs
I will try to play around with the eMMC a bit and will update the instructions once done.
This is the update Artifact, and normally only contains a rootfs image. So this is something that you would deploy using a Mender server.
Yes, you can always use the recovery image here to flash into u-boot on an sdcard and then use the backup image on step 5 to restore your emmc. At least it works in theory
Hi @Namburger, hi @mirzak,
Thanks a lot for your responses!
I successfully flashed my image with the u-boot
ums 0 mmc 0
approach. I didnāt know this, pretty nice!
But after flashing and changing the boot switches to mmc nothing boots. No output on serial console.
Will investigate more on bootloader changes, perhaps wrong partition in bootloader config.
New results:
MENDER_STORAGE_DEVICE = ā/dev/mmcblk0ā
I checked the u-boot variable on old and new image and the changes affected the mmc location ā perfect!
I booted kernel and it uses the previously flashed image from mmc, not sd.
So the problem seems to be that after flashing to mmc spl loader is not found or in wrong place. Do you have any idea how this could happen?
I suspect that the bootloader is stored in the hardware boot partition on eMMC while this is not the case for SD.
Could you try writing the bootloader in a separate step running the following command on your PC:
fastboot flash bootloader0 u-boot.imx
Above is what is executed by the flash.sh
script provided by Coral for Mendel OS flashing.
The u-boot.imx
is called imx-boot
in Yocto deploy directory. Note that you need to start fastboot
in U-Boot for this to work.
This can probably be accomplished using mmc write
command in U-Boot as well, but would need to experiment with it to understand the offsets.
You can also take a look at Toradex Colibri iMX7 Dual 1GB (in the Flash instructions section), I would expect something similar could work here as well.
I flashed with both ways, fastboot and mmc write like toradex. Both didnāt work.
Now I will double-check all my steps and checking the boot mode settings again.
Next step would be to flash mendel os again and then only exchange imx-boot
Did a quick test on my board and it succeeded booting from eMMC, after I used fastboot
to flash U-Boot.
So the steps that worked for me are:
ums 0 mmc 0
in U-Bootsdimg
fastboot 0
in U-Bootfastboot flash bootloader0 imx-boot
Thanks a lot for detailed explanation. I will try tonight again. Guess I made mistake with boot switches.
@mirzak now it is working! Thanks a lot for your help.
After flashing bootloader0 the first time i forgot to adjust the boot switches correctly.
Also thanks @Namburger for your help!
Hi ruben,
Do you have flash to emmc using uuu tool?
Thanks
Hi @mirzak ,
Does it possible flash imx-boot-coral-dev-sd.bin-flash_evk to eMMC using uuu tool(NXP has provide uuu tool to flash image to board) directly?
Thanks
Jordon Wu
Hi @JordonWu it seems that you use Android fastboot primarily to flash this board. Iāve never actually used this board so perhaps someone with more experience will confirm or correct me on this.
Drew
Hi @mirzak,
I tried
fastboot flash bootloader0 u-boot.imx
But I got the following line, although it did appear to complete successfully.
request 00000000ff95db00 was not queued to ep1in-bulk
Any thought what this relates to and should I be worried?
PS Could anyone share their āenv printā from U-Boot for Coral Dev Board please.