This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GSM/GPRS module AT Commands on RTOS

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,

Parents
  • 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).

Reply
  • 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).

Children