This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/MSP432E401Y: Program spins indefinitely while calling GateMutex_leave

Part Number: MSP432E401Y

Tool/software: TI C/C++ Compiler

Hello,

I am using MSP432E401Y with CCS and developing for TIRTOS

I have multiple task having critical region data and I have used Gate Mutex to guard the critical region data

For one of the task, when I make a call to GateMutex_leave, program hangs there and spins indefinitely.

Appreciate any pointers to debug this issue.

I first initialize the mutex and see that it is having proper handle. Then making call to update the critical data where it hangs

Code snippet

void initHumiTempSensor(I2C_Handle hI2C)
{
    GateMutex_Struct mutexStruct;

    GateMutex_construct(&mutexStruct, NULL);
    humiTempMutexHandle = GateMutex_handle(&mutexStruct);

    writeDefaultConfig(hI2C);
}

void updateHumidity(uint16_t h)
{
    IArg mutexKey;

    mutexKey = GateMutex_enter(humiTempMutexHandle);
    gHumidity = h;
    GateMutex_leave(humiTempMutexHandle, mutexKey);
}

Screen shot of the CCS showing indefinite spin

  • Hi Hetal,

    I'm guessing the problem is that you have the GateMutex_Struct as a stack variable. This can get corrupted (depending on the code flow). Either change the GateMutex_Struct to a global variable or use GateMutex_create.

    If this is not it, what does the GateMutex look like in Tools->ROV.

    Todd

  • Hi Todd,

    That solves the problem!

    I thought it would copy the strcut values but it does not!

    Thanks for quick response!

    /Hp