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?