2021-05-01 05:19 AM
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.
Solved! Go to Solution.
2021-05-02 04:34 AM
Thanks for your reply. I did re-check the above thanks.
FYI I managed to resolve this.
This turned out to be an issue with the ground between the host pc and the stm32. (Issue on the host side or cable)
Picked it up when I connected the oscilloscope and suddenly everything worked.
Once you disconnect the probe ground pin the issue would occur again.
Never mind what I did ground wise I could not get them to consistently talk.
Resolved/worked around it by putting a raspberry pi in between to communicate to the stm32 via it's UART pins.
2021-05-01 05:30 AM
Make sure BOOT0 is pulled to ground.
Double check all RCC, GPIO and USART clocks/pins are explicitly enabled. ie not left to assumption
2021-05-02 04:34 AM
Thanks for your reply. I did re-check the above thanks.
FYI I managed to resolve this.
This turned out to be an issue with the ground between the host pc and the stm32. (Issue on the host side or cable)
Picked it up when I connected the oscilloscope and suddenly everything worked.
Once you disconnect the probe ground pin the issue would occur again.
Never mind what I did ground wise I could not get them to consistently talk.
Resolved/worked around it by putting a raspberry pi in between to communicate to the stm32 via it's UART pins.