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.

MSP430F5229: How to check if JTAG interface of MSP430F5229 is locked

Part Number: MSP430F5229

Hi,

    I refer Replicator430Xv2 to make a program tool for MSP430F5229.

   Then I use that tool to program random data into MSP430F5229.I am sure that I do not lock JTAG.

   But I connect MSP430F5229 which has been loaded random data again,The tool find that JTAG of this device has been locked.

   Calling  IsLockKeyProgrammed()will get STATUS_OK.

   I am sure I do not lock JTAG.

   Would you give some advise?

   How to check if JTAG interface of MSP430F5229 is locked after Power on?

Thanks~

xin

   

  • Hi Xin,

    When you say some random data has been loaded, I think this could potentially be the problem. Where do you load data - does it include the BSL area of memory? If so, if addresses 0x17FC-FF are programmed with anything other than 0xFFFF or 0x0000 then the JTAG is locked. So if you filled the BSL area of flash with random data, then the device would be locked because the BSL area of flash is from 0x1000-1800 and includes those addresses.

    Even if you do not write to the BSL area, you could make the device inaccessible by filling it with random values, depending on what they are - if the device starts up and tries to execute code but it's really random values that it is interpreting as code, depending on what the values are you could have erratic code execution leading to constant resets such that the device is not accessible via JTAG even though the JTAG is not locked.

    A safer way to test would be to load a real code image like blinky, and then append the random values. That way there is valid code preventing erratic execution, but you can still fill the memory (make sure to leave 0x17FC-17ff alone if you test programming BSL flash).

    Or, if you want to keep as much randomness as possible, you could choose an address, e.g. the first address of the flash, and load that with 0x3FFF because that corresponds to jmp$ or loop in place. Then, load 0xFFFE with the value of this address (e.g. first address of flash). Then everything else could be random. The reason to do this is so that on a reset, the device checks the reset vector at 0xFFFE to see where to start executing code - it jumps to that address of flash, and then would see the jmp$ instruction or loop-in-place, and just stay there forever, preventing erratic code execution.

    I hope this helps.
    Regards,
    Katie
  • I also meant to ask, is there a reason you are using the Replicator code for the programming, instead of the BSL? It is often much easier to write a BSL bootloader host rather than a JTAG/SBW host, because the BSL is based on simple UART protocol.
    Regards,
    Katie
  • Hi,Katie,

         Thanks for you quick response.

         No.I do not load the BSL memory.

         I have tried to reconnect programmed device many times.I can connect the device successfully occasionally(I can get JTAG ID, pass secure check and read back main flash).

         I guess there is an time window to through the secure check for the device with error code.

         If I load the random value to device by JTAG,is there any  way to setup JTAG again?How to control the strict JTAG setup process?

        Why  I select JTAG to program the device?

        Because 

        1.The test board only provides JTAG;

         2.It is easy for me to make JTAG host.

         Thanks~

    Best regards~

    Xin

  • Hi Xin,

    Thanks for the additional information.

    Xin Chen said:

         I have tried to reconnect programmed device many times.I can connect the device successfully occasionally(I can get JTAG ID, pass secure check and read back main flash).

         I guess there is an time window to through the secure check for the device with error code.

         If I load the random value to device by JTAG,is there any  way to setup JTAG again?How to control the strict JTAG setup process?

    On one of the few times where you are able to successfully connect to the device, try performing a mass erase. This should theoretically get rid of any erroneous code execution (random values that you programmed) and therefore I believe should make it easy to connect to JTAG again. Then afterwards I'd recommend working with real code images, or do the method I mentioned above of setting the reset vector and having a safe 3FFF instruction at the address the reset vector points to.

    Regards,

    Katie

  • Your device is locked by bad code. Simple way for unlocking is by using mass erase with preloaded TI USB BSL. If this option is disabled, not possible, or not working, than can be used forced repeatable (replicator) JTAG mass erase (with ignoring all JTAG / shiftings errors).

  • Hi,Katie,

        I understand.

        Thanks~

    Best regards~

    Xin

  • Hi,Zrno,
    Thanks~
    Best regards~
    Xin

**Attention** This is a public forum