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.
Hi!
I've added F2806x_CSMPasswords.asm to my project, and now every time I flash it, I get the following error message.
C28xx: Flash operation timed out waiting for the algorithm to complete. Operation cancelled.
C28xx: Trouble Writing Memory Block at 0x3f7f80 on Page 0 of Length 0x76
Cannot write to target
If I power cycle the board, the code is executed, and the device is locked with the password written in F2806x_CSMPasswords.asm. Then why I get the error?It seems that the flashing went good.
I know that: For code security operation, all addresses between 0x3F 7F80 and 0x3F 7FF5 cannot be used as program code or data, but must be programmed to 0x0000 when the Code Security Password is programmed.
In my *.cmd file I have
CSM_RSVD : origin = 0x3F7F80, length = 0x000076
and in F2806x_CSMPasswords.asm this locations are programmed to 0x0000.
Is there something else I should do?
Thanks,
Monica
Monica
Seems to me like the flash already has contents programmed which is why you see an error when you try to re-flash it.
Can you provide the sequence on how you go about programming flash and when you perform the lock/unlock.
- Vaish
Hi again!
I've done the programming in both ways. I have this issue only when I use the F2806x_CSMPasswords.asm in the project.
If I flash it and then use the on-chip flash to program the password, and lock the device, I get no error while flashing.
Before flashing, I unlock the device and erase sector A. Question: Why I cannot erase sector A if I'm connected to the board and it is already unlocked? I unlock it OnTargetConnect. I always have to use the unlock from On chip flash. If I use the Script->CSM->Unlock and try to erase sector A after this, I get an error. So I can only erase sector A after unlock with On chip flash. And unlock with on chip flash makes the program run incorrectly, but now it doesn't really matter coz I'm trying to flash a new program.
After erasing sector A I erase all the sectors. I've checked it, there is no program running. Only after this I try to flash again, the project containing the F2806x_CSMPasswords.asm. And it is flashed, I've tried changing the password, the device is locked with the new password. But everytime I get the error. I can leave with it at the moment, but doesn't look reliable. And all this steps that I have to keep in mind, where I can click, where I can't.... confuse me...
Monica
I've tried something else now: unlock, erase sector A, rebuild without F2806x_CSMPasswords.asm and flash. No error. So the device doesn't remain locked, if I do the steps I've described above.
My answers below to your previous post :
Question: Why I cannot erase sector A if I'm connected to the board and it is already unlocked? I unlock it OnTargetConnect. I always have to use the unlock from On chip flash. If I use the Script->CSM->Unlock and try to erase sector A after this, I get an error. So I can only erase sector A after unlock with On chip flash. And unlock with on chip flash makes the program run incorrectly, but now it doesn't really matter coz I'm trying to flash a new program.
[Vaish] The Unlock script doesnt seem to be doing the unlock which is why you are not able to load program after using Gel.
Please check if you are updating the F2806x Gel file with the programmed passwords before using the script for unlocking. By default it writes 0xFFFF in the key registers.
You will need to change it with your programmed passwords (highlighted below) to be able to perform the actual unlock
hotmenu Unlock_CSM()
{
/* Perform dummy reads of the password locations */
XAR0 = *0x3F7FF8;
XAR0 = *0x3F7FF9;
XAR0 = *0x3F7FFA;
XAR0 = *0x3F7FFB;
XAR0 = *0x3F7FFC;
XAR0 = *0x3F7FFD;
XAR0 = *0x3F7FFE;
XAR0 = *0x3F7FFF;
/* Write passwords to the KEY registers. 0xFFFF's are dummy passwords.
User should replace them with the correct password for their DSP */
*0xAE0 = 0xFFFF; /*<replace with new password> */
*0xAE1 = 0xFFFF; /*<replace with new password> */
*0xAE2 = 0xFFFF; /*<replace with new password> */
*0xAE3 = 0xFFFF; /*<replace with new password> */
*0xAE4 = 0xFFFF; /*<replace with new password> */
*0xAE5 = 0xFFFF; /*<replace with new password> */
*0xAE6 = 0xFFFF; /*<replace with new password> */
*0xAE7 = 0xFFFF; /*<replace with new password> */
}
After erasing sector A I erase all the sectors. I've checked it, there is no program running. Only after this I try to flash again, the project containing the F2806x_CSMPasswords.asm. And it is flashed, I've tried changing the password, the device is locked with the new password. But everytime I get the error. I can leave with it at the moment, but doesn't look reliable. And all this steps that I have to keep in mind, where I can click, where I can't.... confuse me...
[Vaish] I understand the frustration.
You seem to have trouble only when you try to re-flash the program on a part with passwords programmed already.
The requirement for CSM is that before flashing using the CCS plug-in, you will need to unlock the device before you try to re-program any flash sector.This is the reason you are able to program the passowrds once Sector-A is erased (since all passwords are erased and device is unlocked)
If you are using the plug-in for programming, the device can be unlocked every time either by :
- using Gel or
- Flash plug-in
-Vaish
Hi again!
I guess you didnt understand what I was saying.
'And it is flashed, I've tried changing the password, the device is locked with the new password.'
How would I know the new password was programmed, unless I change it in the GEL and the device is unlocked using the new password? I unlock it by calling Unlock_CSM() in OnTargetConnect. Of course I change the password. If I can see my variables in debug window, doesn't mean the device is unlocked?
I use CCSv4.
'You seem to have trouble only when you try to re-flash the program on a part with passwords programmed already.'
That's a wrong conclusion. I didn't say this. I have trouble only when I try to flash a project that includes the F2806x_CSMPasswords.asm file.
If I erase all sectors (or flash a version that doesn't have passwords, and I don't program any password with on-chip flash tool) and then try to flash the project with F2806x_CSMPasswords.asm, I get an error. But, as I've said before, I've checked it and it was actually programmed. If I give a false password in GEL it remains locked, if I give the correct one it is unlocked.
The error I get at flashing is:
C28xx: Flash operation timed out waiting for the algorithm to complete. Operation cancelled.
C28xx: Trouble Writing Memory Block at 0x3f7f80 on Page 0 of Length 0x76
Cannot write to target
I've checked the memory and the locations 0x3F 7F80 - 0x3F 7FF5 were not programmed with 0x0000, they are 0xFFFF.
I can reflash it without any problem as long as the project doesn't include F2806x_CSMPasswords.asm. I can then program the password using the on-chip flash.
If you are using the plug-in for programming, the device can be unlocked every time either by :
- using Gel or
- Flash plug-in
Correct, but if I use the flash plug-in, the device starts working wrong after unlock. I can unlock it and erase sector A, but it's not working properly. I can only use the script to have the device unlocked and still run correct after that.
What I've noticed is that when I use the INTOSC1 everything runs well. If I use INTOSC2 or XTAL as clock source, the program doesn't run anymore after unlocking with flash plug-in.
Monica