I was decided to change the main CPU in my project from STM32F407 to a new STM32G473 and update the ChibiOS from 16 to the current trunk, because new CPU start supported here.
The main problem is in that if I switch off all the DEBUG options of the CHIBIOS and set the high level of optimisations of the compilator the program hangs up after not regular periods of time in the following infinite loop:
Code: Select all
file "\ChibiOS\os\rt\src\chvt.c"
...
225 /* The delta list is scanned in order to find the correct position for
226 this timer. */
227 p = vtlp->next;
228 while (p->delta < delta) {
229 /* Debug assert if the timer is already in the list.*/
230 chDbgAssert(p != vtp, "timer already armed");
231
232 delta -= p->delta;
233 p = p->next;
234 }
...
This happenes because one of my virtual timers have NEXT pointer is pointed to itself:
I do not understand how it hapens. If I set the code optimizations to off or switch on the debug options of the ChibiOS the problem is disappere and the program work two days without the crash.
Please help.
How to find the problem? On the old CPU there is no this problem. May be it is some kind of the RACE conditions?
p.s. I'm using periodic SYSTEM TIMER at 2000Hz rate.