rp-rs / rp-hal

A Rust Embedded-HAL for the rp series microcontrollers
https://crates.io/crates/rp2040-hal
Apache License 2.0
1.46k stars 237 forks source link

Port UART updates to rp235x-hal #841

Closed jannic closed 2 months ago

jannic commented 3 months ago

The updates from #798, #837 and #838 were only applied to rp2040-hal. This patch ports them to rp235x-hal.

thejpster commented 3 months ago

What testing has been done? Should I run a demo and try it?

jannic commented 3 months ago

Only tested that it still builds. It seems like we don't have on-target tests for UART yet. I'd consider the port to rp235x relatively low-risk as the changes don't touch any low-level details. But of course, doing some actual testing would be very welcome!

thejpster commented 3 months ago

I think we should write a loop back test that sends bytes with good and bad parity, just to check this is working as expected.

thejpster commented 3 months ago

I wrote a UART loopback program, and fixed some issues I observed: https://github.com/rp-rs/rp-hal/commit/1f6251a418cb8b105a39e3e491352d3be1073cb5

You can cherry-pick that here if you like it.

jannic commented 3 months ago

I wrote a UART loopback program, and fixed some issues I observed: 1f6251a

You can cherry-pick that here if you like it.

Thanks! Did you use external pull-ups? The uart_loopback example didn't work for me. Took me a while to find out what's going on because without defmt I didn't see the unwrap failing. The fix was enabling the internal pull-ups on the RX pins. (Only tested on rp2040 yet)

thejpster commented 3 months ago

No I didn't. Just a DuPont wire on a Pimoroni Pico 2 Plus.

jannic commented 3 months ago

Interesting. I reproducibly got a break error on rp2040 before I activated the pull-ups.

thejpster commented 3 months ago

🤷