I hope you are well.
I have been setting up some custom configuration of TIM5 (not quite a GPT and not a PWM) and issue an interrupt that I implement like this:
Code: Select all
OSAL_IRQ_HANDLER(STM32_TIM5_HANDLER) {
OSAL_IRQ_PROLOGUE();
uint32_t sr = tim5->SR;
sr &= tim5->DIER & STM32_TIM_DIER_IRQ_MASK;
tim5->SR = ~sr;
uint32_t t;
t = tim5->CNT;
chMBPostI(&mb, t);
OSAL_IRQ_EPILOGUE();
}
This locks up the whole system when trying to post mail in the mailbox. What am I missing? I made an experiment where instead of sending a mail I toggle a lead on and off at each interrupt (palWritePad) and that seems fine.
I declare the mailbox like this:
Code: Select all
msg_t box_contents[MAX_MESSAGES]; /* mailbox storage */
MAILBOX_DECL(mb, box_contents, MAX_MESSAGES);
Would love some hints if anyone has some
Thanks a lot and have a great day!