Skip to content

Commit cff5359

Browse files
bogdanovsjpanisbl
authored andcommitted
simplelink_lpf3: ti: devices: cc23x0r5: Fix not sufficient flash status
Fix FlashCheckFsmForReady which always returns FSM_BUSY if nothing was written to flash before check. Default STATCMD reg value indicates that CMDDONE - false. If CMDINPROGRES is ok, it is safe to continue. Signed-off-by: Stoyan Bogdanov <[email protected]>
1 parent b199a1d commit cff5359

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

simplelink_lpf3/source/ti/devices/cc23x0r5/driverlib/flash.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ __STATIC_INLINE uint32_t FlashCheckFsmForError(void)
153153
//*****************************************************************************
154154
__STATIC_INLINE uint32_t FlashCheckFsmForReady(void)
155155
{
156-
if (HWREG(FLASH_BASE + FLASH_O_STATCMD) & FLASH_STATCMD_CMDDONE_M)
156+
uint32_t reg = HWREG(FLASH_BASE + FLASH_O_STATCMD);
157+
158+
if (((reg & FLASH_STATCMD_CMDINPROGRESS_M) == 0) ||
159+
(reg & FLASH_STATCMD_CMDDONE_M))
157160
{
158161
return (FAPI_STATUS_FSM_READY);
159162
}

0 commit comments

Comments
 (0)