Interfacing between Nucleo(STM32F446RET) and A7672s (GSM Module) #2593
-
| I am working on interfacing an A7672S GSM module with an STM32F446RET microcontroller. I am using the STM32duino core, downloaded from the official STM32duino BoardManager Files. However, the GSM module is not responding to AT commands, and I don’t see any output on the Serial Monitor. Hardware Setup: Code: HardwareSerial Serial2(PA3, PA2);
#define gsm Serial2
void setup()
{
  gsm.begin(115200);   // Setting the baud rate of GSM Module
  Serial.begin(115200);    // Setting the baud rate of Serial Monitor (Arduino)
  delay(100);
}
void loop()
{
  if (Serial.available() > 0)
    switch (Serial.read())
    {
      case 's':
        SendMessage();
        break;
      case 'r':
        RecieveMessage();
        break;
    }
  if (gsm.available() > 0)
    Serial.write(gsm.read());
}
void SendMessage()
{
  gsm.println("AT");
  gsm.println("AT+CMGF=1");    //Sets the GSM Module in Text Mode
  delay(1000);  // Delay of 1000 milli seconds or 1 second
  gsm.println("AT+CMGS=\"+910000000000\"\r"); // Replace x with mobile number
  delay(1000);
  gsm.println("I am SMS from GSM Module");// The SMS text you want to send
  delay(100);
  gsm.println((char)26);// ASCII code of CTRL+Z
  delay(1000);
}
void RecieveMessage()
{
  gsm.read();
  gsm.println("AT+CNMI=2,2,0,0,0"); // AT Command to receive a live SMS
  delay(1000);
}Expected Behavior: Observed Behavior: Debugging Attempts: 
 Questions: 
 Additional Information: 
 | 
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 11 replies
-
| Hi @Nikitanagar I don't understand this: 
 This core does not provide such option. Are you sure you used this core? | 
Beta Was this translation helpful? Give feedback.
-
| It is a Nucleo 64 not 32. Your sketch will not build as the default  Arduino_Core_STM32/variants/STM32F4xx/F446R(C-E)T/variant_NUCLEO_F446RE.h Lines 148 to 160 in ffb23d6 But your sketch use those pins for the GSM. So you have to instantiate an other one. | 
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.



Ok.. disable the USB support then Serial will be on the USART...