Open AnthonyYahtec opened 1 month ago
Keep in mind that unless you enable hardware flow-control, the uart read might miss the data, because the basic usart does not do any buffering and doesn't enable RX until the read_until_idle() is called. To increase the likelyhood that it will read the input, try configuring the buffered uart instead. In any case, using hardware flow control is the best way to guarantee not missing any data.
The function uart.read() don't work in usart i use a STM32L431RC.
bind_interrupts!(struct Irqs { USART1 => usart::InterruptHandler;
});
[embassy_executor::main]
async fn main(spawner: Spawner) { let device_config = embassy_stm32::Config::default(); let p = embassy_stm32::init(device_config); let config = new_uart_config(9600u32, DataBits::DataBits8, Parity::ParityNone, StopBits::STOP1); let mut uart = Uart::new(p.USART1, p.PA10, p.PA9, Irqs, p.DMA1_CH4, p.DMA1_CH5, config).unwrap();
}