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.

MSPM0L1306: Minimum number of pin to re-flash a device

Part Number: MSPM0L1306
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello TI Experts,

considering that:

  • I would like to re-flash a device
  • ALL pins of the device are used for external (GPIO) functions (SWDIO, SWCLK, UART, I2C, invoke: used as GPIO by the application ), except the NRST (which is dedicated)
  • The invoke pin can be tied to ground when I need to re-flash device
  • The NRST is not used for external functions and it can be tied to GND when needed.

Is it correct that if I configure a device to:

  • use fastboot mode to normally avoid checking the invoke pin
  • If the MCU is powered up and a "< 1 second)" negative pulse is generated AND
  • the invoke pin (normally used as a GPIO) is tied to GND level during boot
  • UART pins (normally used as GPIO) are correctly connected to a device that sends commands to erase and flash.

Am I able to reprogram the device?

In particular, can I use UART/invoke pin normally for GPIO and switch to UART/invoke function when BSL is entered by a < 1s pulse on NRST?

Thank you

  • Checking for the second time the device datasheet it seems to be NOT possible to do what I have proposed.

    The fast boot mode DISABLES the invoke pin method.

    If I do not want to implement the possibility to jump into BSL from the application it seems like I need to do not use the invoke pin for other functions. In this case the NRST can be left unconnected (pull-up applied)

    Am I right?

    Thank you

  • Hey Emanuele,

    I didn't follow your proposal exactly, so I will just give some initial comments and we can go from there.  If the BSL_Invoke pin is disabled in the Nonmain/NVM section of sysconfig, then it will not be checked at power up or a reset.  If it is left enabled, then it is only checked at this points in time, (would need to be high to not go into the BSL) but then after power-up, can be used normal.  So, it really just depends on the function of this pin and if that function allows a pull-up resistor, to determine if you can keep the BSL Invoke pin as an option. 

    You can also customize the UART/I2C pins/module used for the BSL in the same BCR section of the NVM.  

    With BSL Invoke disabled, the only way to invoke it still is via the application software.  Maybe you can create a specific I2C/UART command to trigger the software to switch to the BSL for updates. 

    The SWCLK/SWDIO pins still default to programming pins at start-up, but then the application code can reconfigure them for other uses.  Even if these pins default to SWCLK/SWDIO functions, it's also possible the JTAG interface is disabled in the NONMAIN BCR as well.  If that's not the case, it could technically be possible to use these still, but would require connecting before the application code switches them and the application on the board that they are used for to not interfere with their communication.  

    I don't know if I've answered your questions so please let me know if want to discuss any more of this in further detail.  

    Thanks,

    JD

  • Hello JD,

    thank you.

    Yes, you answered to my question.

    Just a small question. Is this really true (see 28.1.2 Physical Interface of Ref Man)?
    "To re-gain debug access to a device which contains software that disables the SWD pins at startup, it is necessary to hold the device in a reset state with the NRST pin during a POR"

    If I read it correctly I can gain access to the MCU SWD, even if I disabled the SWD, by just keeping NRST pin low. Probably it is what it is done by the "unlock" feature I saw somewhere in CCS.

    Regards,
    Emanuele

  • Hey Emanuele,

    No, you are mixing two different things.  The description you posted is about the SWD pins themselves.  If you switch them to a different function in the pinmux, then the only way to switch them back is via the nRST pin as you described.  

    The BCR section of Nonmain controls the SWD module itself.  If you disable the SWD module there, then it will remain disabled even through nRST.  (The debug module, not the pins.)   The only way to reenable the debug module is by resetting the Nonmain memory back to it's default values via a "Mass Erase" or "Factory Reset" which are DSSM commands you can send via CCS. 

    Now, you can also disable Mass Erase and Factory reset and secure Nonmain with the static write protection if you would like to lock the device permanently. In that case, there is no way to regain access to device.  Not even for TI.

    Thanks,

    JD