From 558918651ee99024876fb1f85a559d46edba9548 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 19 Jun 2023 03:07:26 +0200 Subject: stm32: update stm32-metapac. --- tests/stm32/src/bin/rtc.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/stm32/src') diff --git a/tests/stm32/src/bin/rtc.rs b/tests/stm32/src/bin/rtc.rs index 32d35c42c..582df5753 100644 --- a/tests/stm32/src/bin/rtc.rs +++ b/tests/stm32/src/bin/rtc.rs @@ -24,10 +24,8 @@ async fn main(_spawner: Spawner) { info!("Starting LSI"); - unsafe { - pac::RCC.csr().modify(|w| w.set_lsion(true)); - while !pac::RCC.csr().read().lsirdy() {} - } + pac::RCC.csr().modify(|w| w.set_lsion(true)); + while !pac::RCC.csr().read().lsirdy() {} info!("Started LSI"); -- cgit From 990dd5e5db7134193259fcf350c0928b9a64df97 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 19 Jun 2023 22:38:27 +0200 Subject: tests/stm32: do multiple transfers to catch more bugs. --- tests/stm32/src/bin/usart_dma.rs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'tests/stm32/src') diff --git a/tests/stm32/src/bin/usart_dma.rs b/tests/stm32/src/bin/usart_dma.rs index 50dd2893e..c34d9574b 100644 --- a/tests/stm32/src/bin/usart_dma.rs +++ b/tests/stm32/src/bin/usart_dma.rs @@ -69,24 +69,27 @@ async fn main(_spawner: Spawner) { const LEN: usize = 128; let mut tx_buf = [0; LEN]; let mut rx_buf = [0; LEN]; - for i in 0..LEN { - tx_buf[i] = i as u8; - } let (mut tx, mut rx) = usart.split(); - let tx_fut = async { - tx.write(&tx_buf).await.unwrap(); - }; - let rx_fut = async { - rx.read(&mut rx_buf).await.unwrap(); - }; + for n in 0..42 { + for i in 0..LEN { + tx_buf[i] = (i ^ n) as u8; + } + + let tx_fut = async { + tx.write(&tx_buf).await.unwrap(); + }; + let rx_fut = async { + rx.read(&mut rx_buf).await.unwrap(); + }; - // note: rx needs to be polled first, to workaround this bug: - // https://github.com/embassy-rs/embassy/issues/1426 - join(rx_fut, tx_fut).await; + // note: rx needs to be polled first, to workaround this bug: + // https://github.com/embassy-rs/embassy/issues/1426 + join(rx_fut, tx_fut).await; - assert_eq!(tx_buf, rx_buf); + assert_eq!(tx_buf, rx_buf); + } info!("Test OK"); cortex_m::asm::bkpt(); -- cgit