Problem with rtems_event_send crashing from interrupt routine

Mr. Andrei Chichak groups at chichak.ca
Wed Jun 10 19:05:58 UTC 2015


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?

Andrei


More information about the users mailing list