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.

CC1352R: Possible bug in oad.c: endless loop

Part Number: CC1352R

Environment: simplelink_cc13x2_26x2_sdk_4_10_00_78, but the newer simplelink_cc13x2_26x2_sdk_5_20_00_52 has the identical function.

In my setup, function oadFindExtFlImgAddr() in oad.c may enter an endless loop and never return.

What happens is that oadFindleastRecentlyUsedIdx() doesn't find anything and returns EFL_META_PG_INVALID, however, that value is not being expected/checked in the calling function.

Please advise



PS: I figure some code ought to be added there:

while()
{
 ...
 uint8_t leastRecentlyUsedIdx = oadFindleastRecentlyUsedIdx(extImgInfo,
 OAD_EFL_MAX_META);
 if (leastRecentlyUsedIdx < OAD_EFL_MAX_META)
 {
   ...
 }
 // NEW CODE to handle invalid Idx
 else
 {
  // do something
  break; // leave loop
 }
}