2017-08-04 06:48 AM
i have build with stm32cubemx usart 3 pc10 pc11 pin of stm32f446 115200,n,8,1 full duplex use with interrupt and receive interrupt not working all working fine if use alternate function uart4 on the same pin i think that there are many special setting
in the case of usart3 have you any idea ?2017-08-04 09:30 AM
Hello fabio!!
1. In USART3 configuration you used
__HAL_UART_ENABLE_IT(&huart3,UART_IT_TC);
__HAL_UART_ENABLE_IT(&huart3,UART_IT_RXNE);There is no need to use this. All interrupts enabled automaticaly.
2 in both configurations you don't wait for completion of rx function. . and you transmit a byte just after you try to receive a byte.
2017-08-04 10:33 AM
can you send me init of usart structure for async rs232 115200,n,8,1 the struct is different from uart and not an have an example
2017-08-05 06:31 AM
Your initialization code looks fine.. except ..
Delete inside the file stm32f4xx_it.c and inside the USART3_IRQHandler(void) the
HAL_UART_Receive_IT(&huart3,rx_s,1);
remove the
__HAL_UART_ENABLE_IT(&huart3,UART_IT_TC);
__HAL_UART_ENABLE_IT(&huart3,UART_IT_RXNE);from main.c file
2017-08-07 01:55 PM
Dear Vangelis Fortunas thank's for your reply
yes is true the 2 line of code
__HAL_UART_ENABLE_IT(&huart3,UART_IT_TC);
__HAL_UART_ENABLE_IT(&huart3,UART_IT_RXNE);are not necessary
the presence in the interrupt routine of
HAL_UART_Receive_IT(&huart3,rx_s,1);
is necessary because if remove the line only first receive caracter is stored and rx interrupt then stop.
i have write a simple echo teminal that woking fine at 460kbit 1kbyte data echo
BUT
there is a BUG or a strange behavior in the library or in the core wen you map in the ST32f446VE pin PC10 and PC11 the uart4 all working fine wen you map usart3 in the same pin the rx interrupt not working.Remember that i use of usart2 with the same setting on the pin pa2 and pa3 and all working fine.
2017-08-07 05:12 PM
Hello again!
>'the presence in the interrupt routine of
HAL_UART_Receive_IT(&huart3,rx_s,1);
is necessary because if remove the line only first receive caracter is stored and rx interrupt then stop.'
First of all, inside your main() function, you called HAL_UART_Receive_IT(&huart3,rx_s,1); this means that you requested from port only one byte.!!
If you want to request another byte you must do it
not inside IRQ handler
but in your loop or somewhere else .The most posible is to have a HAL Lock stituation!