ashrafhasson
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 ![]()
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 ![]()
If this requires building some customer rootfs overlay, I haven’t got a clue (yet) how that is done ![]()
My lack of knowledge is surely apparent now and I’d appreciate any directions and hints!
Thanks in advance ![]()
Most Liked
fhunleth
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:
- Fork
nerves_system_bbb. Call itnerves_system_bbb_emmcor whatever makes sense to you. - Replace references to
mmcblk0withmmcblk1in the Nerves System. This search shows where they are. - In the
uboot.env, also replace the “device:partition” with partition 1. I.e.,0:1→1:1,0:2→1:2. - Build the system
- 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):
- Load a
circuits_quickstartfirmware 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/rootpartition so that it will be there in the future.
b. On the IEx prompt on the BBB, runcmd("fwup -d /dev/mmcblk0 /root/appname.fw")
c. Power off, remove the MicroSD, power on and hope. - 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.
- If it’s more convenient to connect the BBB to your laptop via USB, have it show up as a thumbdrive and then run
fwupon your laptop, there’s a command calledumsin U-Boot that can do this. What you need to do is create use Buildroot to create an image (like thenerves_fw_loaders), but you can remove everything related to Linux. I think that the command is something likeums 0 mmc 1:0at 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.







