Modify U-Boot from official Git repository to boot from eMMC

Hi all,

I work with a BBB for a project where the I need to record data from an Ethernet connection. The OS sits on the eMMC while the data goes to the µSD card. To boot from the eMMC while there is a µSD in the slot, I followed the instructions on this post (formatted µSD card with 2 partitions, put a uEnv.txt file on the first one) and got the board booting on the eMMC. Yay. Since the power is intermittent, the BBB is equipped with a battery that lets it turn itself off (in case power is gone). When power is back on, the board boots again. So the BBB needs to be able to boot autonomously when there is power on USB and to turn itself off afterwards. I did the shutdown with a script and this part works fine. (of course there is always the case where the power is back on just when the BBB is shutting down, but I guess I can’t do anything about it).

What does not work is that I sometimes find the board in a strange state, where only the power LED is lit while the user LEDs are off. It seems that I am encountering the issue discussed in this thread, where the RX pin of the FTDI receives fake data, which stops U-Boot and prevents the board from booting normally.

After reading the whole thread, two solutions seem to exist:

  • hardware fix: use a 10k pull-up resistor between the RX pin and the 3.3V
  • software fix: reconfigure U-Boot to look for a string (instead of just any data) to enter into its communication mode

I have implemented the hardware fix and am currently testing it (booting every five minutes). However, I would rather use the software fix to U-Boot as it does not require any modification to the hardware. So I followed the link on this post (to eewiki.net) to build U-Boot from the official git repository and created MLO and u-boot.img files (that I can patch with the few lines on the post, but I haven’t done this yet). My problem is: those instructions are designed to make the BBB boot from the µSD card. Actually, it even requires to remove the OS from the eMMC (or to remove the MLO file so that U-Boot doesn’t see it), or to replace the uEnv.txt by the one there, otherwise it is stuck. My files work, as I can boot from a µSD card containing Linux. However, when I tried replacing the MLO and u-boot.img files on the eMMC (you can’t blame me for trying, but I agree that it was a long shot), it of course hanged.

I am a total newbie in the U-Boot world and I find it complicated since I don’t even know where to start. What I would like is just to be able to modify the official version of U-Boot to boot from the eMMC. Ideally, I would also remove the need to create two partitions and to add a uEnv.txt on the µSD card, but that is not a requirement. Also, it would teach me how all of this works and give me a little more control over this part of the project!

If any of you has either a solution or a forum thread which I have not found or even a simple “how to use U-Boot” tutorial that does not involve going through hundreds of pages of technicalities (that, I have found), I would be really happy!

Thank you all in advance!

Regards,

Alexandre

You can also follow those directions for setting up the eMMC, while
running the bbb from the microSD..

Regards,

Hi RobertCNelson,

Thank you for your response! Actually, I “need” to run Linux from the eMMC since I want the data to sit on the µSD card (for convenience). And I want to maximize the storage space on the µSD card, so no Linux on there.

By the way, the “hardware” method still works on my BBB rev B (the tests were concluding: after 824 reboots, no sign of U-Boot crashing).

Regards,

Alexandre

Well the procedure is the same.. Just you have to have an os running
on the microSD to write the bootloader/os to the eMMC..

Regards,

Copying the files is not the problem. I have already managed to access the eMMC from a Linux running on the µSD.

However, when I replace the stock MLO and u-boot.img files by the newly compiled ones on the eMMC, it does not work (as it is meant to be put on the µSD card), hence my question on how to modify the source code (so that I can adapt it to work on the eMMC).

Thank you for your patience :)!

Alexandre

In the official images, we use the same "MLO/u-boot.img" for both the
microSD and eMMC. It works fine..

So post your "actual" error instead of saying it doesn't work..

If you don't have a serial adapter, get one, as that will help...

Regards,

Sorry for the lack of details, I was indeed not very precise. From what I remember, the system did not boot when no SD card (with a Linux OS on it) was inserted, and I think only 3 out of the 4 LEDs were lit. But I’m not sure about that.
I’m getting a serial adapter, and also more SD cards (I only have one right now, and it’s really long to reformat it each time I want to do something), and I’ll get back to you with more info after retrying more rigorously!

Also, I have a strange problem where I have a REALLY hard time accessing SSH while running a Linux from the SD card: I can see the virtual network adapter in Windows, but most of the time it shows “cable not connected” and I need to reboot many times (pushing the button and waiting 1 minute for shutdown, and then reboot with the Boot button pushed) before I can finally have access to the connection). Sometimes, when the card is freshly formatted, the connection works at first boot, but as soon as I reboot it is gone… So yeah, getting a serial adapter will most definitely help. (I’m running Win7 64 bits and I have no problem whatsoever with the connection when the Linux is ran from the eMMC).

Thank you RobertCNelson!

Regards,

Alexandre