I hope I am in the right board, not sure if its a generic or a STM32 problem. I try to run ChibiOS on a STM32F4-Board from Waveshare. Nothing special connected, just the basics at the moment. I try to run the following code (removed the includes and such):
Code: Select all
#define TEST_WA_SIZE THD_WA_SIZE(256)
static WORKING_AREA(waThread, 256);
static msg_t TestThread(void *arg) {
while (TRUE) {
palTogglePad(GPIOI, 10);
// chThdSleepMicroseconds(1);
}
return 0;
}
int main(void) {
uint8_t i=0;
halInit();
chSysInit();
palSetPadMode(GPIOH, 2, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOI, 10, PAL_MODE_OUTPUT_PUSHPULL);
for (i=0;i<10;i++) {
palTogglePad(GPIOH, 2);
}
for (i=0;i<10;i++) {
palClearPad(GPIOH, 2);
}
(void)chThdCreateStatic(waThread, sizeof(waThread), NORMALPRIO, TestThread, NULL);
for (i=0;i<10;i++) {
palTogglePad(GPIOH, 2);
}
for (i=0;i<10;i++) {
palClearPad(GPIOH, 2);
}
while (TRUE) {
palTogglePad(GPIOH, 2);
// chThdSleepMicroseconds(1);
}
return 0;
}
The Thread isnt working at all, the Pin is not toggling. Running the same command in main works, so I guess its not the hardware.
Uncommeting one of the sleeps: The system stops at that point. But even when commented out, it stops after exactly 20ms.
At the moment I haven't even an idea where to look for the error. Can someone please push me into the right direction? Thanks!