Other Parts Discussed in Thread: CONTROLSUITE
Tool/software: Code Composer Studio
Dear Expert,
I am debugging F28377D within CCS6.1.1 environment. I have code to program 8 words to the flash memory of CPU2. I use the flash API example program from the Controlsuite device_support, v200 ( but downloaded the latest F021 library). Writing to the flash goes ok when debugging in the nonsecure mode. However, when I program the CSM and lock the device, programming fails. Other code runs ok when secure.
The flash programming routine runs in the secure RAM zone D1, and the sector to be written is L, i.e. starting from 0xBA000. The whole flash is also set secure, i.e. I have codes 0x15555555 in the Z1_GRABSECT, and 0xD0005555 in the Z1_GRABRAM. I have the default Z1 zone, i.e. linkpointer all F's.
The flash programming instructions say that if both the programming code and the flash are secure, writing should not need unlocking. However, I also tried with a version where I run the unlocking routine before calling the F021 routines, but the result was still unsuccessful.
For some reason, I also needed two subsequent flash erase F021 calls before successful writing in the nonsecure mode. These are also included in the secure version. I guess the optimization levels do not have any importance here, because everything is done in the library functions? (I have -O 1 and speed vs. size at 5), the clock frequency is 180MHz.
I could not find any mention about the flash ECC memory range secure/nonsecure settings, so I guess it is irrelevant? I just noticed that if I use the flash write example that does not include the ECC for CPU2, then CPU1 receives a boot error from CPU2, therefore I need to use the ECC write version.
Any ideas what goes wrong? Debugging is quite difficult when the secure lock is set, so I would need an expert opinion!
Best regards,
Jouko