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.

TMS320F280049C: No erasing of flash bank during programming

Part Number: TMS320F280049C
Other Parts Discussed in Thread: UNIFLASH, C2000WARE

If I flash Flash Bank 0, then Flash Bank 1 is erased. Is there a way to prevent erasing Flash Bank 1?

  • Hello Phil,

    How are you programming the flash? Are you using Code Composer, Uniflash, or using the Flash API?

    Regards,
    Ibukun

  • Using CCS with XDS-100 JTAG probe. I tried various settings under Flash Settings in Properties->Debug->Flash Settings, but none work, Flash Bank 1 is always erased.

    The following settings should not erase Flash Bank 1 -

    Download Settings = Erase and Program

    Erase Settings = Necessary Sectors Only

    But these settings do not prevent erasing Flash Bank 1. The linker has assigned no code nor constants in Flash Bank 1.

  • Well, I have a section defined in Flash Bank 1 in my command linker file. But at worst that should only cause the sector containing that section to be erased.

  • Hello Phil,

    An alternative option is to manually specify the sectors you want to be erased -- this can also be done using Debug > Flash Settings.

    If you have a section defined in Flash bank 1, is your MEMORY section for Flash broken out by sectors or do you have one contiguous section for the entire Flash bank?

    Best regards,
    Ibukun

  • I do not have my Flash Banks divied up into sectors. I will try doing that, although I consider that very annoying and cumbersome..

  • Phil,

    The linker command files provided in C2000ware (e.g. device_support\f28004x\common\cmd\28004x_generic_flash_lnk.cmd) have the flash sectors broken out. You could copy from there.

    Best regards,
    Ibukun

  • So if I divide up my flash bank into sectors, is there a shorthand way to refer to all sectors of the bank? For example, use some notation like

    Flash_Bank0 : >> FLASH_BANK1_SEC0, FLASH_BANK1_SEC1, FLASH_BANK1_SEC2, FLASH_BANK1_SEC3 

    Then to define a section i would just use FLASH_BANK0, for example,

    .text          :>>FLASH_BANK0

  • I haven't broken up my Flash Banks into sectors yet, but unchecked every sector of both flash banks. The CCS and JTAG still erased both flash banks when I flashed either bank.  Sure looks like the flash settings are completely ignored.

  • Hil Phil,

    I am forwarding this thread to our CCS tools experts. Hopefully they can help explain the issue with the debug flash configuration not taking effect.

    Thanks,
    Ibukun

  • Hi Phil,

    What is the exact CCS version that you are using?

    Thanks

    ki

  • My CCS is Version: 11.0.0.00012 

  • I tried with 11.2.0 and the behavior is as expected (unchecking sectors will not erase them). 

    When erasing sectors, CCS will pop up a dialog, indicating that the sector is being erased:

    Does this dialog appear despite all sectors being unchecked?

    Thanks

    ki

  • Can you try updating your CCS version to the latest (12.2)?

    Thanks

    ki

  • NO,  this is a DO-178 (FAA) approved project, The selection of processor, compiler, linker cannot be changed at this point in development.

  • I would appreciate it if you would try to reproduce the problem on 11.0.  You could use one of the example projects in C2000Ware.

  • I can confirm that CCS 11.0 also works as expected. Flash sectors that are unchecked are not erased. 

    There must be some configuration issue. Exactly where are you unchecking these sectors?

  • The Flash Settings I am setting are in Project Properties->Debug->Flash Settings.  I see no other place where flash settings are provided.

  • Can you try setting it in a debug session under 'Tools -> On Chip Flash'?

    For example I created a video attached below where when I first reload the program, it erases all the sectors. Then I go to the flash options and specify all sectors not to be flashed and then when I reload the program, it does not erase the sectors anymore:

  • hint: double-click on the video to full screen.

  • Yes, this method to set the flash setting works, that is, I can program Bank 0 and not erase Bank 1 and vica versa.  However, I would consider the disconnect with configuring the flash setting via Project->Properties->Debug to be major flaw that needs to be fixed. As it is now, if I were to write instructions for someone to load a program, the instructions will be unnecessarily complicated.