xmc1300 Debug Error(because of systemreset in mainloop?)

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

cross mob
Stephan_Hochmül
Employee
Employee
Hallo,
I am using Dave 3.1.10 and program a XMC1300 Boot Kit. This worked fine, until a mistake was happened to me. In my application I need to reset the XMC in an interrupt. To try out this function I programmed the attached Code.

#include //SFR declarations of the selected device
#include "uart.h"
#include "gpio_xmc1300_tssop38.h"
#include
#include
#include

extern uint8_t foo[10];

int main(void)
{
uint8_t i;
SCU_GENERAL->PASSWD = 0x000000C0UL;
SCU_CLK->CLKCR = 0x3FF00400UL; // 8 MHz MCLK, 8 MHz PCLK
while((SCU_CLK->CLKCR)&0x40000000UL); // wait for VDDC to stabilize
SCU_GENERAL->PASSWD = 0x000000C3UL;

if(!(SCU_RESET->RSTSTAT & (1<<2))) //check for resetsource
{
for(i=0; i<10; i++)
{
foo=0;
}
P0_1_set_mode(OUTPUT_PP_GP);
P0_1_toggle();
}
P0_6_set_mode(OUTPUT_PP_GP);
P0_6_toggle();
SCU_RESET->RSTCLR=(1< PPB->AIRCR = (1<
uint8_t data[100];
data[99]=1;
uart_init();

while(1)
{

}
return 0;
}

I choose to make a systemreset instead of a software masterreset because the masterreset also resets the debugging core. The program worked fine, and I was able to debug the function. But as I tried to reprogram the XMC I got the attached Error.
1271.attach
It seems to be that the software systemreset locks out the debugger. Is this possible? Is there any way to fix that error?
Yours sincerely Stephan
0 Likes
3 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi Stephan,

For system reset, it is mentioned that it does affect the debug system. Access to debug interface is disabled after every reset even when debug probe is present.

BR
Travis
0 Likes
Not applicable
Hi, Stephan,
I think your program is always doing system reset. So, you could only do the debugging once. After that, the XMC device is always resetting itself and the debugger will not be able to halt and connect with the XMC device anymore.
0 Likes
User7921
Level 3
Level 3
Because of these funny ways to brick the XMC, I have implemented an interrupt on an external pin to automatically switch back to serial bootloader mode when the pin is pulled up for more than 500ms.
This is now part of all of our XMC codes.
0 Likes