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.

RTOS/CC2640: Using a macro causes Sensor Controller to unexpectedly stop working

Part Number: CC2640

Tool/software: TI-RTOS

When I go to Task Testing and/or Code Generator I get an error. Here is the code:

Initialization Code:

// Schedule the first execution at the next RTC tick
fwScheduleTask(1);

Execution Code:

macro read_rtc_sensor(result) {
    
    U16 data = 0;
    
    i2cStart();
    i2cTx(0xD0 | I2C_OP_WRITE);
    i2cTx(0x11);
    
    // If successful ...
    if (state.i2cStatus == 0x0000) {
        
        U16 msb;
        U16 lsb;
        
        i2cRepeatedStart();
        i2cTx(0xD0 | I2C_OP_READ);
        i2cRxAck(msb);
        i2cRxNack(lsb);
        
        data = (msb << 8) + lsb;
        
    }
    
    i2cStop();
    
    // Handle errors, if any ...
    if (state.i2cStatus != 0x0000) {
        // handle errors
    }
    
    result = data;
    
}


U16 result;
read_rtc_sensor(result);

Termination Code:

None

Here is the error I get:

Clicking on debug leads to this:

Please help, I'm at a loss here on how to proceed.