3 #include CMSIS_device_header
4 #include "Driver_GPIO.h"
11 // CMSIS RTOS2 error handler
12 void osRtxErrorNotify(uint32_t code)
19 void cmsis_validate_task(void *args)
25 // Exit task when done
33 SystemCoreClockUpdate();
36 RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN; // Enable GPIOB for PB4/PB5
40 // Enable SYSCFG clock (required for EXTI interrupt routing)
41 RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;
46 const osThreadAttr_t thread_attr = {
47 .name = "CMSIS Validate",
48 .stack_size = 1024 // 1024 words = 4096 bytes
50 osThreadNew(cmsis_validate_task, NULL, &thread_attr);
54 // Should never reach here