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/UCD3138A: function Zero_Out_Integrity_Word

Part Number: UCD3138A


Tool/software: Code Composer Studio

Hi,

When bootloader, after excuting Zero_Out_Integrity_Word function to clear the checksum. the pFunc_Ptr is set to an illegal location 0x70000 to reset as below. However, the 0x70000 is the location of DPWM2.

Will it cause bootloader failure if I use DPWM2? When I use DPWM2, it clears checksum and seems reset once but does not enter into the ROM and this causes bootloader failure. If I do not use DPWM2, it can

bootloader successfully. Or if I set pFunc_Ptr to 0xF0000 other than 0x70000 to reset or use SysRegs.SYSECR.bit.RESET = 2 after clear the checksum to reset, it also bootloaders successfully. 

can you explain it? Thanks.

 case 12: // clear integrity word.
  {
        {
             register Uint32 * pu32Program_Index = (Uint32 *) 0x19000; //store destination address for program
             register Uint32 * pu32Source_Index = (Uint32 *)Zero_Out_Integrity_Word; //Set source address of PFLASH;
             register Uint32 u32Counter;
             for(u32Counter=0; u32Counter < 500; u32Counter++) //Copy program from PFLASH to RAM
             {
                  *(pu32Program_Index++)=*(pu32Source_Index++);
             }
        }
        {
             register tpFunc_Ptr pFunc_Ptr;
             pFunc_Ptr=(tpFunc_Ptr)0x19000;     //Set function to 0x19000
             pFunc_Ptr();
             pFunc_Ptr=(tpFunc_Ptr)0x70000;     //Set function to illegal location
             pFunc_Ptr();  //force reset
        }    //execute erase checksum
        return;
  }

  • That's interesting.  Even though 0x70000 is a the DPWM, I would expect the device to reset anyway, because the code won't make any sense.  Maybe you have programmed DPWM2 with just the right value to make it jump back to somewhere valid.  Still, I would expect it to at least clear the checksum, because zero_out_integrity word should clear the checksum completely before it returns.  This is the code in zero out integrity word that waits:

    while(DecRegs.PFLASHCTRL_0.bit.BUSY != 0)

    {

    ; //do nothing while it programs

    }

    Certainly the best thing to do is to write to the reset register.  That's what we do in our newer codes.