2016-11-03 05:58 AM
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 #uart2016-11-03 07:25 AM
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.Regards2016-11-06 10:49 AM
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.