Jul 13, 2021
01:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 13, 2021
01:31 AM
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.
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.
7 Replies
Jul 14, 2021
06:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 14, 2021
06:33 AM
Are you debugging a single core or multiple cores?
Jul 14, 2021
06:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 14, 2021
06:39 AM
Hello Scott,
I am using only one core (the second core is always suspended).
I am using only one core (the second core is always suspended).
Jul 15, 2021
04:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 15, 2021
04:27 AM
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.
Jul 15, 2021
05:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 15, 2021
05:00 AM
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?
Or should I look for other (and possibly more expensive) debugging solutions, like PLS UDS, Lauterbach or similar?
Jul 15, 2021
10:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 15, 2021
10:45 AM
If I set:
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.
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.
Jul 19, 2021
07:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 19, 2021
07:12 AM
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.
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.
Aug 26, 2021
06:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 26, 2021
06:47 PM
For FreeRTOS: