Associate
January 30, 2019
Question
STM32F042: UART application using CubeMX not working
- January 30, 2019
- 9 replies
- 4607 views
Anyone Helps me!
Anyone please show the basic USART's tx/rx code. Or check my CubeMX Project File.
HAL's USART won't work.
it code is generate from STM32Cube.
There is two USART, one(huart2) everytime send data to STM, another(huart1) everytime wait comming data.
But they won't work. For example, I wrote follow code.
```c
void sio_puts(char *str){
HAL_UART_Transmit(&huart1, (uint8_t *)str, strlen(str), 1000);
}
..
int main(void){
...
MX_USART2_UART_Init();
MX_USART1_UART_Init();
...
sio_puts("SerialTest\r\n");
...
while(1){...}
}
```
Params that baud, bit, and etc are correct setting.
Anyone would you show the basic code to use USART.
Maybe there is wrong with CubeMX settings.
I'll attach the .ioc file, so please check it.
Thanks
