stm32-rs / stm32l0xx-hal

A hardware abstraction layer (HAL) for the STM32L0 series microcontrollers written in Rust
BSD Zero Clause License
96 stars 60 forks source link

LPUART won't work below 1MHz #112

Closed nebelgrau77 closed 4 years ago

nebelgrau77 commented 4 years ago

Not sure whether this is a problem or there is some particular way to configure it. What I'm doing is:

let mut lpserial = dp.LPUART1.usart(tx_pin, rx_pin, serial::Config::default(), &mut rcc).unwrap();

It works perfectly with MSI from Range6..Range4, but not below that. The calculation of the baudrate divisor should work OK, it adjusts for LPUART. But it won't work. Setting the baudrate explicitly to lower values (e.g. 1200 bps) doesn't change it. It just stops working below Range4.

Is there something else I have to do in my code to make it work?

nebelgrau77 commented 4 years ago

It works, the problem was caused by the non working delay (as mentioned in another PR).