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.

CC1310: If working on flash during a software reset, what would happen

Part Number: CC1310

Hi team,

Here's an issue from the customer may need your help:

If one task is erasing flash and another task calls SysCtrlSystemReset to reset the chip, does the bottom layer wait for the flash erase to complete before resetting the chip? 

Thanks.

Best Regards,

Cherry

  • Hi Cherry,

    There is not a bottom layer wait for the flash erase to complete.

    This is the code for SysCtrlSystemReset 

    SysCtrlSystemReset( void )
    {
       // Disable CPU interrupts
       CPUcpsid();
       // Write reset register
       HWREGBITW( AON_SYSCTL_BASE + AON_SYSCTL_O_RESETCTL, AON_SYSCTL_RESETCTL_SYSRESET_BITN ) = 1;
       // Finally, wait until the above write propagates
       while ( 1 ) {
          // Do nothing, just wait for the reset (and never return from here)
       }
    }

    However, I don't think it is a good idea to let the flash erasing task be preempted while it is erasing the flash. Furthermore the following is stated in the driverlib documentation (please refer to https://dev.ti.com/tirex/content/simplelink_cc13x0_sdk_4_20_01_03/docs/driverlib_cc13xx_cc26xx/cc13x0/driverlib/group__flash__api.html#gace3e1af81dafa8192dc1cd583d246ce9): 

    Please note that code can not execute in flash while any part of the flash is being programmed or erased. The application must disable interrupts that have interrupt routines in flash. This function calls a ROM function which handles the actual program operation.

    So I would suggest that you prevent any other task to run while the flash is being erased.

    Regards,
    Nikolaj