2015-06-02 08:14 PM
Must say the CubeMX generation tool is very good, and it really does make everything simpler. However, I run into a situation where I am using the STM32L051 and STM32F051 to test on a project connecting to the bluetooth module. What I have done is very simple, which is to use interrupt to capture one character, and send from UART1 to UART2, and from UART2 to UART1. UART1 is using CTS/RTS flow control, while UART2 is just using RX and TX.
Both sets of code are generated by CubeMX with the same settings on pins, baud rate... etc. Also tested by connecting USB UART converters. When I type one character on one putty window, the other will appear. However, when UART1 is connected to my module, and it is sending at high speed, STM32L051 will return some kind of repeated characters, for example, ''READY.'' will become ''REEDDY''. As the STM32F051K8U6 and STM32L051K8U6 are basically interchangeable, I have replaced them on my PCB, and observe that STM32F0 do not have a problem. I am suspecting either a bug in the HAL driver for STM32L0, or something stupid I have done. I IRQHandler is very simple, just pass one to the other, and get ready for another character.void
USART1_IRQHandler(
void
)
{
HAL_UART_IRQHandler(&huart1);
HAL_UART_Receive_IT(&huart1, &character_in, 1);
HAL_UART_Transmit(&huart2, &character_in, 1, 1000);
}
If anyone has anything I could try, it would be great. Thanks.
2015-06-04 09:07 AM