Part Number: MSPM0-SDK
Hi all,
The Fls_Ctrl.c file in the MCAL 1.0.0 FEE driver contains an unbounded polling loop:
bool Fls_waitForCmdDone(void)
{
/* Wait for command to complete */
while ((FLASHCTL->GEN.STATCMD & FLASHCTL_STATCMD_CMDDONE_MASK) !=
FLASHCTL_STATCMD_CMDDONE_STATDONE) {
;
}
return ((FLASHCTL->GEN.STATCMD & FLASHCTL_STATCMD_CMDPASS_MASK) ==
FLASHCTL_STATCMD_CMDPASS_STATPASS);
}
The M0G TRM does not state that CMDDONE in FLASHCTL->GEN.STATCMD will always be raised at some time. Does the flash controller ensure that CMDDONE is always raised at some time, even if the flash command does not complete normally for any reason?
In case this is not guaranteed by design, should a timeout be added to this polling loop? Which duration? Or should the driver allow other tasks to interrupt it during the polling loop?
Best regards,
François.




