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.

RTOS/CC2650: Using HapiProgramFlash() vs FlashProgram() function from driverlib

Part Number: CC2650
Other Parts Discussed in Thread: TIMAC

Tool/software: TI-RTOS

I'm using TI-RTOS 2.11 that came with the TIMAC sample application.  Which function should I use to write to flash memory (I'm writing an OTA firmware update program), HapiProgramFlash() or FlashProgram()?  And why?

Thanks!

  • Hello Michael,

    Did you check the latest Simple Link release that already contains OAD examples.
    dev.ti.com/.../
    It will probably save you a bunch of time developing your own OTA firmware update program. It uses FlashProgram().

    Regards,
    Prashanth
  • I tried using FlashProgram() to program 128-byte blocks of data into flash memory. The function occasionally returns FAPI_STATUS_FSM_ERROR. I'm not sure why. This doesn't happen when I use 64-byte blocks. Also, HapiProgramFlash() seems to be a renaming macro for MemBusWrkAroundHapiProgramFlash(). Is there a reason for the workaround? I couldn't find any documentation that explains it.
  • I think the root cause of my issues was the code that occasionally generated duplicate packets of data to be programmed into the same flash memory locations. Once that issue was resolved, I was able to use the FlashProgram() function without any issues. This still leaves the question why the HapiProgramFlash() function exists though...