Issues trying to get USART writing to a console. It only works when I have stlink connected. As soon as I disconnect stlink the output stops. The output does seem to go through USART2_TX (PA9) as disconnecting it stops the output
I am using STM32L010F4 20 pin on a simple breakout board.
I am running STM32CubeIde and using a STM32Lc100-disco as my programmer via SYS_SWCLK (PA14), SYS_SWDIO (PA13) and NRST.
All works well can get SPI etc running no problem.
I mapped USART2_RX to PA10 and USART2_TX to PA9 and connect this to a serial to USB converter.
Config below
huart2.Instance = USART2;
huart2.Init.BaudRate = 115200;
huart2.Init.WordLength = UART_WORDLENGTH_8B;
huart2.Init.StopBits = UART_STOPBITS_1;
huart2.Init.Parity = UART_PARITY_NONE;
huart2.Init.Mode = UART_MODE_TX_RX;
huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart2.Init.OverSampling = UART_OVERSAMPLING_16;
huart2.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart2.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
Just cannot get output without the stlink connected.
Tried orders of plugging in, restarting, booting desktop, etc. does not work.