Skip to content

SFrijters/nix-qemu-esp32c3-rust-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nix-qemu-esp32c3-rust-example

nix flake check

This is an example / test for https://github.com/SFrijters/nix-qemu-espressif; it is kept out of that repository to keep it as lean as possible.

Usage

As an example we compile a simple 'blinking LED' Rust code based on an example in esp-hal for an ESP32C3 chip and run it on QEMU:

  • nix flake check -L

This command is also run in the GitHub action.

This flake also provides the following apps:

  • nix run .#emulate (default app) to run the emulation test script directly.
  • nix run .#flash to flash the compiled code to a physical device.

And a development shell via:

  • nix develop

Physical test

The code has been tested on a Seeed Studio XIAO ESP32C3. The GPIO10 pin corresponds to the D10 pin as marked on the board.

Known issues

This example code works around a linker issue in nixpkgs in blinky/default.nix. Please refer to the linked issue for details and please suggest a better/permanent fix if you know of one!

Further reading