For my project, i am using the STM32L082KZT6. I have made a custom board file for it and fixed the variants, however after uploading i cannot read the Serial monitor even though i have this in the platformio.ini:
[env:JENG_STM32L082KZ]
platform = ststm32
board = JENG_STM32L082KZ
framework = arduino
monitor_speed = 9600
upload_protocol = stlink
debug_tool = stlink
and in the variant.h:
#define SERIAL_UART_INSTANCE 2 //ex: 2 for Serial2 (USART2)
// Default pin used for ‘Serial’ instance (ex: ST-Link)
// Mandatory for Firmata
#define PIN_SERIAL_RX 0
#define PIN_SERIAL_TX 1
The variant code is based on the NucleoL073RZ variant.h file which uses the same pins and same LPUART1 protocol on these pins. I have tried setting the PIN_SERIAL’s to PA_13 and PA_14 but this also did not work.
(I also have gotten the other necessary files from https://github.com/stm32duino/Arduino_Tools/tree/master/src/genpinmap/Arduino/STM32L0/STM32L082K(B-Z)Tx)