Hi Tom
The thread deals with writing to memory using the backdoor accesses and not backdoor keys.
After some more experimentation (and extra debug support) we have found some interesting new details.
1. Originally the FLASH configuration is set up as
0x11223344
0x55667788
0x00000000
0x00000000
0x00000000
0x80004ac8
2. Using the original code together with the method of writing via back door
fnWriteLongWordFlash(ulKeyLocation++, key[0]);
fnWriteLongWordFlash(ulKeyLocation, key[1]);
does in fact work!
What we find is that issuing the backdoor key sequence unsecures the device temporarily (until next reset).
However, if an incorrect back door key is tried, it actually overwrites the original.
If, for example, 11223340 is attempted, the FLASH content afterwards is:
0x1122334
00x55667788
0x00000000
0x00000000
0x00000000
0x80004ac8
The backdoor keys have been overwritten (?) and then the access code works with the new one after a reset. If the values 0x00000000 are attempted, they are no longer valid so unsecuring is no longer possible. Since we hadn't seen this before, the unsecure looked as if it was always failing, although it obvioulsy does work in a way.
As well as this unexpected behavious it also throws up a new question as to the use of the unsecure capabilitly. Since connecting a BDM to the board generates a reset, it simply secures itself again so still doesn't solve any problems.
Therefore we have tried simply issuing a mass erase (after password protection). This deletes all code, including the FLASH configurations and so leaves the board in a state with no traces of original program and with BDM capabilities. This is in fact a better level of security... but it would still be interesting to understand the backdoor key method and its possible limitations.
Regards
Mark