Skip to content

Asynch UART#334

Open
robamu wants to merge 7 commits intomainfrom
asynch-uart
Open

Asynch UART#334
robamu wants to merge 7 commits intomainfrom
asynch-uart

Conversation

@robamu
Copy link
Contributor

@robamu robamu commented Oct 17, 2025

No description provided.

@robamu robamu changed the title Asynch uart Asynch UART Oct 17, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 28, 2025

Deploying ferrous-systems-rust-training with  Cloudflare Pages  Cloudflare Pages

Latest commit: eff9248
Status: ✅  Deploy successful!
Preview URL: https://f16f2871.ferrous-systems-rust-training.pages.dev
Branch Preview URL: https://asynch-uart.ferrous-systems-rust-training.pages.dev

View logs

@robamu robamu marked this pull request as ready for review January 12, 2026 16:01

use core::fmt::Write;
use qemu_aarch32v8r::uart::{CmsdkUart, MutexUart, UART0_ADDR};
use qemu_aarch32v8r::uart::{Uart, MutexUart, UART0_ADDR};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason for renaming CmsdkUart to just Uart? We have other examples in this folder which use a PL011 UART, which requires a different driver, so I don't want to lose the context here about which UART driver is which.

Copy link
Contributor Author

@robamu robamu Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the module was named cmsdk_uart, so I considered the CMSDK naming in the UART structure redundant. But I can revert the naming, so this is explicit in contexts where the module name is not visible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted the naming.


const MAX_WAKERS: usize = 5;

static TX_WAKERS: [AtomicWaker; 5] = [const { AtomicWaker::new() }; 5];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see every fn, static and const in this module documented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


impl embedded_io_async::Write for TxAsynch {
/// It is very important that the data which is sent outlives the asynchronous futures
/// created with it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we enforce this with lifetime annotations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not even sure if this is necessary and maybe the comment can be removed. If I create a future for the asynchronous write, instead of awaiting it, the data is borrowed and can not be modified.

@jonathanpallant
Copy link
Member

Very cool to see this working, and all spelled out. Left some thoughts.

robamu and others added 3 commits January 14, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments