Hello. I am using a thread to handle button press interrupt EXTI on STM MCU. The thread wakes up when button pressed and goes sleep after it finishes. But some times it enters in undefined state. What is the best practice to do this and debug. This is thread
I noticed that powerButtonThread becomes NULL. Interrupt handler works fine. Pressing button I enter into handler, and when I check powerButtonThread it is NULL. This is global variable. It is used to control thread. I check its usage. Only 3 place where it used: 1. Defenition 2. Thread to enter suspend mode 3. Button handler to wake up thread
I have a strange scheduler behavior. 2 threads. first blinker with NORMALPRIO. Second Message Box listener with NORMALPRIO+1. Second listens button presses. After some period second thread doesn't get execution. When I pressing button interrupt happens. In debugger I see that I don't enter thread. But if I send some thing in CLI thread starts execute and I see all messages.