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.

TMS320F28378S: After enabling DCSM no access to flash bank 1

Expert 2710 points
Part Number: TMS320F28378S
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

After enabling the DCSM to dedicate all RAM and Flash to Z1, I can't access Flash bank 1. Here is the configuration I used:

Fullscreen
1
2
3
4
5
6
.sect "dcsm_zsel_z1"
.retain
.long 0x000000FF ;Z1-EXEONLYRAM
.long 0x00003FFF ;Z1-EXEONLYSECT
.long 0x10005555 ;Z1-GRABRAM
.long 0x15555555 ;Z1-GRABSECT
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The whole bank 1 should be under Z1 or not? I can't read (for example 0x0C0000) from debugger or direct from code. Am I missing something? Without DCSM everything works as it should.

In dcsm_security_tool example, it is not possible to configure flash bank 1 at all! If one uses the example then the flash bank 1 access will be set to 0 = Invalid. Flash BANK1 is inaccessible.

  • Your value for Z1-EXEONLYSECT is  0x00003FFF. This means bit14 (EXEONLY_BANK1) is 0. Below from the TRM:

    0 : Execute-Only protection is enabled for Flash BANK1 (only if it's allocated to Zone1)

    This may be the reason why you are unable to access.

    The whole bank 1 should be under Z1 or not?

    Based on your GRABSECT value, it should indeed be allocated to Z1.

  • Thanks, I missed that bit and now I can read the bank 1 from software. I still can't read bank 1 with debugger, but bank 0 yes. Any ideas why? All the flash are in Z1, and as I can read bank 0 the flash must be unlocked, so why is bank 1 still not accessible from debugger?

  • Thanks, I missed that bit and now I can read the bank 1 from software.

    I presume you are referring to bit14 (EXEONLY_BANK1).

    now I can read the bank 1 from software. I still can't read bank 1 with debugger,

    I am looking into this now.

    On a different note, did you try assigning any memory to Zone0? 

  • With Zone0 you mean unsafe? No, I wanted all to be under the same security zone.

  • Understand you want to assign all memories to Z1 only. I merely wanted to know if you simply tried assigning any memory to Z2. i.e. not with the intent of using that configuration but merely making an attempt to share the memory between Z1 and Z2. Can you please send your Sysconfig file?

  • I did not try with Z2. I do not have sysconfig file. I generated the asm and cmd with the help of dcsm_security_tool example. The only problem with that example is, that you can't assign BANK1 at all. That is why I had also the bits wrong in a first place. I have attached my asm and cmd files.

    dcsm.zip.

  • I will take a look at your .asm and .cmd files, but please see if the below helps:

    There are two banks in this device, Flash Bank 0 and Flash Bank 1. Each bank contains 14 sectors, Bank0 (sectors 0 to 13) and Bank1 (sectors 14 to 27). It is possible to selectively allocate the sectors in Bank0 to either Zone1 or Zone 2 using the Z1_GRABSECTR register or Z2_GRABSECTR register respectively. However, sectors in Bank1 can only be allocated “as a whole” to either Zone1 or Zone2. This is done using GRAB_BANK1 bit-field in Z1_GRABSECTR register or Z2_GRABSECTR register. Note that sectors 0 through 13 of Bank0 are labeled as A through N in the Zx_GRABSECTR registers.

  • Hi JHi,

    There is a bug in the SysConfig tool that prevents configuring bank1 security settings. This will be updated in C2000Ware 5.03

    Thank you,

    Luke

  • JHi,

            I presume you have no more questions and am closing this thread. BTW, we did try your settings on a device and we were able to access Bank1 with the debugger without any issues. 

    dcsm.asmdcsm.cmd