I am trying to interface a GSM sim7600 module with the STM32F446RE, but i am not getting the response on the UART.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-01 12:46 PM
I have checked the PIN they connected in the correct order and on the correct pins. I have checked the GSM module on hyperterminal and it is functioning as intended. I am using the HAL drivers and Kiel IDE.
I am trying to get the response from the command AT which returns
AT
OK
////////////This is for starting up the GSM module ///////////
HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_6);
HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_5);
HAL_Delay(500);
HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_5);
HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_6);
///////////command//////////////////////////
uint8_t at_test[]="AT\r\n";
uint8_t at_gpsinfo[]="AT+CGPSINFO\r\n";
uint8_t answer[100]="";
while (1)
{
HAL_UART_Transmit(&huart3,at_test,6,10);
HAL_Delay(500);
HAL_UART_Receive(&huart3,answer,100,100);
HAL_Delay(500);
HAL_UART_Transmit(&huart2,answer,100,100);
HAL_Delay(500);
}
both the GSM and STM32F446RE are set to 115200
- Labels:
-
STM32F4 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-01 1:11 PM
Perhap learn to use strlen() so you get the character length correct.
The system doesn't buffer while you ignore it for half a second.
Use a scope, check the signals.
Diagram the actual connectivity, you dismissing it doesn't convince me the voltage levels are compatible, nor if you have the rx/tx​ senses correct, the this compounded by "not working"
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-01 1:29 PM
I do not know if this is correct but removing the delay and adding a for loop to the receive function seems to be working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-01 1:30 PM
this is the correct image
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-01 1:31 PM
Thank you, I will look up and use strlen().
