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.

CC430 rf code stuck

Other Parts Discussed in Thread: CC430F6137, CC430F5137

Hello,

I'm working with CC430F6137 for an rf project which collects temperature values from the rf nodes.

CPU gets stuck while trying to read a register by using rf core interface in the function ReadSingleReg

(in Strobe) ;

unsigned char ReadSingleReg(unsigned char addr)
{
unsigned char data_out;

// Check for valid configuration register address, 0x3E refers to PATABLE 
if ((addr <= 0x2E) || (addr == 0x3E))
// Send address + Instruction + 1 dummy byte (auto-read)
RF1AINSTR1B = (addr | RF_SNGLREGRD); 
else
// Send address + Instruction + 1 dummy byte (auto-read)
RF1AINSTR1B = (addr | RF_STATREGRD); 

while (!(RF1AIFCTL1 & RFDOUTIFG) );    // ===> RFDOUTIFG never becomes 1 so infinite loop here <=====
data_out = RF1ADOUTB; // Read data and clears the RFDOUTIFG

return data_out;
}

my observations:

I set the RFDOUTIFG and following trapping flag RFSTATIFG by hand, it stops at the same point again and again. 

Once this error occurs, even if I reset the device same thing happens after a few packet transmission failure . 

Before trapping here, device fails previous transmissions or transmits with CRC error (viewed from RF studio).

Also OUTERR flag in RF1AIFERR becomes 1 , indicates that "Not enough data available for the executed read access."

although the reading process here is implemented correctly. Therefore, I think this is not the root of our unknown  problem.

conclusion:

My life also trapped at the same point.

Any solutions please?

thanks, 

Yusuf

  • Has this problem been solved? I've also observed one issue like this. It is still under debugging. 

  • Can you please try to add the brackets back into the code that was in the original TI version.

    /TA

    unsigned char CC_SPIReadReg(unsigned char addr, char RF_IDx) {
    unsigned char data_out;

    // Check for valid configuration register address, 0x3E refers to PATABLE
    if ((addr <= 0x2E) || (addr == 0x3E)) {
    // Send address + Instruction + 1 dummy byte (auto-read)
    RF1AINSTR1B = (addr | RF_SNGLREGRD);
    } else {
    // Send address + Instruction + 1 dummy byte (auto-read)
    RF1AINSTR1B = (addr | RF_STATREGRD);
    }
    while (!(RF1AIFCTL1 & RFDOUTIFG) );
    data_out = RF1ADOUTB; // this call does not perform auto write

    return data_out;
    }
  • I have met this issue while using CC430F5137.
    Sometimes the program stops in "while (!(RF1AIFCTL1 & RFDOUTIFG) );", and this situation does not happen every time.
    I am not sure what is the root case of this issue, but I find that re-initial the RF core can solve this issue.
    so I use following approach. Each time the program stops in the while loop, re-initial the RF core and than read the RF register again.

    uint8 RF_Read_SingleReg(uint8 addr)
    {
    uint8 data_out;
    uint8 error;

    // Check for valid configuration register address, 0x3E refers to PATABLE
    if ((addr <= 0x2E) || (addr == 0x3E))
    // Send address + Instruction + 1 dummy byte (auto-read)
    RF1AINSTR1B = (addr | RF_SNGLREGRD);
    else
    // Send address + Instruction + 1 dummy byte (auto-read)
    RF1AINSTR1B = (addr | RF_STATREGRD);

    error = 0;
    while (!(RF1AIFCTL1 & RFDOUTIFG) )
    {
    if(error++ >= 0xFF)
    {
    RF_Re_Init();
    return RF_ACCESS_ERROR;
    }
    }
    data_out = RF1ADOUTB; // Read data and clears the RFDOUTIFG

    return data_out;
    }
  • I had same problem and I saw your code and I have  a question.

    What's RF_Re_Init() function? is it the same as InitRadio()?

    What's RF_ACCESS_ERROR value?

    After return RF_ACCESS_ERROR, how we can do? Could you let me know the routine.

  • hi, ChangSeok,

    RF_Re_Init() is used to re-initialize RF core when code stuck happens.

    RF_ACCESS_ERROR is a flag indicating code stuck happens while accessing current register, And code will be resume to access this register after RF core re-initialization.

  • Hi Changseok

    Is RF_Re_init() is same as intRadio();?

    can i use the same function?

    i couldnt find any addr or value for RF_ACCESS ERROR ?

    kindly help

  • Please get RF_Re_Init() and RF_Init() functions for your information.

     

    void RF_Re_Init(void)

    {

                    RF_Reset();

                    RF_Init();

                    RF_Receive_On();

    }

     

    void RF_Init(void)

    {

                    RF_Setting();

                    RF_Write_SingleReg(RF_PA_TABLE0, PATABLE_VAL);

    }

    RF_ACCESS_ERROR is a MACRO definition as follow. 

    #define RF_ACCESS_ERROR 0xFF

    when the RF core access function return state is RF_ACCESS_ERROR, it indicate RF core access failure.

  • One of my customers has found that issue followed some specific ICs after did IC swapping tests between good and problematic boards. So I guess this issue may relate to chip variations .