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.

TMS320F28054F-Q1: 28054F_How to apply DCSM

Part Number: TMS320F28054F-Q1
Other Parts Discussed in Thread: TMS320F28054F, UNIFLASH

Hi Experts,

I'm using a TMS320F28054F with InstaSpin.

 - User application is placed in Zone 1 (Z1)
 - InstaSpin project already includes Z1 DCSM-related sections in the linker command file (.cmd)

I attempted the following:

 - Added a custom DCSM .asm file to program Z1 passwords
 - Build completed successfully
 - However, programming fails (via CCS / flash tool)
 - If I remove the .asm file, download works normally

For comparison:

 - On TMS320F280040C, using dcsm.cmd + dcsm.asm works correctly and DCSM is applied

My questions:

 1. Does InstaSpin internally use or reserve Z1 DCSM (OTP)?
 2. Is it possible to apply Z1 password protection on top of InstaSpin while keeping user code in Z1?
 3. Or is it mandatory to move user application to Z2 when using DCSM with InstaSpin?

If needed, I can share error logs.

Thanks.

  • Hello,

    Apologies, I am out of the office until Thursday (3/2). Please expect a reply then. 

    Best,
    Matt

  • Hello,

    I am not aware of any restrictions for the DCSM with InstaSpin. 

    Can you share the error logs for additional context? 

    - InstaSpin project already includes Z1 DCSM-related sections in the linker command file (.cmd)

    Can you try removing these and using only dcsm.cmd sections?

    Best,
    Matt

  • The dcsm setting in my project is as follows

    .cmd
    Z1_SCC_ROM            : origin = 0x3F8000, length = 0x000400
    Z1_SECURE_ROM     : origin = 0x3F8808, length = 0x0044F8
    DCSM_OTP_Z1_P0    : origin = 0x3D7A00, length = 0x000006
    DCSM_ZSEL_Z1_P0   : origin = 0x3D7A10, length = 0x000010
    Z1_DCSM_RSVD        : origin = 0x3D7A20, length = 0x0001E0

    .asm
    enableCSM_Z1 .set 1 ;0-disable CSM, 1-enable CSM

    .sect "dcsm_otp_z1"
    .retain
    .long 0xFFFFFFFF      ;Z1-LINKPOINTER
    .long 0xFFFFFFFF      ;OTPSECLOCK
    .long 0xFFFFFFFF      ;Boot Mode

    .sect "dcsm_zsel_z1"
    .retain
    .long 0xFFFFFFFF      ;Z1-EXEONLYRAM
    .long 0xFFFFFFFF      ;Z1-EXEONLYSECT
    .long 0xFFFFFFFF      ;Z1-GRABRAM
    .long 0xFFFFFFFF      ;Z1-GRABSECT

    .if enableCSM_Z1       ; enableCSM_Z1=1
    .long 0x12345678       ;Z1-CSMPSWD0 (LSW of 128-bit password)
    .long 0x12345678       ;Z1-CSMPSWD1
    .long 0x12345678       ;Z1-CSMPSWD2
    .long 0x87654321       ;Z1-CSMPSWD3 (MSW of 128-bit password)
    .else
    .long 0xFFFFFFFF      ;Z1-CSMPSWD0 (LSW of 128-bit password)
    .long 0xFFFFFFFF      ;Z1-CSMPSWD1
    .long 0xFFFFFFFF      ;Z1-CSMPSWD2
    .long 0xFFFFFFFF      ;Z1-CSMPSWD3 (MSW of 128-bit password)
    .endif

    .if enableCSM_Z1       ; enableCSM_Z1=1
    .sect "dcsm_rsvd_z1"
    .retain
    .loop (1e0h)
    .int 0x0000
    .endloop
    .endif

    The build succeeds when building with this setting, and the following error occurs when debug downloading

    C28xx: GEL Output:
    Zone 1 is Secure.
    C28xx: GEL Output:
    Zone 1 is Secure.
    C28xx: GEL Output:
    Zone 1 is Secure.
    C28xx: GEL Output:
    Zone 1 is Secure.
    C28xx: Flash Programmer: Error encountered when writing to flash memory
    C28xx: File Loader: Memory write failed: Unknown error
    C28xx: GEL: File: C:\TI\28054F_CV_221213\sw\solutions\instaspin_foc\boards\DOOWON_rev1p1\f28x\f2805xF\projects\ccs5\DOOWON\Flash\Doowon.out: Load failed.

    I found a question similar to my question, please check the following link as well.

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/585215/ccs-tms320f28054f-how-to-secure-this-device-with-the-original-otp-contents-all-0s/2150039?tisearch=e2e-sitesearch&keymatch=28054f%2520z1#

  • Hello,

    Apologies, today is a holiday in the US. Please expect assistance to continue on Monday.

    Best,
    Matt

  • Hello,

     3. Or is it mandatory to move user application to Z2 when using DCSM with InstaSpin?

    I misunderstood the history for the F2805xM/F parts. The above statement is the case.

    Zone 1 (+RAML0) on all F2805xF devices is pre-secured by TI at the factory for InstaSPIN-FOC libraries

    You will have to use Zone 2 to secure your application code. Function calls between Zone 1 and Zone 2 are allowed so you should be able to use Zone 2 security. Please confirm there is no data transfer between these two zones because that will not work.

    Please refer to these threads for details:

    Best,
    Matt

  • Hi,
    I am currently testing DCSM Zone 2 security on the TMS320F28054F and would like to share my test results and ask a question.
    Configuration:

    - Flash sectors C, D, E, F are assigned to Zone 2 via GRABSECT
    - All other DCSM settings (EXEONLY, GRABRAM, etc.) are left at default values (not modified)

    Test Results:

    1. Connection via UniFlash is blocked — as expected
    2. Connection via CCS Target Configuration succeeds
    3. After CCS connection, memory read of sectors C, D, E, F fails — returns 0x0000 (as expected for secured zone)
    4. After performing PMF (Password Match Flow) to unlock Zone 2, memory read of sectors C, D, E, F succeeds — correct behavior
    5. However, even before unlocking Zone 2, Flash Erase of all sectors (including C, D, E, F) is possible via CCS

    Question:
    Is it possible to block Flash Erase operations using DCSM Zone 2 security on the F28054F?
    On a different board using the TMS320F280040C, the same Zone 2 security configuration successfully blocks Flash Erase until the zone is unlocked via PMF. This suggests the behavior may differ between device generations.
    Could you clarify whether the F28054F (F2805x family) hardware supports Flash Erase blocking through DCSM, or is this protection only available on newer devices such as the F28004x family?
    Thank you.

  • Hello,

    This shouldn't be possible unless the Flash API functions are executed within Z2 secured memory or the PMF is completed. Let me see

    Source: https://dev.ti.com/tirex/explore/node?node=A__ALkPsnNh-AX68CX3pn1u6A__c2000ware_gen2_module__1kRFgrO__LATEST

    Source: F2805x TRM

    Best,
    Matt