Getting Setup - KOINSLOT-Inc/kywy-rust GitHub Wiki

Setting up your rust environment

Install rust using rustup: https://rustup.rs Follow instructions on using rustup and set your path variable so your operating system can find rust: https://www.rust-lang.org/tools/install.

add the rp2040 build target rustup target add thumbv6m-none-eabi this adds the files we need to build specifically for the kywy.

install elf2uf2-rs cargo install elf2uf2-rs This is a program that will convert the output files to UF2 for easy programming.

Setup your IDE for using rust This depends on your ide, search the plugins/extensions for rust support.

You should now have a working rust installation, we will test it in the next steps.

Clone this repository and build an example

open your terminal and go to your documents folder cd Documents

clone this repo with git clone https://github.com/KOINSLOT-Inc/kywy-rust/

This will create a copy of this repo in the folder, go to the new directory with cd kywy-rust

Now try building and example cargo build --release --example hello_world --target thumbv6m-none-eabi this should take a minute and build the hello_world program

Convert the output to a UF2 file:

elf2uf2-rs target/thumbv6m-none-eabi/release/examples/hello_world

you should now have a UF2 file in the target/thumbv6m-none-eabi/release/examples/ folder.

you can now proceed to copying this file onto the kywy.

Uploading a program to the kywy

To put the kywy in program upload mode:

  1. Turn the kywy off and unplug it
  2. Depress the button on the back with a paperclip or similar small pointy thing
  3. While holding the button, plug in the USB
  4. The kywy should show up as a storage device, you can now copy the UF2 file to the storage
  5. The kywy should automatically reboot and start the program. You can now unplug it.

Programming your own

The fastest way to get started is to add a new file to the examples folder.

You can copy an existing example or make a new one.

You can now compile this program and upload it using the above instructions.