Ravindrakant Jha
Junior Member level 2
Hello,
I am using STM32F407 discovery board for interfacing with GSM module,
I am getting a problem that when i send USART_puts("AT\r") commands then i get the response OK only for the first command ,the second command USART_puts("AT+CREG?\r")do no execute .
But if i send only single command USART_puts("AT+CREG?\r") then i get the response that can be seen on YAT terminal.
Secondly i made a function to send the command AT+CREG? and check response but that function is not returning 1 .
Thanks in Advance
Ravindra Kant
I am using STM32F407 discovery board for interfacing with GSM module,
I am getting a problem that when i send USART_puts("AT\r") commands then i get the response OK only for the first command ,the second command USART_puts("AT+CREG?\r")do no execute .
But if i send only single command USART_puts("AT+CREG?\r") then i get the response that can be seen on YAT terminal.
Secondly i made a function to send the command AT+CREG? and check response but that function is not returning 1 .
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 uint8_t GSM_AT_CREG(char *command) { unsigned int urc_code=0; unsigned int ntwk_status=0; end_flag=0; //this flag i am using in receive interrupt USART_puts(&command[0]); while(end_flag!=1); urc_code=rx_buffer[7];//urc codes +CREG: 0[7],1[9] ntwk_status=rx_buffer[9];//network status if(urc_code==1 || urc_code==2 ) { USART_puts("AT+CREG=0\r"); } if(ntwk_status == 1 || ntwk_status == 5) { // return 1; } }
Thanks in Advance
Ravindra Kant
Last edited by a moderator: