0

How do I configure non-standard UART pins on the Raspberry Pi Pico in a Rust project?

I'm following the Rust rp2040-project-template and, using another Picoprobe, can see log messages in the terminal as the onboard LED blinks. I gather it's possible to use different pins for UART TX & RX, but how is this configured in the context of the Rust project template? My goal is to free up pins 1 & 2 for other purposes.

Section 4.1 of the official getting started with pico guide implies there is a board configuration file, but it seems to be a C header file which I don't know how to use.

eletvon
  • 35
  • 3
  • The configuration is specified by the [`rp-pico`](https://github.com/rp-rs/rp-hal-boards/blob/main/boards/rp-pico/src/lib.rs) dependency, so you would need to replace it with your own `rp-eletvon` crate that configures the pins the way you want them. – Jmb Mar 01 '23 at 07:46
  • @Jmb, I see lots of aliases there, but can't see how UART settings are specified, or what I'd have to change in order for `defmt` to send logs to the other pins. – eletvon Mar 01 '23 at 22:33
  • This was not clear from your question. In the template you gave, `defmt` outputs messages using RTT, i.e. through JTAG not the UART. So pins 1&2 should already be available for other uses… – Jmb Mar 02 '23 at 07:58
  • @Jmb, looks like I don't understand. I thought the probe gets the log messages from UART on pins 1 & 2, like in the diagram here https://reltech.substack.com/p/getting-started-with-rust-on-a-raspberry Any tips on what to read to correct understanding would be appretiated. – eletvon Mar 08 '23 at 22:28

0 Answers0