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.

TLIN1431-Q1: -

Part Number: TLIN1431-Q1


Tool/software:

I am facing issue while configuring Window watchdog as below,

CASE 1: When I flash software using IAR workbench with Seggar J-Link debugger, software seems running fine. please refer screenshot below.

CASE 2: If i perform Power OFF --> Power ON with 12v Powersupply, MCU sends valid SPI command however MISO line stays always HIGH. After ~170ms MCU gets reset and same sequence repeats. Please refer screenshot below,

Below is my code:

Could you please review code and provide hints why this issue might occure?

Thank you in advance!

  • Hi Halappa,

    I would recommend to add print statements or debugging outputs to help verify which states are being entered during execution I.e., tracing if the watchdog service case is reached. See below hints, thanks.

    • Not ensuring that the watchdog timeout is correctly set per the timing of servicing aligning with your application's loop frequency.
    • Not ensuring the SPI is set up correctly before sending commands I.e., clock polarity, phase, etc. are consistent.
    • Not ensuring that the device goes through a proper initialization sequence after a power cycle, if any dependencies that may mot be initialized correctly after power on.
    • If feasible, verify and test with a minimal version of your code that only initializes the watchdog and SPI so as to help isolate the issue

    Per Your code:

    • Watchdog service handling: Ensure this line is executed at a frequency that meets the watchdog timeout requirements, I.e., If this state is not reached often enough, the watchdog could cause an unintended reset.

    case SBC_SERVICE_WATCHDOG:

        SBC_WRITE(REGS_MD_INPUT_TRIG, 0xFF);

        break;

    • State transition management: Verify how SbcTl1431_State transitions into SBC_SERVICE_WATCHDOG. If there are logic issues preventing the transition, the watchdog may not be serviced in time.
    • Closed window handling: This code seem to guarantee a transition to SBC_SERVICE_WATCHDOG every time SBC_CLOSED_WINDOW_IDLE is entered, since closedWindowStayIdle is always set to 0 here. Confirm whether this is intentional, or if closedWindowStayIdle should be conditionally assigned elsewhere.

    case SBC_CLOSED_WINDOW_IDLE:

        closedWindowStayIdle = 0u;

        if (closedWindowStayIdle == 0) {

            SbcTl1431_State = SBC_SERVICE_WATCHDOG;

        }

    Best Regards,

    Michael.

  • Thanks Michael for quick response.

    Regarding Watchdog servicing , i have used e.g.configuration provided in datasheet,

    This is verified in CASE1 mentioned in above my query (where reset does not occure). I see watchdog is serivced every 49.45ms frequency.

    However I have doubt on first watchdog trigger made, as per my code it happens after MCU startup at ~15ms, 65ms,115ms,165ms, 215ms......so on. So first trigger at ~15ms is valid or I need to take care of some requirement ?

    I will double check suggested below points in meantime,

    • Not ensuring the SPI is set up correctly before sending commands I.e., clock polarity, phase, etc. are consistent.
    • Not ensuring that the device goes through a proper initialization sequence after a power cycle, if any dependencies that may mot be initialized correctly after power on.
  • Hi Halappa,

    Yes, if you are using the window, the watchdog expects servicing within a valid window and triggering too early can count as a violation causing a reset.

    I would recommend to wait after 25 ms before servicing the first time I.e., you may delay your first window to about 30 ms or later by adding a safety delay after MCU reset, thanks.

    DelayMs(30); // waiting for watchdog window to open

        SBC_WRITE(REGS_MD_INPUT_TRIG, 0xFF); // services watchdog

    Best Regards,

    Michael.

  • Hello Michael,

    I am currently doing board bringup activity and as you suggested I have minimized my code asbelow ,

    1. I have disabled window watchdog using  SBC_WRITE_CMD(REG_WD_CONFIG_1, 0x00u);

    2. I am toggiling GPIO PIN PA0 every 10ms.

    This seems working fine as long as debugger USB is connected to my PC.

    However if I remove USB cable of debugger from PC, software is not running. 

    The moment if I put back debugger USB , again it works fine.

    So, Do you think its still WDT issue or it could be some other problem?

    Can you please provide some hints where to check further? 

    Best regards,

    Halappa

  • Hi Halappa,

    This indicates the debugger powers or stabilizes the board and the board might not be receiving stable power or missing a voltage rail and would recommend measuring all critical power rails, confirming the voltage regulator is not disabled or sagging under load when debugger is removed while further ensuring the board has a standalone power source when debugger is removed.

    Improper initialization can also lead to your observations and will recommend ensuring all other peripherals especially GPIOs and clocks are properly initializing before toggling and ensure the MCU's boot states at power-on are pulled to the correct logic levels, thanks.

    Best Regards,

    Michael.