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.

UCD3138128: How to change pflash size

Part Number: UCD3138128
Other Parts Discussed in Thread: UCD3138FW-BIDI

Tool/software:

Dear TI Experts,

Reference project: UCD3138FW-BIDI

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/948886/ccs-ucd3138128-how-to-configure-cmd-file-for-64k-flash-size?tisearch=e2e-sitesearch&keymatch=UCD3138128%20Flash%20size%2064#

I have found related information regarding this issue at the URL above but have not tested it yet.

I still have a few questions to confirm, as follows:

1. When I modify the corresponding PFlash capacity setting to 64KB, should the parameter following the function call clear_integrity_word(0); also be adjusted accordingly?

Or should the zoiw_address parameter in the "software_interrupt" case 12 be modified? Please provide accurate instructions for the operation.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
void rom_back_door(void)
{
// Call a SWI to clear the integrity words.
clear_integrity_word(0);
}
//==========================================================================================
// pmbus_write_rom_mode()
// Erases the program integrity word in FLASH, then waits for watchdog timer to reset the
// CPU. There is no return code or return from this function.
//==========================================================================================
int pmbus_write_rom_mode(void)
{
rom_back_door();
return PMBUS_SUCCESS; // Note: This line is never reached.
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

2. Are there any specific considerations when programming with the UCD3XXX GUI Tool? (For example: modifying the Flash block checkbox to "Block 0,1 64KB"?)

3. After programming is complete and power is cycled, to switch from ROM to PFlash, which option should be selected?

Thanks.

  • Hello Parrish,

    1. Since you are only expanding the size of block 0 instead of selecting, say block 2, you can keep the the argument of clear_integrity_word() as "0". 
    2. Because of this, you should select the Block 0,1 64kB option in the UCD3xxx Device GUI
    3. You can keep the default Block selected in the GUI when commanding ROM to execute its program.

    Regards,

    Jonathan Wong

  • Dear Jonathan,

    I saw in the previous link that someone mentioned modifying the checksum parameters.
    Could you please advise where this should be modified?
    Is the program location I pasted below correct?

    zoiw_address = 0x7ff8; (Change to 0xfff8?)

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    case 12: // clear integrity words, depending on arg1
    #if (UCD3138128)
    //Note: This clear integrity word covers all cases. It is designed to clear integrity words based on what address the flash block is
    //mapped to when it is called. This is done for code which switches blocks. And it can erase the integrity word at the end of each of 4 blocks.
    //
    //For most applications, it can be simplified considerably if code space is scarce
    //
    //
    {
    register Uint32 * program_index = (Uint32 *) program_area; //store destination address for program
    register Uint32 * source_index = (Uint32 *) zero_out_integrity_double_word; //Used for source address of PFLASH;
    register Uint32 counter;
    if(arg1 == 0) //0 means first block in memory, regardless of which block that is;
    {
    zoiw_address = 0x7ff8;
    if((DecRegs.MFBALR1.bit.ADDRESS == 0) && (DecRegs.MFBAHR1.bit.ADDRESS == 0)) //here if flash block 0 is at 0
    {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hello Parrish,

    I will provide a response on Monday. Thank you for your patience.

    Regards,

    Jonathan Wong

  • Hello Parrish,

    Section 5.2.1 on the Fusion Digital Power Studio User's Guide has information on how to configure the UCD3xxx Device GUI for flashing multiple blocks.

    Yes, that would be correct. You can change the zoiw_address = 0xfff8 in the interrupt.c file.

    Regards,

    Jonathan Wong

  • Dear Jonathan,

    Let me summarize:

    1. When modifying the .cmd file to set the memory size to 64KB, the zoiw_address in case12: if(arg1 == 0) must also be updated to zoiw_address = 0xfff8.

      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      case 12: // clear integrity words, depending on arg1
      #if (UCD3138128)
      //Note: This clear integrity word covers all cases. It is designed to clear integrity words based on what address the flash block is
      //mapped to when it is called. This is done for code which switches blocks. And it can erase the integrity word at the end of each of 4 blocks.
      //
      //For most applications, it can be simplified considerably if code space is scarce
      //
      //
      {
      register Uint32 * program_index = (Uint32 *) program_area; //store destination address for program
      register Uint32 * source_index = (Uint32 *) zero_out_integrity_double_word; //Used for source address of PFLASH;
      register Uint32 counter;
      if(arg1 == 0) //0 means first block in memory, regardless of which block that is;
      {
      zoiw_address = 0x7ff8; //=> need to change 0xfff8
      if((DecRegs.MFBALR1.bit.ADDRESS == 0) && (DecRegs.MFBAHR1.bit.ADDRESS == 0)) //here if flash block 0 is at 0
      {
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    2. During the flashing process, select the "Block 0,1 64kB" option in the UCD3xxx Device GUI.

    3. After flashing, to jump from ROM to PFlash, select the default Block option.

    Is this correct?

  • Hello Parrish,

    Yes, your summary is correct. 

    Are you changing the memory from 4x 32kB to 2x 64kB program flashes? If so, then you may want to comment out the if(arg1 == 2) and if(arg1 == 3) cases and, in if(arg1 == 1), change zoiw_address = 1fff8.

    Regards,

    Jonathan Wong