https://github.com/rp-rs/rp-hal should have most the info you need
#How to setup rust on pi pico w?
74 messages · Page 1 of 1 (latest)
@waxen stratus yes, it is a hardware abstraction layer (take a look at definition)
also you can check examples inside https://github.com/rp-rs/rp-hal/tree/main/boards/rp-pico/examples
you probably will cargo build like on any other platform (I have experience with stm32 and esp32)
You have to install all the tools before you can get to programming the pico
under the programming section you can see commands
https://github.com/rp-rs/rp-hal#programming
yes
if you have RP2040 (seems like it is the case) you can even drag and drop image after converting as stated in a readme
I feel like we have skipped over the "install all the tools for compiling for arm" step
Also what is the main goal? Learn embedded Rust or just embedded?
If second, I would suggest to try micropython first, it has much faster iteration and even REPL, which give you an opportunity to run commands on the fly
Run the cargo install and rustup update. You will want to clone the ro-hal repo and try the example projects first
Before making your own project
Yes
That installs the backend for rustc that can make arm machine code
Yes
You can't install for just a project
That's for dependancies
This is a command line tool not a library
toolchain is a global "thing" which compiles your project, technically you can do this per-environment but not per-project
No
you can choose target explicitly in cargo.toml
if you clone or create project [with cargo] it will be there
It's not the cargo.toml it's the toolchain toml but that doesn't really matter at the moment
Yep, just let if keep going
oh, okay, things changed then, I remember specifying target under the [build] section in cargo.toml for stm32
That's a slightly different thing, but yeah that is needed also
You should try the example project first to see if it works
Git clone, cargo build, cargo run
Clone the rp-hal repository itself
Before running the last command cargo run ...
Yes
So git clone https://github.com/rp-rs/rp-hal.git
cargo build --release --example <name>
You can, but it's not needed yet
Well if you say no you can't continue, so...
Replace <name> with the example you want to try
They are listed on the page
I would recommend https://github.com/rp-rs/rp-hal/tree/main/boards/rp-pico#pico_blinky
Cd into the folder
boards/rp-pico
You cloned the wrong thing
git clone https://github.com/rp-rs/rp-hal.git
You can just leave it for later
You can use it for your first solo project
You just go into your file explorer and click the folder and press delete
A git repository is just a normal folder with files in it
K, it all compiled good?
K cargo run --release --example <name> same thing replace <name>
And it should program the pico and start flashing the LED if you chose the blink example
No blink?
It says it uploaded fine
try to reconnect, maybe reset didn't work properly
Hmm, did you hold the button when you plugged it in? Seems like that is needed from what I see online
it seems like he programming via mass storage
It's only supposed to show up if you hold the boot select button
what I see in terminal output is that you are converting binary to uf2 and copying it to pico
rp2040 has a bootloader which should handle this, I guess
Oh wait, this is a W
Which has the LED on a different pin
Probably so it's probably working you just can't see it
Looks like it's connected to the wifi chip instead of the main CPU
You would need to wire up an external LED for easy blinking
As the Rust wifi chip driver is still under development
https://github.com/rp-rs/rp-hal/issues/376 full pico w support (with all the pins mapped and wifi driver) in rp-hal is almost ready
GitHub
Raspberry Pi Pico W now support WiFi & Bluetooth. https://datasheets.raspberrypi.com/picow/connecting-to-the-internet-with-pico-w.pdf Is it possible to connect using rust?
But you should be able to use it as is just fine
Is this still the case? Is it worth running rust or should I use smth like swift instead?
I could just go out and get an external led if that is the main difference but i do want to use the bluetooth capabilities
@cloud oriole ?