eclipse-threadx / threadx

Eclipse ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications.
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/threadx/index.md
MIT License
2.97k stars 805 forks source link

Writing queue from interrupted causes hard fault #119

Closed atul6019 closed 3 years ago

atul6019 commented 3 years ago

Hi, i am using cortex m7 board facing issue while writing from writing from isr.

goldscott commented 3 years ago

Please give us more details. Have you done any debugging/stepping through the code to find exactly where this is happening?

atul6019 commented 3 years ago

Hi , thanks for your response. In my case i have common task handler on which i am waiting for queue data. if data is available i am calling actual task. when i am writing queue from ISR it goes to hardfault from _tx_thread_system_return(); API. as combined_flags is 0.

` TX_THREAD_SYSTEM_RETURN_CHECK(combined_flags) if (combined_flags == ((ULONG) 0)) {

ifdef TX_THREAD_ENABLE_PERFORMANCE_INFO

                                /* There is another thread ready to run and will be scheduled upon return.  */
                                _tx_thread_performance_non_idle_return_count++;

endif

                                /* Preemption is needed - return to the system!  */
                                _tx_thread_system_return();
                            }

`

goldscott commented 3 years ago

what does your call to tx_queue_send look like in your ISR? are you calling any other ThreadX functions in your ISR?

goldscott commented 3 years ago

No response, closing.