# Boot from eMMC on Coral dev board

**URL:** <https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256>\
**Category:** General Discussions\
**Created:** [April 7, 2020, 12:50pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256 "2020-04-07T12:50:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruben](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ruben/32/565_2.png) [@ruben](https://hub.mender.io/u/ruben)\
**Post date:** [April 7, 2020, 12:50pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/1 "2020-04-07T12:50:00Z")

</div>

Hi @mirzak,

great work!

Do you have an idea what needs to be changed to support booting from mmc?

Best regards  
Ruben

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [April 7, 2020, 1:03pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/2 "2020-04-07T13:03:12Z")

</div>

It might be as easy as adjusting,

```auto
MENDER_STORAGE_DEVICE = "/dev/mmcblk1"

```

to

```auto
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.

---

<div class="post-metadata">

**Author:** ![ruben](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ruben/32/565_2.png) [@ruben](https://hub.mender.io/u/ruben)\
**Post date:** [April 7, 2020, 1:20pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/3 "2020-04-07T13:20:34Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Namburger](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/namburger/32/567_2.png) [@Namburger](https://hub.mender.io/u/Namburger)\
**Post date:** [April 7, 2020, 2:06pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/4 "2020-04-07T14:06:11Z")

</div>

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):

1. Connect your dev board to your machine with the serial cable and the USB-A to C cable.
2. Boot up the board and press any key to put the board on u-boot prompt
3. 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.

```auto
U-Boot# ums 0 mmc 0

```

1. Make sure to check `fdisk -l` to get the correct usb device from the dev board (mine was /dev/sda).
2. **Important:** back up the current MendelOS image so you won’t lose it:

```auto
$ sudo if=/dev/sda of=mendel_backup.img bs=4M status=progress

```

1. Copy the mender disk image to the emmc

```auto
$ 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.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [April 7, 2020, 2:15pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/5 "2020-04-07T14:15:34Z")

</div>

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](https://coral.ai/docs/dev-board/reflash/#flash-from-u-boot-on-an-sd-card)

I will try to play around with the eMMC a bit and will update the instructions once done.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [April 7, 2020, 2:16pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/6 "2020-04-07T14:16:57Z")

</div>

> [@Namburger](#):
>
> the `.mender` file?

This is the update Artifact, and normally only contains a rootfs image. So this is something that you would deploy using a Mender server.

---

<div class="post-metadata">

**Author:** ![Namburger](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/namburger/32/567_2.png) [@Namburger](https://hub.mender.io/u/Namburger)\
**Post date:** [April 7, 2020, 2:24pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/7 "2020-04-07T14:24:51Z")

</div>

Yes, you can always use the recovery image [here](https://coral.ai/docs/dev-board/reflash/#flash-from-u-boot-on-an-sd-card) 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 🙃

---

<div class="post-metadata">

**Author:** ![ruben](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ruben/32/565_2.png) [@ruben](https://hub.mender.io/u/ruben)\
**Post date:** [April 8, 2020, 8:16am UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/8 "2020-04-08T08:16:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ruben](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ruben/32/565_2.png) [@ruben](https://hub.mender.io/u/ruben)\
**Post date:** [April 8, 2020, 11:07am UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/9 "2020-04-08T11:07:01Z")

</div>

New results:

- I flashed the new image with following change to sd

> 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?

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [April 8, 2020, 11:50am UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/10 "2020-04-08T11:50:21Z")

</div>

> [@ruben](#):
>
> 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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [April 8, 2020, 11:51am UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/11 "2020-04-08T11:51:36Z")

</div>

You can also take a look at [Toradex Colibri iMX7 Dual 1GB](https://hub.mender.io/t/toradex-colibri-imx7-dual-1gb/131) (in the Flash instructions section), I would expect something similar could work here as well.

---

<div class="post-metadata">

**Author:** ![ruben](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ruben/32/565_2.png) [@ruben](https://hub.mender.io/u/ruben)\
**Post date:** [April 8, 2020, 1:13pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/12 "2020-04-08T13:13:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [April 8, 2020, 1:36pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/13 "2020-04-08T13:36:43Z")

</div>

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:

1. Flash SD card with an bootable image, insert to board and boot it
2. Halt U-boot
3. Run `ums 0 mmc 0` in U-Boot
4. Flash `sdimg`
5. Run `fastboot 0` in U-Boot
6. Flash U-Boot by running `fastboot flash bootloader0 imx-boot`
7. Powered off the board
8. Adjusted boot switches for eMMC
9. Power on board

---

<div class="post-metadata">

**Author:** ![ruben](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ruben/32/565_2.png) [@ruben](https://hub.mender.io/u/ruben)\
**Post date:** [April 8, 2020, 3:04pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/14 "2020-04-08T15:04:25Z")

</div>

Thanks a lot for detailed explanation. I will try tonight again. Guess I made mistake with boot switches. ☹

---

<div class="post-metadata">

**Author:** ![ruben](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ruben/32/565_2.png) [@ruben](https://hub.mender.io/u/ruben)\
**Post date:** [April 8, 2020, 3:56pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/15 "2020-04-08T15:56:28Z")

</div>

@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!

---

<div class="post-metadata">

**Author:** ![Namburger](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/namburger/32/567_2.png) [@Namburger](https://hub.mender.io/u/Namburger)\
**Post date:** [April 8, 2020, 4:48pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/16 "2020-04-08T16:48:30Z")

</div>

Nice @ruben!  
Thanks @mirzak for your expertise!

---

<div class="post-metadata">

**Author:** ![JordonWu](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@JordonWu](https://hub.mender.io/u/JordonWu)\
**Post date:** [April 26, 2021, 8:40am UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/17 "2021-04-26T08:40:07Z")

</div>

Hi ruben,  
Do you have flash to emmc using uuu tool?  
Thanks

---

<div class="post-metadata">

**Author:** ![JordonWu](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@JordonWu](https://hub.mender.io/u/JordonWu)\
**Post date:** [April 26, 2021, 8:51am UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/18 "2021-04-26T08:51:46Z")

</div>

> [@mirzak](#):
>
> 1. Flash SD card with an

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

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [April 26, 2021, 12:14pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/19 "2021-04-26T12:14:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gavin67890](https://avatars.discourse-cdn.com/v4/letter/g/c37758/32.png) [@gavin67890](https://hub.mender.io/u/gavin67890)\
**Post date:** [October 21, 2023, 2:36pm UTC](https://hub.mender.io/t/boot-from-emmc-on-coral-dev-board/2256/20 "2023-10-21T14:36:35Z")

</div>

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.
