- ChibiOS version: stable-21.11.x branch (commit: 11114387c22042b4fc32095c820f31b024bef97b)
- Demo code based on: demos/STM32/RT-STM32C071RB-NUCLEO64 (from stable-21.11.x branch, commit 11114387c22042b4fc32095c820f31b024bef97b)
- IDE: VS Code w/ Cortex-Debug Extension
What is working:
- Compilation of code works
- Flash to board works
- Run code on chip works, until it gets to chThdSleepMilliseconds()
- Additionally, just to ensure that the chip have no unexpected problem; I confirm that it works with a blink script based on Arduino framework.
My example code:
Code: Select all
#include "ch.h"
#include "hal.h"
volatile uint8_t i = 0;
int main(void) {
halInit();
chSysInit();
while (true) {
palClearLine(LINE_LED_GREEN);
chThdSleepMilliseconds(500);
palSetLine(LINE_LED_GREEN);
chThdSleepMilliseconds(500);
i = i + 1;
}
}
The system stops at line 11: chThdSleepMilliseconds(500);
In detail it seems to stop at: chThdSleepMilliseconds->chThdSleep->chThdSleepS->chSchGoSleepTimeoutS->chVTDoSetI->vt_enqueue-> ??
And somehow get stuck in repeat at that level.
If someone has more experience with the timing logic of ChibiOS and can guide me on what to check for I'd gladly investigate this more in depth.