We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
void init_GSM_Modem(void);
const char command_CMGF[]="AT+CMGF=1\r"; //Selecting text modeconst char CtrlZ =0x1A;
const char command_CMGS[]="AT+CMGS=+91989xxxxxxxx\r"; //Phone number to send message to
const char command_AT[]="AT\r";
const char msg01[]="Hello! This is a Test Message via STM32F107"; //Message to be sent
/* Leaving out init_serial, SendChar and GetChar Functions for reducing the code length. */
/*---------------------------------------------------------------------------- * init_GSM_Modem : Initialize Modem Commands *---------------------------------------------------------------------------*/
void init_GSM_Modem(void){ delay2();
puts(command_AT); delay2();
puts(command_CMGF); delay2();
puts(command_CMGS); delay2();
puts(msg01); delay2();
while (!(USART2->SR & 0x0080)); USART2->SR & 0x0000; USART2->DR = 0x1A; //sending CtrlZ command}
int main(void){ SystemInit();
init_serial(); init_GSM_Modem();
while(1) {;}}
This code gives me an error named as error[PE020] : identifier 'USART 2' is not defined while working with it in IAR workbench. Please define me this error and a solution to it.
And what exactly did you come here for when the question you have is about a completely different company's product?