PlatformIO Community

SysTick_Handler misbehaving on Infineon XMC1100_XMC2Go board

Hello community!
I am facing the following problem on XMC 2Go using Platform Io plugin core 6.0.2 on Visual Studio code version 1.68.1 :
I am trying to duplicate the blinking LED code from Infineon’s DAVE app as an introduction project to Platform IO.
While trying to configure the systick timer using api -
"SysTick_Config(SystemCoreClock /TICKS_PER_SECOND);" where Ticks per second is defined as 10.
The program becomes non responsive for around a minute and then normal execution is restored.

Also the "void SysTick_Handler(void)" is not called (verified by means of setting breakpoints) after the program execution restores. Here are some code snippets:

Kindly suggest what am I missing or doing wrong.
Thanks in advance for all the help and support. :slight_smile:

When you use board = xmc1100_xmc2go, the only available frameworks is either framework = arduino or no framework at all (baremetal).

Looking at your setup() function and usage of pinMode etc, you have chosen the Arduino framework, which means you are using the Arduino core

That Arduino core however already does al the necessary low-level setup in regards to the systick before setup() is even reached.

So you calling into that function too might screw up Arduino internals.

Two suggestions:

  • use the Arduino framework as intended – meaning to blink an LED, you use this code. This should be really simple to verify. (Note: LED_BUILTIN maps to this pin definition, aka GPIO P1.1)
  • if you want to copy that DAVE example into PlatofrmIO, do not use framework = arduino as a base, but remove that line. You will then have to copy all source code into src/ and build from there. (I’m refering to e.g. to the FreeRTOS_EXAMPLE_XMC11 example). This means that 100% that example code will be used and no Arduino framework code.

Hello Max,
Thanks for your detailed response. I went with option 1 stated in your reply. :grinning: