Hello, I have started working on ac30m1x64 micro-controller. I have successfully interfaced GSM/GPRS module serially(I2C) and getting acknowledgements for all the AT Commands. I have migrated the same code on CMSIS-RTX(RTOS),but, I cannot see any acknowledgements from the GSM/GPRS(slave) module. I have used RTOS TIMER, osDELAY()function and many more for trial and error. Though failed to get reply from the slave. I cannot even see the "AT= OK" from the slave, I am completely stuck. Please can anyone help me through this?
Thanks,
Q: "Are you sure that the command is being correctly sent from your microcontroller?"
A: "Yes, I think so"
So that's actually a NO - you are not sure.
You need to be completely sure.
You need to prove that all the commands are actually reaching the module in the correct order, uncorrupted.
You also need to prove that all the expected responses - and no unexpected ones - are actually coming from the module, in the correct order, and reaching the microcontroller uncorrupted.
The thread I linked shows a method by which you could do that.
You need to understand what is actually happening in order to diagnose why it is happening - and, thence, to fix it.
"I am new to RTOS."
The RTOS is a red herring here. The GSM module neither knows nor cares whether you use an RTOS or not - all it sees are the commands arriving.
I have copied a part of the program which I am sending to the module. ///////////////////////////////////////////////////////////////////////////////////////// case GSM_STATE_POWERON_WAIT_00: g_stGSMWaitTimer = TMR_SetDelayVal(GSM_POWERON_WAIT0_MSEC); GSMState = GSM_STATE_POWERON_WAIT_1; #if defined(ENABLE_GSM_NOTIFICATION) StSetText(StNoRange, "GSM_STATE_POWERON_WAIT_00"); StDraw(StNoRange); #endif break;
case GSM_STATE_POWERON_WAIT_1: if(TMR_IsTimerExpired(g_stGSMWaitTimer))//wait for 1000ms { M66_PWRKEY_OFF; g_stGSMWaitTimer = TMR_SetDelayVal(GSM_POWERON_WAIT2_MSEC); GSMState = GSM_STATE_POWERON_WAIT_2; #if defined(ENABLE_GSM_NOTIFICATION) StSetText(StNoRange, "GSM_STATE_POWERON_WAIT_1"); StDraw(StNoRange); #endif } break;
case GSM_STATE_POWERON_WAIT_2: if(TMR_IsTimerExpired(g_stGSMWaitTimer))//wait for 1500ms in reset state { M66_PWRKEY_ON; g_stGSMWaitTimer = TMR_SetDelayVal(GSM_POWERON_WAIT3_MSEC); //3000 GSMState = GSM_STATE_SET_AUTOBAUD; #if defined(ENABLE_GSM_NOTIFICATION) StSetText(StNoRange, "GSM_STATE_POWERON_WAIT_2"); StDraw(StNoRange); #endif } break;
case GSM_STATE_SET_AUTOBAUD: UARTSend(U0,(uint8_t *)ATCMD_AUTOBAUD, sizeof(ATCMD_AUTOBAUD)); while (len == 0) { len = UARTReceive((UART_Type *)U0, &Master_Buf_UART0[0], sizeof(Master_Buf_UART0)); } #if defined(ENABLE_GSM_NOTIFICATION) StSetText(StNoRange, "I am in GSM_STATE_SET_AUTOBAUD"); StDraw(StNoRange); #endif if(CmpareStrOnly(Master_Buf_UART0,AT_RESPONSE_ATOK,3) == 1) {
GPIO_SetValue(PD,_BIT(0)); GSMState = GSM_STATE_SET_FIXBAUD; } else GSMState = GSM_STATE_SET_AUTOBAUD; break; /////////////////////////////////////////////////////////////////////////////////////////
First three cases that are GSM_STATE_POWERON_WAIT_00:, GSM_STATE_POWERON_WAIT_1:, GSM_STATE_POWERON_WAIT_2: which are working perfect and helping the module to Power ON. Then, you can see the "case GSM_STATE_SET_AUTOBAUD:", this program I cannot make it work when I migrated program to RTOS platform, but it works perfect without RTOS.
I am using the Keil-RTX(CMSIS-RTOS).
You're not listening, are you?
Please read my previous post again.
There is no point in looking at the code before you have demonstrated what is actually going on between the module & your microcontroller.
And, before posting source code, pay attention to the instructions for posting source code! Look at the picture: www.danlhenry.com/.../keil_code.png - is it not clear?
So Sorry... I will be aware from now. Thanks.