Other Parts Discussed in Thread: UNIFLASH, MSP-FET, MSPBSL
I'm working on a programming tool that does a sequence very similar to the sequence shown here:
After successfully programming the CPU my tool called MSP430_Secure() and everything succeeded. I verified the JTAG interface was disabled in both CCS and using the UniFlash tool.
Next, I wrote some code that used the BSL interface to re-enable the JTAG interface using the RESET/TEST/TX/RX lines to the CPU. The sequence I used was:
1) Send the "Rx Password" BSL command with all 0xFF's for the password. This causes a mass erase of the device. I verified a successfully Ack message is received afterwards.
2) I wanted to see what the JTAG signature bytes in 0x17FC-0x17FF were currently set to, so I sent a "Tx Data Block" BSL command and verified the returned value was neither 0x00000000 or 0xFFFFFFFF. I can't remember what the actual value returned was -- it was something like 0x55555555 or 0xC5C5C5C5.
3) I sent a "Rx Data Block" command to write 0x00000000 to addresses 0x17FC-0x17FF. This also returned a successful Ack.
After completing these steps, the JTAG interface worked again. I could read out the device using UniFlash or download and debug code via CCS.
Here's the problem ...
I tried reprogramming the CPU again using my custom tool which calls MSP430_Secure() at the end, but now the MSP430_Secure() call fails with error "Could not secure the device".
If I try to secure the CPU again with UniFlash, I get the same error.
I saw a discussion here (http://microcontrollers108.rssing.com/chan-64320859/all_p1249.html) where someone mentions that MSP430_Configure() might need to be called with first parameter set to CONFIG_JTAG_LOCK_5XX, but all attempts with that failed and there wasn't any documentation to help explain this.
What am I missing? What do I need to write through the BSL commands to get the CPU back to a state where I can once again program the CPU and disable JTAG via MSP430_Secure()?