Question
Problem with HAL_UART_Receive
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