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.

TMS320F28055: Some problem with DCSM.

Part Number: TMS320F28055

Hi.

Code protection required. Also requires the ability to update the firmware using the bootloader via uart. For this, I decided to use DCSM.

The first experiment was successful but not complete. What was done.

1. First experiment. 

In the files F2805x_DCSM_Z1_ZoneSelectBlock.asm and F2805x_DCSM_Z2_ZoneSelectBlock.asm I changed only Z1-CSMPSWD0 - CSMPSWD3 and Z2-CSMPSWD0 - CSMPSWD3. And it looked like this:

.sect "dcsm_otp_z1"

.long 0xFFFFFFFF ;Z1-LINKPOINTER
.long 0xFFFFFFFF ;OTPSECLOCK
.long 0xFFFFFFFF ;Boot Mode

.sect "dcsm_zsel_z1"

.long 0xFFFFFFFF ;Z1-EXEONLYRAM
.long 0xFFFFFFFF ;Z1-EXEONLYSECT
.long 0xFFFFFFFF ;Z1-GRABRAM
.long 0xFFFFFFFF ;Z1-GRABSECT

.long 0x8844FFFA ;Z1-CSMPSWD0 (LSW of 128-bit password)
.long 0xAAFFEEF4 ;Z1-CSMPSWD1
.long 0xCC55FF21 ;Z1-CSMPSWD2
.long 0x3245FF66 ;Z1-CSMPSWD3 (MSW of 128-bit password)

.sect "dcsm_otp_z2"

.long 0xFFFFFFFF ;Z2-LINKPOINTER
.long 0xFFFFFFFF ;OTPSECLOCK

.sect "dcsm_zsel_z2"

.long 0xFFFFFFFF ;Z2-EXEONLYRAM
.long 0xFFFFFFFF ;Z2-EXEONLYSECT
.long 0xFFFFFFFF ;Z2-GRABRAM
.long 0xFFFFFFFF ;Z2-GRABSECT

.long 0x44FF56FA ;Z2-CSMPSWD0 (LSW of 128-bit password)
.long 0x35F54FFC ;Z2-CSMPSWD1
.long 0x95FF77FF ;Z2-CSMPSWD2
.long 0xFFFDEFFA ;Z2-CSMPSWD3 (MSW of 128-bit password)

I also wrote these passwords in the file f28055.gel and into and into Debug Configurations > Target > F28055 Flash Settings. 

With these settings, everything worked. I was program the device and start and program again. Without keys, I could not read the flash.

2. Second experiment. 

I was change GRABSECT in Z1 and Z2 also I changed Boot Mode in Z1. And it looked like this.

.sect "dcsm_otp_z1"

.long 0xFFFFFFFF ;Z1-LINKPOINTER
.long 0xFFFFFFFF ;OTPSECLOCK
.long 0xFEC5F9F4 ;Boot Mode

.sect "dcsm_zsel_z1"

.long 0xFFFFFFFF ;Z1-EXEONLYRAM
.long 0xFFFFFFFF ;Z1-EXEONLYSECT
.long 0xFFFFFFFF ;Z1-GRABRAM
.long 0x99ECF67F ;Z1-GRABSECT

.long 0x8844FFFA ;Z1-CSMPSWD0 (LSW of 128-bit password)
.long 0xAAFFEEF4 ;Z1-CSMPSWD1
.long 0xCC55FF21 ;Z1-CSMPSWD2
.long 0x3245FF66 ;Z1-CSMPSWD3 (MSW of 128-bit password)

.sect "dcsm_otp_z2"

.long 0xFFFFFFFF ;Z2-LINKPOINTER
.long 0xFFFFFFFF ;OTPSECLOCK

.sect "dcsm_zsel_z2"

.long 0xFFFFFFFF ;Z2-EXEONLYRAM
.long 0xFFFFFFFF ;Z2-EXEONLYSECT
.long 0xFFFFFFFF ;Z2-GRABRAM
.long 0x99ECF67F ;Z2-GRABSECT

.long 0x44FF56FA ;Z2-CSMPSWD0 (LSW of 128-bit password)
.long 0x35F54FFC ;Z2-CSMPSWD1
.long 0x95FF77FF ;Z2-CSMPSWD2
.long 0xFFFDEFFA ;Z2-CSMPSWD3 (MSW of 128-bit password)

I also changed Debug Configurations > Target > F28055 Flash Settings  with new data.

I managed to program the device once, program is started. When I try to reprogram the second time, the device is erased and the more I can not program it. During all the experiments, one chip and XDS100V2 were used.

3. Еhird experiment.

I took another device, programmed it with the latest changes using XDS100V2. The device was programmed and started up sucsesful. Immediately after I tried to read the flash using the Memory Browser of CCS on the device being debugged. The device has been reset, it no longer starts and does not programmed.

Unfortunately, I could not independently understand the reason and how to do what I need to do.
Could you tell me how I can achieve my goal?

  • Hi,

    I have seen your post and will be able to look into this on Monday.

    Thank you for your patience.
    sal
  • Hi,

    DCSM flash memory is OTP. That means one-time-programmable.

    For this reasons we have what is called Zone Select Blocks. Each ZSB has a different starting memory location in OTP. When you want to make changes to the DCSM OTP, you need to update the LINKPOINTER to point to the new ZSB. Also, you will need to align the link address in the linker command file to program the new ZSB which the Linkpointer is pointing too.

    More information is in the Technical Reference Manual.

    Also, once a section or RAM block is locked via the DCSM, data will not be able to be read by code running from a different Zone. If you wish to read the memory you either need to read it from the same zone or unlock the zone.

    Hope this helps,
    sal