re-play wrote on Wednesday, July 30, 2014:
Hello again,
I thought it’s better to create a new topic for this case. I’m a FreeRTOS newbie, currently studying interrupt generation in FreeRTOS. So far I’ve managed to write and successfully run my basic non-RTOS example of using the USER button on my STM32 ARM Cortex board as an external interrupt using the libraries to configure it (EXTI line and NVIC). Now I want to make a next step and move to FreeRTOS environment, obviously using a semaphore mechanism (xSemaphoreGiveFromISR).
My goal is to create a simple FreeRTOS project with 3 tasks - 2 of them for flashing a single LED (one for blue and another for a green one) at different frequency while the 3rd task should be waken by the ISR (that processes GPIO interrupts originating from the push button) and should do some simple job, like turning both LEDs off when the button is pressed. So far I’ve managed to create and run the first two tasks (flashing both LEDS at different speed, using no semaphores) so now I need to add the third - “user button” task and obviously the binary semaphore for signal the task from interrupt and also to synchronise the task with interrupt. I’m just not sure how to do it correctly. I’m also not sure about the priority of the button interrupt task - should it be higher than the priority of my first two tasks or not?
Now, I don’t expect you to write any code for me, but if someone can just point me in the right direction how to start to add this button interrupt task I would be very grateful. Could be just in few sentences, kind of step-by-step plan. Something like: first you need to add button initialization (GPIO, RCC), you also need to create a binary semaphore to synch. the task with interrupt, then create a button task, check your configMAX_LIBRARY_SYSCALL_INTERRUPT_PRIORITY settings etc. Hope I’m not asking too much.