ashrafhasson

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

Most Liked

fhunleth

fhunleth

Co-author of Nerves

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.

Where Next?

Popular in Discussions Top

Other popular topics Top

TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41454 115
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "eq...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement