Single Stepping with debugger gets stuck in the TC0_Handler

Discussion around product based on ARM Cortex M4 core.

Moderators: nferre, ncollot

Schnauzer
Posts: 1
Joined: Thu Sep 25, 2014 12:51 am

Single Stepping with debugger gets stuck in the TC0_Handler

Thu Sep 25, 2014 1:22 am

I have both a SAM4S Xplained Pro and a SAM4S_EK2 evaluation board and they both exhibit the same problem when debugging.

The problem is once the Timer/Counter interrupts are enabled, if you then try to single step with the either the Atmel-ICE on the SAM4S_EK2, or the embedded EDBG debugger on the Xplained Pro, the execution always goes immediately to the TC0_Handler and you can never get back out of it by doing a Step Over (F10) debug command. Also, If you do a Step Out (Shift-F11), the execution goes to the main loop but as soon as you do the next Step Over (F10), it immediately returns to the TC0_Handler and you are back where you can’t get out of the Handler by doing Step Overs (F10’s). If you just let the application continue though, the application works correctly.

This implies that the debugger Step Over (F10) command is affecting the setting and clearing of the TC0 interrupt. I am using Atmel Studio 6.2, and ASF 3.19. This behavior can easily be observed by debugging the "Getting Started" example for the SAM4S_EK2 (it blinks some LEDs). I found this problem while getting the Light Weight Mesh example, WSNdemo up and running and that had the same problem on both evaluation boards.

I tried changing the optimization levels, but to no avail, the problem persists.
Sam4Devo
Posts: 5
Joined: Wed Jan 21, 2015 11:39 am

Re: Single Stepping with debugger gets stuck in the TC0_Hand

Wed Jan 21, 2015 12:02 pm

Seems like I have exactly the same problem. Did you figure out how to solve it?
NigelF
Posts: 4
Joined: Wed Feb 25, 2015 6:38 am

Re: Single Stepping with debugger gets stuck in the TC0_Hand

Wed Feb 25, 2015 7:12 am

Using AS6.2 and SAM4S Xplained Pro.

Same problem here except my debugger always goes to a DAC/DMA handler. These interrupts occur at a rate of 75 to 100 mS, sometimes less.

If I disable this one interrupt I can step in the code. (All other interrupts were still enabled.)

The DMA interrupt priority was 3, I tried 5 and still could not step without going to the handler. Then I tried priority 7 and I could step.

The code where I was stepping is called from a 10 mS interrupt. The RTT interrupt is used (although the RTT itself is not used). The RTT interrupt is triggered from an NVIC_SetPendingIRQ() via a 1mS SysTick handler. The priority of the RTT (effectively a software interrupt) is 6. So by setting the DMA int priority to 7 I simply avoid getting interrupted.

Having to reorder interrupt priorities in order to step is very annoying.

Hope this helps. If anyone knows a way to make single stepping work without hitting these ISRs I would love to know how.

Nigel

Return to “SAM4 Cortex-M4 MCU”

Who is online

Users browsing this forum: No registered users and 2 guests