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.

F28377D secure flash api cannot write to secure flash

Other Parts Discussed in Thread: CONTROLSUITE

I have created a secure bootloader that can upgrade the code in the secure flash. It works well in TMX device, but does not work in TMS device.

The bootloader uses the flash API F021_API_F2837xD_FPU32.lib in controlSuite Device Support v150 to program the flash. This lib is loaded in the _ramfunc and this part of the memory is also secure. Whenever I make the chip secure or just the destination code location secure, the bootloader cannot program the flash.

Just wonder if there is any changes in the TMS devices that may cause this behavior and the work around to this behavior.

Thanks,

Jonathan

  • Jonathan,

    Did you copy the functions in the Fapi_UserDefinedFunctions.c file to ramfuncs that is mapped to a secure location?

    Thanks and regards,
    Vamsi
  • Vamsi,

    There are three functions in Fapi_UserDefinedFunction.c, all of them are copied to the ramfuncs and execute from there. Still does not work in TMS device.

    Jonathan
  • Jonathan,

    As you might know, we have dual zone security for each flash bank. To prevent the corruption of flash operation initiated from one zone by the code running from other zone, there is a semaphore mechanism implemented using FLSEM register (please refer TRM for the definition of the FLSEM register bits @ www.ti.com/.../spruhm8e.pdf). While doing the flash operation from any secure zone, user must grab this semaphore from that secure zone.

    Can you check whether your application takes care of grabbing this semaphore or not?

    Thanks and regards,
    Vamsi
  • Jonathan,

    Adding to what Vamsi said, FLSEM semaphore must be grabbed by code running from respective zones to enable Flash operations on Flash sectors allocated to that zones. On TMX device even if user does not perform this step, flash operations would have succeeded but not on TMS device. So most likely you are facing this issue only. 

    For Zone1, please add following code before doing flash operation-

    DcsmCommonRegs.FLSEM.all = 0xA501; // 0xA502 for Zone2

    This should fix the issue.

    Regards,

    Vivek Singh