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.

TPS65381-Q1: Debug Mode

Part Number: TPS65381-Q1

For software debug, I am using TPS_SetMCUSoftwareDebugMode function from sample code.

My question is when i need to exit from diag mode?

How to identity whether program is running without debugger (normal mode) or with debugger (to software debug)?

What changes i need to do to take care above conditions?

If i am not connecting debugger, device should not wait in diag mode and directly it has to continue with other task.

if ((E_OK == RetVal) && (TPS_DEVICE_DIAGNOSTIC == tps_device_state))
{
/*enable and mask the exit from the diagnostic mode*/
RetVal = CDD_PM_TPS_SetRegisterBitField(TPS_SAFETY_CHECK_CTRL,
CDD_PM_TPS_DIAG_EXIT_MASK_START, CDD_PM_TPS_DIAG_EXIT_MASK_LENGTH, 1U);

/*Disable the watchdog reset */

RetVal = CDD_PM_TPS_SetRegisterBitFieldVerify(TPS_SAFETY_FUNC_CFG,
CDD_PM_TPS_WD_RST_EN_START, CDD_PM_TPS_WD_RST_EN_LENGTH, 0U);


/*disable the error pin monitoring*/
/*disable the safe state timeout*/
RetVal = CDD_PM_TPS_SetRegisterBitFieldVerify(TPS_SAFETY_FUNC_CFG,
CDD_PM_TPS_NO_SAFE_TO_START, CDD_PM_TPS_NO_SAFE_TO_LENGTH, (uint8)0U);

RetVal = CDD_PM_TPS_SetRegisterBitField(TPS_SAFETY_CHECK_CTRL,
CDD_PM_TPS_NO_ERROR_START, CDD_PM_TPS_NO_ERROR_LENGTH, 0U);

}

  • Yusup,
    This question needs to be answered by the TMS570 team that wrote the code. I will forward this question to the TMS570 team for you.
  • Hello Yusup,

    You can toggle a GPIO pin to monitor the running program, or you can print debug information to HyperTerminal using printf(..).

    The "debug mode" in the TPS driver is to disable the watchdog reset etc for debugging code in MCU side. This API calling should be commented out or removed for production. If this API (TPS_SetMCUSoftwareDebugMode()) is called in main() for example, the code will enter debug mode whatever the debugger is plugged or not.