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

PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
mikl
I wanted to capitalize a string, and tried using String.capitalize(). That generally works well, until you try to capitalize a word like...
New
pillaiindu
In django there is a cache framework backed by memcached. Rails also puts a lot of emphasis on caching, and even the idea of russian-doll...
New
cvkmohan
The upcoming Phoenix 1.6 release looks very interesting. Became a habit to watch the commits - and - what they are bringing in. phx.gen...
New
chuck
Let me start by stating an assumption: Phoenix is a great approach to building REST APIs. There are many reasons for this, but I will ass...
New
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39247 209
New
CharlesO
Erlang :list.nth simple, but 1 - based nth(1, [H|_]) -> H; nth(N, [_|T]) when N > 1 -> nth(N - 1, T). Elixir Enum.at … coo...
New
RudManusachi
What configs will make sense to put to runtime.exs? – A bit of how I configure apps: I have generic configs in config/config.exs, dev...
New
chulkilee
Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they w...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29305 241
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52238 488
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New

We're in Beta

About us Mission Statement