Flash firmware from sdcard onto beaglebone green emmc

Hello all,

I might be confusing myself and this may be a question better suited for the beagleboard community, but I figured Nerves community might have experience with flashing BBGs from a nerves project perspective.

So, I’m trying to either flash the SDCard onto the eMMC of the BBG after having burnt the firmware onto that SDCard or directly (which I think is only possible with ssh firmware updates after the eMMC is flashed with a nerves firmware) and needless to say I’m failing at that :confused:

Has anyone been trying the same or is it customary to just boot off the SDCard?

My understanding is that the bbb image is not a flasher image so I’m not sure how to use it to flash the eMMC … I also tried to blindly dd it over to the eMMC (blkmmc1) but that seems to corrupt the eMMC :thinking:
If this requires building some customer rootfs overlay, I haven’t got a clue (yet) how that is done :frowning:

My lack of knowledge is surely apparent now and I’d appreciate any directions and hints!

Thanks in advance :slight_smile:

Ah, I see … I needed to read through fwup thoroughly before I raise this question :sweat_smile:

Hi @ashrafhasson,

We ended up choosing to not support booting off the BBB’s eMMC since the MIcroSD worked fine and it was annoyingly difficult to make an image that worked on both eMMC and MicroSD.

Here’s what you need to do:

  1. Fork nerves_system_bbb. Call it nerves_system_bbb_emmc or whatever makes sense to you.
  2. Replace references to mmcblk0 with mmcblk1 in the Nerves System. This search shows where they are.
  3. In the uboot.env, also replace the “device:partition” with partition 1. I.e., 0:11:1, 0:21:2.
  4. Build the system
  5. Use it in your Elixir project by finding the references to nerves_system_bbb and updating them

The next part is how to actually get your Nerves firmware onto the eMMC for the first time. After the first time, you can update it over USB or WiFi, etc. I’d probably go with the first choice for a while even though it’s slow and manual. You’ll want to connect to the BBB over UART since the errors in the next parts show up before networking is up (if booting gets that far):

  1. Load a circuits_quickstart firmware onto a MicroSD and boot off MicroSD. It doesn’t what you load, but these are small.
    a. Get your Nerves firmware (the .fw file under _build/.../nerves/appname.fw) and run SFTP to copy it to the BBB. Copy it to the /root partition so that it will be there in the future.
    b. On the IEx prompt on the BBB, run cmd("fwup -d /dev/mmcblk0 /root/appname.fw")
    c. Power off, remove the MicroSD, power on and hope.
  2. If you’re doing this a lot, it’s nicer when the MicroSD card does everything automatically and blinks lights when it’s done. In the past, I’ve not used Nerves for this loader. The nerves_fw_loaders repository might be able to give you ideas.
  3. If it’s more convenient to connect the BBB to your laptop via USB, have it show up as a thumbdrive and then run fwup on your laptop, there’s a command called ums in U-Boot that can do this. What you need to do is create use Buildroot to create an image (like the nerves_fw_loaders), but you can remove everything related to Linux. I think that the command is something like ums 0 mmc 1:0 at the U-Boot prompt. Once you get the right command, set that as the U-Boot boot command.

Unfortunately, I’ve only done this with a custom board that was enough different from the BBB that it won’t help you. I hope some of this helps.

1 Like