yhz wrote on Friday, March 30, 2018:
Hi I’m still new in FreeRTOS,
I have used interrupts with UART and timers, everything just fine, but on my recent project, I used HW interrupts for timers and CAN1.
Timer interrups works as normal: I can enable interrupt by “TIM_ITConfig(TIM3, TIM_IT_CC1, ENABLE);” in prvSetupHardware function and the interrupt ISR will not called until I start the task scheduler.
However for the CAN interrupt, as soon as I called “CAN_ITConfig(CAN1, CAN_IT_FMP0, ENABLE);” in the prvSetupHardware function, the interrupt ISR will be enabled and if there are messages received the ISR will be called and then in the ISR it will give semaphore which was not created yet and end up with a hard fault.
Anyone has any idea about this? should I make another task just to enable the interrupt after the scheduler started?
Thanks