STM32G431CBU6 (and others) : how to make LPUART1 to work ?
Posted: Thu May 16, 2024 10:24 pm
this code works :
this one don't :
the problem could be that LPUART1 is configured to work with HSI16 clock , instead of PCLK , even when it is not used
if I try to clear the LPUART1SEL[1] bit manually , it won't work , and in addition , USART3 gets a false clock
so not the right way : please which is the working one ?
Code: Select all
HardwareSerial Serial3(PB11, PB10); /// USART3 works
uint64_t millis_duration = 100, millis_begin;
void setup() {
Serial.begin(115200); // USB
Serial3.begin(19200);
}
void loop() {
if (millis() - millis_begin >= millis_duration) { // debug uart
millis_begin += millis_duration;
Serial3.write("UUU"); // PB10
}
}
Code: Select all
uint64_t millis_duration = 100, millis_begin;
void setup() {
Serial.begin(115200);
SerialLP1.begin(19200);
}
void loop() {
if (millis() - millis_begin >= millis_duration) { // debug uart
millis_begin += millis_duration;
SerialLP1.write("UUU"); // PB11
Serial.println(RCC->CCIPR, BIN); /// debug
}
}
if I try to clear the LPUART1SEL[1] bit manually , it won't work , and in addition , USART3 gets a false clock
so not the right way : please which is the working one ?