libdaisy-rust icon indicating copy to clipboard operation
libdaisy-rust copied to clipboard

Setting up a Project

Open mtthw-meyer opened this issue 4 years ago • 4 comments

When creating a new libdaisy-rust project you'll need to copy or create your own memory.x and .cargo/config files to tell the compiler how to build the binary image.

mtthw-meyer avatar May 18 '21 16:05 mtthw-meyer

a template for cargo-generate could be nice

x37v avatar May 18 '21 17:05 x37v

I'm working on this. Trying to base it off of https://github.com/rust-embedded/cortex-m-quickstart

Two questions here:

  • Does it matter what repository I'm storing it in? We'll just copy it over to a more official one if I get it working, right? I am working out of https://github.com/Spstolar/libdaisy-rust-quickstart right now.
  • Do we have an idea for what main.rs should do? My current idea is just to fill it with blinky.rs.

Spstolar avatar Jul 14 '21 03:07 Spstolar

Yes, we'll find a place to put it if you get something working. Any of the examples would be a reasonable base for main.rs, blinky is fine.

mtthw-meyer avatar Jul 14 '21 03:07 mtthw-meyer

OK, got it running: https://github.com/Spstolar/libdaisy-rust-quickstart . The steps for use are in the README, which can be cleaned up more if needed.

Assuming cargo-generate and the other precursor steps are done

  1. cargo generate --git https://github.com/Spstolar/libdaisy-rust-quickstart
  2. cargo objcopy --release -- -O binary template.bin
  3. Then (if you're using dfu-util): dfu-util -a 0 -s 0x08000000:leave -D template.bin

Spstolar avatar Jul 14 '21 04:07 Spstolar