STM32L476VGT UART4 with GSM module SIM7000E
Hello,
I'm trying to connect SIM7000E with STM32L476VGT by using UART4 (PA0 as Tx and PA1 as Rx)
I'm already using USART2 to show messages in RealTerm and I can't use the other UARTs because I can't find the pins on the board.
This is the code I'm trying to run :
HAL_UART_Transmit(&huart2, (uint8_t*)"Start program\r\n", sizeof "Start program\r\n", 1000);
char RxTx_Buffer[30] = "";
HAL_UART_Transmit(&huart4, (uint8_t*)"ATE0\r\n", sizeof "ATE0\r\n", 100);
HAL_UART_Receive(&huart4, (uint8_t*)RxTx_Buffer, 20, 500);
if(strstr(RxTx_Buffer, "OK") != NULL)
{
HAL_UART_Transmit(&huart2, (uint8_t*)"Ok\r\n", sizeof "Ok\r\n", 1000);
}
else if(strstr(RxTx_Buffer, "ERROR") != NULL)
{
HAL_UART_Transmit(&huart2, (uint8_t*)"Error\r\n", sizeof "Error\r\n", 1000);
AT_ERROR_FLAG = true;
}
else
{
HAL_UART_Transmit(&huart2, (uint8_t*)"None\r\n", sizeof "None\r\n", 1000);
}
The result I'm always getting is "None" and I don't know why it's not working.
Can someone plz help me with this ?
