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: Reset question

Part Number: CC2530

Hi Team,

A customer needs support on SBL reset.

Chip: CC2530

Stack version:ZHA1.2.2a

Device Type: Coordinator

His requirement: Connecting coordinator and linux gateway via serial port and making a firmware update.

 He referred 《Serial_Boot_Loader_for_CC253x》 and the code worked fine.

His question:

1.The gateway sent a reset command to the coordinator to do a firmware update. But the coordinator didn't  enter BOOT, it entered the beginning of the application code instead.

2.There are two reset function in Zstack: SystemReset() and SystemResetSoft(). He tested both of them:

 2.1. SystemReset()----At any situation, the chip come to application section.

 2.2. SystemResetSoft()-----The chip can enter BOOT on the first time after power on, other times it also come to application section.

 2.3. Power On or pull down reset pin manually, the chip can enter BOOT.

3.In his application the CC2530 can not be powered off and there is no reset button when implementing firmware update, the only way is make a software reset. What changes are needed to reset the program and enter the boot mode to make a firmware update?

OTA is not considered, because the coordinator is designed to connected with linux gateway, so SBL is prefered. Any suggestion will be appreciated.

BR,

Viki

  • Hi,

    See section 11 of Serial Boot Loader for CC2530:

    11. Forcing boot-mode or early jump to Application code.

    The SBL receives control from the reset vector and verifies whether valid Application code is present. If so, then the SBL gives the bus master a window in which to force boot mode or an immediate jump to Application code.

    1. If the CRC is not 0x0000 or 0xFFFF and the CRC-shadow is identical, then the Application code is valid.

    2. If the CRC is not 0x0000 of 0xFFFF and the CRC-shadow is 0xFFFF, then the CRC is calculated over the Application code image area (this will take over a minute.) a. If the calculated CRC matches the read CRC, program the CRC-shadow to this identical value to speed-up future power-ups.

    3. If the Application code is valid, wait for the bus master to send a 0xF8 to force boot-mode or an 0x07 to force an immediate jump to the Application code. a. The default wait for UART and USB transport is 1 minute. b. The default wait for SPI is 50 milliseconds.

    4. If the Application code is valid and the wait expires, jump to the Application code.

    5. If the Application code is not valid, immediately jump to the boot-code without waiting as described above.

    Also, I recommend providing some way for the host to reset the device with the reset pin.

    Regards,
    Toby

  • Hi Toby,

    Thanks for support.

    These are for BOOT process.What the customer need is:

    After application has been started, how can the program jump to the boot program without power down or reset?

    Both SystemReset() and SystemResetSoft()were not working.

    BR,

    Viki

  • For SBL-enabled devices, SBL code executes after any reset.

    If SBL detects that application image is valid (correct CRC) AND the reset was caused by watchdog, then SBL will jump to application code immediately.
    The SystemReset causes a watchdog reset.

    SystemResetSoft is a soft reset, whose purpose is to start application code from beginning.

    Since the intent is for the host to write a new application image to CC2530, modify the application image CRC to indicate this.
    The example of the OTA can be used: 

    void HalOTAInvRC(void)
    {
      uint16 crc[2] = {0,0xFFFF};
      HalFlashWrite((HAL_OTA_CRC_ADDR / HAL_FLASH_WORD_SIZE), (uint8 *)crc, 1);
    }

    Except for SBL, the address of the CRC will be different. Use HAL_SB_CRC_ADDR == 0x2090 (defined in hal_board_cfg.h).
    Then the CC2530 can call SystemReset. Afterwards, the host may write the new application image to the CC2530.