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.
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
Hi Jouko,
First a question about the manual version, because I have a version spruhm8e.pdf (sept 2015), and it has a slightly different description of the FLSEM fields, i.e. when SEM=00 "...registers can be written by code running from anywhere without any restriction".
You are right. We have modified the description in new document because it was a bit confusing hence some users were not grabbing the semaphore for secure flash operations (like you mentioned).
The FLSEM also has the KEY field. I wrote it first, and then the SEM field. Perhaps they need to be written in the same cycle??
That is correct. KEY and the semaphore value need to be written together (e.g. 0xA501).
Regards,
Vivek Singh
Hi Jouko,
No problem. Glad to know issue is resolved. Flash pump semaphore is different than this one. I assume sample program you are referring is not securing the device hence it does not switch the flash semaphore.
Regards,
Vivek Singh