TC4xx promo banner Banner_Aurix_Competition Banner_AURIX_Security-Solution Banner_AURIX_Safety_Products ShieldBuddy TC275 Banner_AURIX_DevelopmentStudio


+ Reply to Thread
Results 1 to 7 of 7

Thread: Timers not stopping properly while step-debugging

  1. #1
    New Member New Member jcastillo is on a distinguished road
    Join Date
    Jul 2021
    Posts
    4
    Points
    45

    Timers not stopping properly while step-debugging

    Dear Aurix Experts,

    I use the STM0 to trigger an interrupt every 1 ms. In normal execution mode, everything works as expected.
    In debug mode, I have configured STM to halt on debug suspend, so I can step through the code and perform some debugging.
    However, even a single instruction step causes the STM0 to advance a few milliseconds, triggering the STM interrupt after every step.
    In practice, this means I cannot step through the application code because the STM interrupt is firing all the time in an endless loop.

    It seems that the debugger is taking a really long time to suspend the STM0 after the CPU is halted (STM0 should be suspended immediately after CPU has performed the requested step).
    Is there any way to configure how timers/peripherals are suspended when debugging is enabled?

    I have read in other posts about disabling interrupts while debugging. This is not a suitable solution for me since it would impact the temporal results of the execution.

    My STM initialization function (using iLLD drivers):

    void SystemTmrInit(void)
    {
    IfxStm_CompareConfig cfg;

    /* Suspend by debugger enabled */
    IfxStm_enableOcdsSuspend(&MODULE_STM0);

    /* Prepare timer compare configuration */
    IfxStm_initCompareConfig(&cfg);
    cfg.triggerPriority = SYS_TMR_ISR_PRIO;
    cfg.ticks = SYS_TMR_PER >> 5; /* 0x186A0U = 1ms@100 MHz */
    cfg.compareOffset =IfxStm_ComparatorOffset_5;
    cfg.compareSize = IfxStm_ComparatorSize_12Bits;

    /* Write configuration in registers */
    IfxStm_initCompare(&MODULE_STM0, &cfg);
    }

    My setup:
    IDE:AURIX DS Version: 1.5.0, Build id: 20210623-0545
    Board: TriBoard TC3X4L
    Debugger: Infineon DAP miniwiggler (on-board)

    Many thanks in advance.

  2. #2
    Intermediate Intermediate
    Infineon Employee
    Infineon Employee
    Scott Winder will become famous soon enough
    Join Date
    Jun 2019
    Posts
    32
    Points
    291.25
    Are you debugging a single core or multiple cores?
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  3. #3
    New Member New Member jcastillo is on a distinguished road
    Join Date
    Jul 2021
    Posts
    4
    Points
    45
    Hello Scott,

    I am using only one core (the second core is always suspended).

  4. #4
    Intermediate Intermediate
    Infineon Employee
    Infineon Employee
    Scott Winder will become famous soon enough
    Join Date
    Jun 2019
    Posts
    32
    Points
    291.25
    I've tested using multiple debuggers and this behavior depends on the debugging environment. Using the built-in USB DAP interface with ADS results in the behavior you describe.
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  5. #5
    New Member New Member jcastillo is on a distinguished road
    Join Date
    Jul 2021
    Posts
    4
    Points
    45
    Is it possible to modify some configuration parameter or register in the debugger/controller to correct this behavior? Otherwise, this would mean that the on-board debugger is pretty much useless.

    Or should I look for other (and possibly more expensive) debugging solutions, like PLS UDS, Lauterbach or similar?

  6. #6
    Intermediate Intermediate
    Infineon Employee
    Infineon Employee
    Scott Winder will become famous soon enough
    Join Date
    Jun 2019
    Posts
    32
    Points
    291.25
    If I set:

    Code:
    CBS_TRC0.B.SUSIN = 1;
    in ADS, I consistently get 599 STM counts per step, which is much better than what was happening before (but still not ideal). This is likely due to the information the miniwiggler exchanges with the device on each step.

    If you want more precise control over the timing, an external professional debugger like one of the ones you mentioned (or iSYSTEM) is recommended. I tested on Lauterbach.
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  7. #7
    New Member New Member jcastillo is on a distinguished road
    Join Date
    Jul 2021
    Posts
    4
    Points
    45
    If I set at the beginning of the core0_main() function:

    MODULE_CBS.TRC[0].B.SUSIN = 1;

    Now I cannot step at all. F5 (step into) or F6 (step over) in Aurix DS remain static in the same instruction.

    Where can I find information about CBS registers? I checked the AURIX™ TC3xx User’s Manual V2.0.0 but CBS registers are not listed there (unless I missed them).

    Thank you very much.

+ Reply to Thread

Tags for this Thread

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.