Skip to content

Instantly share code, notes, and snippets.

@ChrisCrossCrash
Created April 23, 2024 22:33
Show Gist options
  • Save ChrisCrossCrash/ed9a25fedd4dfe7bbfc6a8d5c508f15e to your computer and use it in GitHub Desktop.
Save ChrisCrossCrash/ed9a25fedd4dfe7bbfc6a8d5c508f15e to your computer and use it in GitHub Desktop.

Compiling Rust for Arduino on WSL

Follow this guide with the following modifications:

  • You'll need to manually share the Windows USB ports with WSL using usbipd-win.
  • The guide tells how to list the USB devices with lsusb, but it doesn't show how to get the name of the device file that you'll need when setting RAVEDUDE_PORT. To get that, use dmesg | grep tty:
    ck@ck-win-pro:~/tuts/rust-x-arduino (main)
    $ dmesg | grep tty
    [ 1974.578111] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
    ck@ck-win-pro:~/tuts/rust-x-arduino (main)
    $ export RAVEDUDE_PORT=/dev/ttyACM0
    ck@ck-win-pro:~/tuts/rust-x-arduino (main)
    $ cargo run
    
  • The guide gives the following command:
    cargo generate --git <https://github.com/Rahix/avr-hal-template.git>
    
    However, the command should be run without the < or > symbols:
    cargo generate --git https://github.com/Rahix/avr-hal-template.git
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment