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/UCD3138064: Can I use UCD3138064 to storage Backup Program in the Program Flash 2 ?What I need to pay attention to?

Part Number: UCD3138064

Tool/software: Code Composer Studio

Can I use UCD3138064 to storage Backup Program in the Program Flash 2 ?What I need to pay attention to?

When I download the code that is boot(2k)+user APP (30K,Program Flash 1) ,The chip can erase the burn & download the code;

When I download the code that is boot(2k)+user APP (30K,Program Flash 1)+ user APP (Backup Program ,Program Flash 2),The chip is locked.I don't know reason why the chip locked?

  • There are lots of reasons why the chip can be locked.  Before you program any checksums, you need to make sure that the code communicates, and that you can clear the all the checksums.  If the code doesn't communicate, most often it's because you have done something so that the code is accessing something illegal, and getting reset.  If there is a valid checksum, it will return to the program flash after the reset, then reset again, then return to the program flash again, and so on.  

    The other likely possibility is that it gets stuck in some interrupt in an infinite loop, and doesn't service the PMBus program fast enough. 

    If it is communicating, and the PMBus function works, there can be an issue with the checksum clear function - either it will do something illegal before it clears the checksum and get reset, or for some reason, it won't clear the checksum.  You always need to have the little clear checksum or zero out integrity word function set up in  to compile in ARM mode, otherwise it won't be reliable.  right click on the file in the CCS window, select Build Options, and  Processor options, and select 32 bit mode.  It's too bad you're using boot flash with two codes.  It's much cleaner and less difficult to integrate the download function into the code itself.  

  • Thank your explaintion in detail about the chip is locked.

    And does it have some code or more detail for UCD3138064 to storage Backup Program?

  • We don't have code for a boot flash based dual image code.  It's much more efficient to not to a separate boot code, but to include the download to the other block in the run time code.  However, we do have a code for the UCD128 that shows how to download code to the other sections that could be adapted pretty well.  For that matter, the simple writing to the memory is shown just fine in the standard interrupt code which clears the checksum.

    If you are writing to the other block of flash, the one that code is not being executed from, you don't need to copy the write function to the RAM.  On the 064, you can execute from one block while writing to the other block.  So you just need to make sure that write is enabled in the base address register for the block, write the correct key value for that block to the flashkey register, write the data to the word, and then wait until the flash busy goes away before writing the next byte.  

    It's very simple.  As I mentioned above, you need to be able to clear the bootflash checksum even if the non-boot flash area is corrupted.  

    You can decide which block to put in control either by having some checksums correct, and others not, or you can have both checksums correct, and have a data flash flag to show which block you want to go to.  We use the second technique in the dual image code, and you can copy the code from there.

    We don't make this code available to the mass market, but we have already sent it to your company.  If you want your own copy, just send me a personal message with your email, and I will send it to you too.