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.
Dear Experts,
I am very new to DCSM and I wanted to lock my MCU so others can not read its memory.
in order to try this feature, I changed one bit in the password and pressed 'Program Password'. and I got a success message. after that I pressed 'Unlock' and again I got a success message.
Now, I can not program any more code to my mcu . I get this error message:
I can read the memory using UniFlash. I checked Z1_CSMKEYs and it seems like the password is not changed!! I read 0x47FFFFFF in address 0x5F013 instead of 0x46FFFFFF! (whether I press 'Lock' or 'Unlock')
I don't understand. If the device is locked why the password is not changed? And if not, why can't I program any code on the device?
What is the problem? what am I missing?
Thanks in advance,
Mina
Update: after struggling a lot(!), I found an option in CCS: properties->debug->flash settings (advanced options should be enabled), that I can set Zone1 password that I changed.
still, I am confused! before this, I attached the .asm and .cmd files generated by SysConfig. but they didn't work . Idk what was the problem?
Also, when I could enter Debug, the value in 0x5F013 is 46FF and not 47FF! why UniFlash does not show me the correct value?
p.s. Is there a step-by-step guide for DCSM?
Hi Mina,
The Location 0x5F013 is a DCSM memory mapped register. The password will actually be programmed in the One time Programmable (OTP) location (0x78028) and the contents of which are securely transferred to the DCSM memory space (0x5f000 - 0x5f400) as part of the Security Initialization.
As for the issue you are facing now, Once you have programmed the Password with 0x46FF, For the zone to be unlocked, the new KEY needs to be fed in to unlock the zone. You can modify this value from CCS memory browser from 0x47FF to 0x46FF to see if the Zone is unlocked to actually confirm if the new password has actually taken effect.
If this is confirmed, please note that the passwords have been changed, but somewhere the keys which are provided in CCS are still left in its default values which is the reason for your problem. I am suspecting the GEL file. Please check your GEL file where I believe the CSMKEY being fed in to the DCSM memory space (0x5F1013) is still the old default password. This hopefully will resolve your issue.
Let me know if the above suggestion is helpful to resolve your issue.
Thanks & Regards
Pramod
Hi Pramod,
Thanks for the reply.
After changing the password in (properties->debug->flash settings), I was able to program the MCU. but I wasn't familiar with the GEL file you are referring to, so I checked it. you were right! CSMKEY was 0x47FF in this file. I'm not sure how does changing it to 0x46FF help? is it possible the password that I put in (properties->debug->flash settings) replaces the one in the GEL file? Also, how can I change the password to any new value (such as 0x44FF)?
I have a new question. after programming OTP, is there ANY way to reprogram it and change a 0 to a 1? I'm asking this because I put a .asm file (generated by SYSCONFIG) in my project file, which assigned no flash sector to any zone lock (GRABSECT = 0xAAAAAAAA), and now that I want to change its value, I'm getting an error.
Thanks
Mina
Hi Mina,
It is really dependent on the sequence of events that will happen in CCS. Since the CSMKEY register is modifyable at any point of time and the write from the GEL file comes towards the end, this issue will occur. You could remove the writes that are happening in the GEL by modifying the same if necessary. That way, whatever is written in the flash settings will reflect without any changes.
I have a new question. after programming OTP, is there ANY way to reprogram it and change a 0 to a 1?
As the name suggests, OTP stands for One Time Programmable memory which means a bit which is 0 changed to 1. However you can modify the link pointer to point to a new ZSB (Zone select Block) and re program the security configuration. In order to modify the OTP's the zones have to be unlocked.
Hope this will answer your query.
P.S: If you have new questions which are not a follow-up of the original question , would request you to kindly open a new thread.
Thanks & Regards
Pramod