Chibios thirdparty IRQ support
Posted: Sat May 05, 2018 5:10 pm
Hello,
we are currently using Chibios on STM32F429 board and have recently migrated to Chibios. A thirdparty c++ library stm32plus is being used for peripherals. And Chibios/RT stand-alone has been successfully integrated into the system. My question is how do we use the irq subsystem in this context. The c++ peripheral library in use provides a signal/delegate (FastDelegate Library) mechanism to handle IRQ's. This allows us to use IRQ callbacks as regular class member functions.
This is how the control is passed from the IRQ to the class member callback function subscribed to this particular event. This is how subscription is done
Looking at the stm32f429 linker and stm32_isr.h i figured out that the DMA1_Stream1_IRQn has been mapped to Vector70 and thought the following define's would suffice.
But the Program ends up in the unhandled exception loop at the first instance of an Interrupt. Is there an elegant way to handle IRQ's like these with in the context of Chibios and be able to assign priorities to them as well.
Best Regards
we are currently using Chibios on STM32F429 board and have recently migrated to Chibios. A thirdparty c++ library stm32plus is being used for peripherals. And Chibios/RT stand-alone has been successfully integrated into the system. My question is how do we use the irq subsystem in this context. The c++ peripheral library in use provides a signal/delegate (FastDelegate Library) mechanism to handle IRQ's. This allows us to use IRQ callbacks as regular class member functions.
Code: Select all
void __attribute__ ((interrupt("IRQ"))) DMA1_Stream1_IRQHandler() {
if(DMA_GetITStatus(DMA1_Stream1,DMA_IT_TCIF1)!=RESET) {
DmaInterruptFeature<1,1>::_dmaInstance->DmaInterruptEventSender.raiseEvent(DmaEventType::EVENT_COMPLETE);
DMA_ClearITPendingBit(DMA1_Stream1,DMA_IT_TCIF1);
}
}
This is how the control is passed from the IRQ to the class member callback function subscribed to this particular event. This is how subscription is done
Code: Select all
_DMA.DmaInterruptEventSender.insertSubscriber( DmaInterruptEventSourceSlot::bind(this,&SerialObj::Handle_dmaIRQ));
Looking at the stm32f429 linker and stm32_isr.h i figured out that the DMA1_Stream1_IRQn has been mapped to Vector70 and thought the following define's would suffice.
Code: Select all
#define USART3_IRQHandler VectorDC
#define DMA1_Stream1_IRQHandler Vector70
But the Program ends up in the unhandled exception loop at the first instance of an Interrupt. Is there an elegant way to handle IRQ's like these with in the context of Chibios and be able to assign priorities to them as well.
Best Regards