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.

CC2530: At 2v, CC2530 factory resets

Part Number: CC2530
Other Parts Discussed in Thread: Z-STACK

Hi,

Since there hasn't been a Z-Stack 3.0.2 release yet, I wanted to ask what working code I could add to resolve the below issue:

There is a bug where some items in NV memory are deleted and set to their default value if the device is booted or running at a voltage close to VDD_MIN_NV. This is because there was no check done to confirm that the NV Item needed to be initialized to the default value. A fix is being formulated to add an NV check during initialization to set the NV item to the default value only if it was actually initialized and did not exist previously.

Is there any code that would serve as a quick fix for this problem?

  • Hi Jack,

    Please find Z-Stack 3.0.2 here: http://www.ti.com/tool/Z-STACK

    According to the release notes, the issue you mentioned has been addressed.



    Regards,
    Toby

  • Is this issue fixed in Z-Stack 3.0.2? Can you point where the modification source code is in new Z-stack 3.0.2 to fix this issue?
  •  Hi. Thanks for the link. Is there going to be a wiki page for proposed fixes like: http://processors.wiki.ti.com/index.php/Zigbee_Known_Issues_and_Proposed_Fixes?

  • Hi YK,

    The fixes can be seen by checking the differences between osal_nv.c and OnBoard.c:

    osal_nv.c:

    Z-Stack 3.0.1 Z-Stack 3.0.2
    N/A
    #include "OnBoard.h"
    #define OSAL_NV_CHECK_BUS_VOLTAGE  HalAdcCheckVdd(VDD_MIN_NV)
    #define OSAL_NV_CHECK_BUS_VOLTAGE  OnBoard_CheckVoltage()
    if ( !OSAL_NV_CHECK_BUS_VOLTAGE )
    {
          return NV_OPER_FAILED;
    }
    if ( ( hotItem( id ) < OSAL_NV_MAX_HOT ) && ( !OSAL_NV_CHECK_BUS_VOLTAGE ) )
    {
         return NV_OPER_FAILED;
    }

    OnBoard.c:

    Z-Stack 3.0.1 Z-Stack 3.0.2
    N/A
    #include "hal_adc.h"
    N/A
    /******************************************************************************
    * LOCAL FUNCTIONS
    */
    // function pointer for low voltage warning callback
    static void (*gpLowVoltageWarning)( uint8 voltLevel ) = (void*) NULL;

    N/A
    /*********************************************************************
     *                  Low Voltage Protectiion Support
     *********************************************************************/
    
    /*********************************************************************
     * @fn      RegisterVoltageWarningCB
     *
     * @brief   Register Low Voltage Warning Callback
     *
     * @param   pVoltWarnCB - fundion pointer of the callback
     *
     * @return  none
     *********************************************************************/
    void RegisterVoltageWarningCB( void (*pVoltWarnCB)(uint8) )
    {
      gpLowVoltageWarning = pVoltWarnCB;
    }
    
    /*********************************************************************
     * @fn      OnBoard_CheckVoltage
     *
     * @brief   Check voltage and notify the callback of the status
     *
     * @param   none
     *
     * @return  TRUE  - The voltage is good for NV writing
     *          FALSE - The voltage is not high enough for NV writing
     *********************************************************************/
    bool OnBoard_CheckVoltage( void )
    {
      uint8 voltageMeasured;
      uint8 howGood;
    
      voltageMeasured = HalAdcCheckVddRaw();
    
      if ( voltageMeasured > VDD_MIN_GOOD )
      {
        howGood = VOLT_LEVEL_GOOD;
      }
      else if ( voltageMeasured > VDD_MIN_NV )
      {
        howGood = VOLT_LEVEL_CAUTIOUS;
      }
      else
      {
        howGood = VOLT_LEVEL_BAD;
      }
        
      if ( gpLowVoltageWarning )
      {
        if ( howGood < VOLT_LEVEL_GOOD )
        {
          gpLowVoltageWarning( howGood );
        }
      }
    
      return ( howGood > VOLT_LEVEL_BAD );
    }

    Regards,

    Toby

  • Hopefully there won't be any issues that arise.
    If there are, we will definitely take note of them, although it may not be specifically in the form of a wiki.
  • Thanks Toby.