When debugging, the interrupt cycle is very long

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User20311
Level 1
Level 1
10 sign-ins 10 replies posted 5 replies posted
IDE:AURIX DS Version: 1.2.0 Build id: 20200617-1233
Project:STM_Interrupt_1_KIT_TC275_LK
Board:TC275KIT
Debugger: infineon DAP miniwiggler
Timer Config code:

/* Function to initialize the STM */
void initSTM(void)
{
IfxStm_initCompareConfig(&g_STMConf); /* Initialize the configuration structure with default values */

g_STMConf.triggerPriority = ISR_PRIORITY_STM; /* Set the priority of the interrupt */
g_STMConf.typeOfService = IfxSrc_Tos_cpu0; /* Set the service provider for the interrupts */
g_STMConf.ticks = TIMER_INT_TIME; /* 500ms Set the number of ticks after which the timer triggers an
* interrupt for the first time */
IfxStm_initCompare(STM, &g_STMConf); /* Initialize the STM with the user configuration */
}
When debugging, the STM interrupt cycle is 38~40s. When the debugger is disconnected and the board is powered on again (not in debugging), everything is OK. The interrupt cycle is 500ms (check the cycle through LED). When debugging again, the interrupt cycle It's wrong again (38~42s)!
0 Likes
4 Replies
User20311
Level 1
Level 1
10 sign-ins 10 replies posted 5 replies posted
question2: How to work with PLS+AURIX DS? Where is the plug-in for PLS for eclipse?
0 Likes
User20323
Level 1
Level 1
snikeguo wrote:

When debugging, the STM interrupt cycle is 38~40s. When the debugger is disconnected and the board is powered on again (not in debugging), everything is OK. The interrupt cycle is 500ms (check the cycle through LED). When debugging again, the interrupt cycle It's wrong again (38~42s)!


The behavior you explain sounds like the STM timer continues to run when the CPU is halted. The counter then overruns, and you get the interrupt when the counter is back at the original value. You can add the STM as a suspend target to resolve the issue.

//STM suspend control
A STM0_OCS L 0x12000000
A STM1_OCS L 0x12000000
A STM2_OCS L 0x12000000
0 Likes
User20311
Level 1
Level 1
10 sign-ins 10 replies posted 5 replies posted
felix.martin wrote:
The behavior you explain sounds like the STM timer continues to run when the CPU is halted. The counter then overruns, and you get the interrupt when the counter is back at the original value. You can add the STM as a suspend target to resolve the issue.

//STM suspend control
A STM0_OCS L 0x12000000
A STM1_OCS L 0x12000000
A STM2_OCS L 0x12000000


Where should I fill this code?
4702.attach
0 Likes
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored
You can add on beginning of your InitSTM function:
/* suspend by debugger enabled */
IfxStm_enableOcdsSuspend(STM);
0 Likes