Problem with HAL_UART_Receive
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-11-03 5:58 AM
Posted on November 03, 2016 at 13:58
hi to all i have this problem, i use STM32L152RE and a SIM900 GSM/GPRS Module,
now if i send the data with HAL_UART_Transmit(&huart1,command_AT,sizeof(command_AT),1000); all work well, but i wont t receive the data, i have the problem because i don't know the data that gsm send me. i write this function but it's don't work: uint8_t risposta[100]; void usart_get_string() { while(__HAL_UART_GET_FLAG(&huart1,UART_FLAG_RXNE)==0){}; for(int kk=0;kk<100;kk++){ HAL_UART_Receive(&huart1,&risposta[kk],1,0xffff); HAL_Delay(1000); } ; } i don't see nothing in array risposta, can you help me? best regards. A. #stm32 #hal #uart
Labels:
- Labels:
-
STM32Cube MCU Packages
-
UART-USART
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-11-03 7:25 AM
Posted on November 03, 2016 at 15:25
Hi,
I suggest that you run and test the UART example under STM32CubeL1 firmware package relevant to the device that you are using: \STM32Cube_FW_L1_V1.6.0\Projects\STM32L152RE-Nucleo\Examples\UARTYou may re-use sections available in the example or get inspired from them.RegardsOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-11-06 10:49 AM
Posted on November 06, 2016 at 19:49
Hi thanks for your response i see this
if(HAL_UART_Receive(&UartHandle, (uint8_t *)aRxBuffer, RXBUFFERSIZE, 5000) != HAL_OK) { Error_Handler(); } don't like this because i intercept the error do you give me other example that i see? best regards A.