STM32 Systick function call fails

Discussions and support about ChibiOS/RT, the free embedded RTOS.
Post Reply
martinkuhn
Posts: 5
Joined: Mon Oct 07, 2019 1:24 pm
Been thanked: 1 time

STM32 Systick function call fails

Post by martinkuhn »

Hey there!
We are using ChibiOS with nanoFramework on a custom STM32F427 based MCU board. Now we face the problem that the software blocks at random times and triggers a hardware reset. Everytime the software freezes, we are in the timer handler, which is used for the systick. The disassembly revealed, that we branch to a register which contains a null pointer and then run into a usage fault.
The corresponding code is at line 430 in /os/rt/include/chvt.h

/* The callback is invoked outside the kernel critical zone.*/
chSysUnlockFromISR();
fn(vtp->par);
chSysLockFromISR();

Any ideas why this happens?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32 Systick function call fails

Post by Giovanni »

Hi,

It should not happen, try enabling debug options in chconf.h (assertions, checks, state checker, stack overflow, note there is a port option for stack overflow with MPU, enable that too).

It could be a stack overflow corrupting memory, what you are looking at is likely the effect not the cause.

Giovanni
Post Reply