crispinb

crispinb

How to create Nerves image under wsl2

I thought I’d give Nerves a spin (to follow along with Build a Weather Station with Elixir and Nerves (PragProg)) but have thus far fallen at the first hurdle.

I’m doing all this under Windows 10, wsl2. I’ve managed to build the firmware but can’t burn it. Because of the oddities of how wsl2 accesses block devices (via p9) I gave up trying to write direct to the device. If I can just create the firmware image, that’s easy enough to get onto the SD card.

The mix burn help suggests I can create such an image, via mix burn --device <filename>, but that nets this error:

Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
At line:1 char:1
+ Start-Process fwup -Verb runAs -Wait -ArgumentList "-a -i \\wsl$\Ubun ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

That’s obviously powershell output, so I thought as all I’m trying to do here is write to a file it might be simpler to use the linux fwup (which I also have installed). So I removed the windows fwup.exe from my path, and now I get:

❯ mix burn --device ./image.img
==> nerves
==> sensor_hub

Nerves environment
  MIX_TARGET:   rpi0
  MIX_ENV:      dev

** (Mix) fwup.exe is required by the Nerves tooling.

Please see https://hexdocs.pm/nerves/installation.html for installation
instructions.

Can I force mix burn to allow me to use the linux fwup so I can just write to a local filesystem image?

Marked As Solved Switch mode

crispinb

crispinb

Ok this is embarrassing - mix burn does work perfectly well with a manually-installed fwup.exe after all. I had a quick look at the chocolatey package - it doesn’t do anything substantially different from just plopping the .exe in the path, so I realised I must have done something daft. Which indeed I had - I had put fwup.exe in a directory that used to be on the path on my machine, but was no longer.

PEBKAC.

Also Liked

03juan

03juan

I remember also banging my head around this issue and just decided to take the plunge with chocolatey as a last resort which worked. Also agree about having to juggle multiple tools but in this case this was the easiest way that let me just get on with it.

I think the main issue is that you can’t have direct access to the usb subsystem from wsl2, but I don’t know why we both had a hard time with the manual exe install. :man_shrugging:

Perhaps with some more time I’d revisit the subject and try to solve the issue once and for all using the manual way, and write a post about it for others.

03juan

03juan

that’s what I did on my router because mDNS didn’t pick up the device when not connected via USB gadget mode

I must have messed up my paths as well, will have to check when I get a chance. Thanks for persevering to the root cause :clap:

Where Next?

Trending in Questions Top

jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
saveman71
Hello ! We want new/edit form pages to POST/PUT to their own URL rather than the resources REST defaults (post /things, put /things/:id)...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

jhogberg
Patch Package: OTP 29.0.5 Git Tag: OTP-29.0.5 Date: 2026-08-04 Trouble Report Id: OTP-...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New

We're in Beta

About us Mission Statement