Problem with rtems_event_send crashing from interrupt routine
Gedare Bloom
gedare at rtems.org
Wed Jun 10 20:48:20 UTC 2015
On Wed, Jun 10, 2015 at 3:05 PM, Mr. Andrei Chichak <groups at chichak.ca> wrote:
> This one is weird (for me).
>
> I’m dealing with an STM32F407 (ARM M4F), stripping data off of the ADCs using DMA. Using double buffering, I get an interrupt telling me that my ADC scan is done and the data is waiting in region “A”, then 1/200 of a second later I get a different interrupt telling me that data is waiting in region “B”, repeat.
>
> To indicate to my task that the buffer is ready I use rtems_event_send in the interrupt routine and either send RTEMS_EVENT_0 or RTEMS_EVENT_1, depending on which interrupt routine got called.
>
> The task does a:
>
> status = rtems_event_receive( RTEMS_EVENT_0 | RTEMS_EVENT_1, RTEMS_WAIT | RTEMS_EVENT_ANY, 100, &events);
>
> and this is seen to run 200 times per second.
>
>
> BUT, after (exactly and repeatably) 3101 seconds the receive no longer happens and never return with a status code. Actually the process seems to go into an infinite loop outside of my code. The interrupts continue to fire (as seen on a GPIO bit being twiddled) sending events and the return codes are always RTEMS_SUCCESSFUL.
>
> I have stripped out most of the code of the system other than starting the ADC code, and a monitor task that calls rtems_cpu_usage_report once per second.
>
> If I strip out the rtems_event_send calls, the code continues to run and the rtems_event_receive works as expected, hitting its timeout.
>
> So, I seem to be having a problem with rtems_event_send.
>
> Any ideas?
>
If you can get this down to a test case with just rtems_event (without
your ADC code too), this might be more readily debuggable.
> Andrei
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
More information about the users
mailing list