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.

CCS/UCD3138: What is the function of " while(DecRegs.PFLASHCTRL.bit.BUSY != 0)" of " zero_out_integrity_word "?

Part Number: UCD3138


Tool/software: Code Composer Studio

 What is the function of " while(DecRegs.PFLASHCTRL.bit.BUSY != 0)" of " zero_out_integrity_word "?

BUSY :Program Flash Busy Indicator ,0 = Program Flash available for read/write/erase access ,1 = Program Flash unavailable for read/write/erase access .

  • Hello,

    Your question has been forwarded to the appropriate person.
  • That loop waits until the write of the zeroes to the checksum is complete.  Since this function is copied into RAM, the write to the program flash has no effect on it.

    If it returns to program flash before the write is complete, the processor will read all ffs from program flash.  This will most likely cause a processor fault, which will reset the system and prevent the write from completing.  So it waits in RAM until the write is complete, and program flash is able to be read properly again.