Setup FreeRTOS and USB Host with STM32CubeIDE
I'm new to STM32 so I am learning FreeRTOS using this video https://www.youtube.com/watch?v=OPrcpbKNSjU&list=PLEBQazB0HUySNug4eRm-73hNyMcCRViRB&index=3 but with the STM32 F4 Discovery board, so the STM32CubeIDE (v1.1.0) has both FreeRTOS and USB_Host enabled in the Device Configuration Tool window. As suggested, I've changed SYS in System Core to use TIM6.
It compiles and runs in debug mode but then halts in the HardFault_Hander() when xPortStartScheduler() is run due to osKernelStart() call. I get the same problem if the USB_HOST is configured as either Virtual Com Port or HID, but the FreeRTOS runs fine if I set Class for FS IP as Disable i.e. disabled USB.
I've read https://www.freertos.org/RTOS-Cortex-M3-M4.html and can see that the generated code has been setup to use 4 bits of priority, and LIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY is 5. But I can't apply the advice about calling NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 ) because the compiler doesn't recognise this function or constant. I also noticed that in Connectivity, USB_OTG_FS, NVIC Settings, USB On The Go FS global interrupt is enabled and has Preemption Priority 5, Sub Priority 0 and cannot be changed.
What do I have to change to get the USB Host functionality to work when using FreeRTOS?
