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: How to enable the debug lock bit by software to store encryption keys by over-the-air firmware update?

Part Number: CC2530
Other Parts Discussed in Thread: CC2533,

During production of our product we didn't set the debug lock bit in the CC2530/CC2533. We were under the assumption that the debug lock bit could be set at a later time with an over-the-air firmware update, if that would be required in the future.

However, we now want to store encryption keys in CC2530/CC2533, so we want to enabled the debug lock bit by software on already produced units.

(Using this code)

uint8    debug_lock[] = { 0xFF, 0xFF, 0xFF, 0x7F };

HalFlashRead(HAL_FLASH_DEBUG_LOCK_PAGE, HAL_FLASH_DEBUG_LOCK_OSET, debug_lock, HAL_FLASH_DEBUG_LOCK_SIZE );
   
if( debug_lock[3] == 0xFF )        // Enable debug lock bit if not already locked
{
    debug_lock[3] = 0x7F;
    HalFlashWrite(HAL_FLASH_DEBUG_LOCK_ADDR / HAL_FLASH_WORD_SIZE, debug_lock, HAL_FLASH_DEBUG_LOCK_SIZE / HAL_FLASH_WORD_SIZE);
}

This code however only works when the debug cable is attached and the software is running in debug mode.

So it appears that the debug lock bit can't be set by the firmware if the CC2530 isn't in debug mode. Since we're doing the firmware update over-the-air, there's no debug cable attached.

Is there any way that we can set the debug lock bit in software without having to physically retrieve and open all products and attach a debug cable? (For example, can we somehow enter 'debug mode' by software, so the debug lock bit can be set or using another workaround )

  • Hi JuMar,

    As you have figured out, and noted in the CC253x/4x User´s Guide section 3.4.1 the flash page the lock bits are located in can only be erased and written to when the device is in debug mode.

    There is no way to make the system enter debug mode by itself, this requires physical toggling of the debug signals.

    Regards,
    Fredrik