Trouble booting on eMMC module for Odoird UX4

I have several Odroids already running with SD cards.

I am flashing a eMMC module by hard kernel. (the same manufacturer) with Balena Etcher.
The exact same img as an sd card.

However I get this error before boot:
`U-Boot 2017.05-15377-gedb23d4 (Aug 24 2017 - 07:09:51 -0300) for ODROID-XU4

CPU: Exynos5422 @ 800 MHz
Model: Odroid XU4 based on EXYNOS5422
Board: Odroid XU4 based on EXYNOS5422
Type: xu4
DRAM: 2 GiB
MMC: EXYNOS DWMMC: 0, EXYNOS DWMMC: 1
MMC Device 0 (eMMC): 14.6 GiB
Info eMMC rst_n_func status = enabled
Card did not respond to voltage select!
mmc_init: -95, time 11
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: No ethernet found.
Press quickly ‘Enter’ twice to stop autoboot: 0
reading boot.ini
** Unable to read file boot.ini **
cfgload: no boot.ini or empty file
mmc block read, dev 0, addr 0x40008000, blk start 2047, blk cnt 16384
Bad Linux ARM zImage magic!`

This post here seems to a bit of an answer:

Please refer to this table here.
The offset for the u-boot environment depends on the u-boot version. The difference between ÂľSD and eMMC is one sector.
The third parameter in `/etc/fw_env.config´ defines the block size. Please try

CODE: SELECT ALL

/dev/mmcblk0 0x99C00 0x4000 0x100

or

CODE: SELECT ALL

/dev/mmcblk0 0xFBC00 0x4000 0x100

according to your u-boot version.

Where is /etc/fw_env.config can I implement this chance?

Can Balena?

For details I enabled support access to a device with a serial uart connection to the affected device:
32d2252ad3e2fbcad3a5da1f027d8086

I don’t know how to create a serial connection in linux but feel free to use the main container to mess around in if you need to apt install something.

That should let you see what I can see.

Thanks.

Hi Thomas,

This is known issue: https://github.com/balena-os/balena-odroid/issues/77

I added your interest in this feature and also pinged the repo maintainers to see if we have more information available at this time.

Cheers…

Hey @taclog just to let you know the above issue has now been resolved and so should be making its way into a release soon.

Thanks @chrisys

Trying to build it myself to test it now. Do you know what the release cycle is like for this kind of update?

Usually for a new device type release, it will need to go through a testing phase. Currently it looks like the 2.38.3+rev2 version is on staging, so you might be able to test against that if you don’t want to build yourself. I think the testing should happen over the next few days, so with any luck it will be in production by the end of the week or early next.

Hey @shaunmulligan,

I just tried to dig around to find any reference to 2.38.2+rev2.

I found this cool colorful little page.

Where can I find the staging version to download?
My build is nearly finished. Am I correct in assuming I can just replace the config.json and it will get added to one of my applications?

-Thomas

Hey @taclog yeah that colorful page is awesome :slight_smile: the staging version can be found at https://dashboard.balena-staging.com . But you will need to create a separate account there. That is our testing instance, so what I would do is get the image from staging and then as you said, replace the config.json with the one from your production app. Then it will automatically join that app when booted.

Hey @shaunmulligan,

I wish I had better news, I got the image, confirmed it is v2.38.3+rev2 and flashed it. The Odoird still does not boot. :frowning:

I am connecting the uart interface to confirm we are seeing the same error messages.

-Thomas

Greetings future people.
After working with the great people at Balena for a good amount of time. We got this working!

There are some instructions required that I haven’t seem Balena post anywhere yet so I will let them do that.

However, please note. We have had a mixed bag of success. The official hard kernel emmc modules fail to flash correctly and become corrupted about 50 percent of the time. I am talking about these ones.

We have had 100 percent success with these ones.

Good luck to anyone who goes down this path!

-Thomas

For future reference, just noting here the steps:

In order to boot your XU4 from eMMC you should follow these steps:

1 - Flash the BalenaOS image on a SD card

2 - Flash the BalenaOS image on the eMMC

3 - Insert both SD card and eMMC in the XU4 and set the boot switch to SD boot

4 - When the board shows online in the dashboard, ssh into the hostOS by using the webterminal feature in the dashboard

5 -In hostOS run the following commands:

echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=/dev/mmcblk1 of=/dev/mmcblk0boot0 bs=512 skip=1
sync

The second command will show a “No space left on device” error. Don’t worry about it.

6 - Power off the board, by running “shutdown -h now” in the dashboard hostOS webterminal, unplug power, extract the SD card, switch the boot switch to eMMC boot, plug power cable back in and your board should boot from eMMC now.

1 Like

Now that I have done this on a good two hundred I feel comfortable sharing my various hacks to make this faster.

Just if anyone needs to do alot of these quickly.

First, create your first Emmc with a development version of Belana OS using Florion’s method.

Second get a Uart debugging kit for the Odroid or hack one for something else to plug into the right pins.

Boot that first board on the Emmc, connect the debugging and log in as root. It is much faster to do this directly via uart because you get to see the dmesg log of the emmc installation and removal.

For each emmc you have to apply this:
Connect it to the sd to emmc adapter
Carefully and evenly plug it into the sd card slot
Apply this modified command:
echo 0 > /sys/block/mmcblk1boot0/force_ro
dd if=/dev/mmcblk1 of=/dev/mmcblk1boot0 bs=512 skip=1
sync
Pull the emmc out after waiting a few seconds after sync. Repeat, 10-15 seconds each

I have yet to ruin any Emmc by doing it without a shutdown. However, some Emmc have come to me corrupted. I have about a 2 percent loss rate before I even touch them. The dmesg log will spit out all kinda error messages when you plug in a bad emmc and in Uart mode this appears right in the same terminal. You could just check the dmesg each time if you were using an ssh tunnel.

Good luck to anyone that goes this way. I have no Emmc related problems to report yet.

-Thomas

Notes and links:
This emmc was very unreliable for us.
This emmc that is much better
This is the sd card to emmc that works.