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: How to stop timer counter while CPU execution is halted for debug when a breakpoint is hit in MSPM0L1306

Part Number: MSPM0L1306


Tool/software:

In our Application, based on timer 0 some check condition will be checked every one millisecond. While debugging when breakpoint hit the timer still keeps running due to which timer 0 IRQ is in pending state(Verified in vector table pending bit is set), after stepping immediately timer IRQ is served and the check condition fails due to which MCU reset (Expected Behaviour)

Is there any way to halt timer while debugging

  • The idea is to set PDBGCTL:FREE=0. Driverlib provides a function so you can e.g.:

    > DL_Timer_setCoreHaltBehavior(TIMER, DL_TIMER_CORE_HALT_IMMEDIATE); // PDBGCTL:{FREE=0.SOFT=0}

    -------------

    Unsolicited: Poking at this register (TIMG8/12) I observed:

    1) The reset value is shown in TRM (SLAU847D) Table 23-37 as FREE=0,SOFT=0 [in red?], but I saw FREE=1,SOFT=1 as soon as I powered up the timer (PWREN=1).

    2) Setting FREE=0,SOFT=1 (DL_TIMER_CORE_HALT_DELAYED) either (a) didn't stop the timer or (b) took so long (>1ms) that I couldn't tell. Setting FREE=0,SOFT=0 did seem to stop the timer at a breakpoint.

    3) TRM Sec 23.2.10 says this will only work with a TIMA, but it appeared to work (setting aside the oddities above) for TIMG8/12.

    [Edit: I just noticed that I did these experiments on a G3507. I expect that the results would be the same on an L1306.]

  • Hi Bruce,

    Thanks for reply 
     
    Yes, if we set FREE and SOFT to 0 foir timer peripheral , the debug is halting the timer counter value increment.


    Thanks again.
     

  • Thank you bruce.