Page 1 of 1

STM32L071 UART2 (PA2,PA3) not working

Posted: Sun Jan 17, 2021 1:48 pm
by ALLSPARK
I am trying to create Serial bridge from UART 2(PA2,PA3) to USART1 (PA9,PA10). Any idea how to declare USART2??

I am using STcore=>Discovery L072CZ and Nucleo-64 L073 . i have tested Blink program and UART1, they work fine ! declaring the UART2 is problematic for me. For pin compatibility with F103 and my PCB i need to make the USART2 work!

Code: Select all

// thing i have tried 
 
 HardwareSerial SerialLora(D0, D1);// when  discovery  was selected.

HardwareSerial Serial2(USART2); // when Nucleo was selected


Re: STM32L071 UART2 (PA2,PA3) not working

Posted: Sun Jan 17, 2021 3:46 pm
by fpiSTM
L072 is not L071.
So probably something different which prevent it to work properly.
For example the RCC_OSCILLATORTYPE_HSI48 does not exist on the L071 and it is configured during the system clock config of the Disco L072.
You create properly a variant for the L071.