i am trying to program my arduino in order to have 2 producers and one consumer. But it blocks and i can not see anything on the serial monitor. this is the code i am trying : https://pastebin.com/T5dLYRR9
Your code seems ok so far.
Did you define configASSERT ?
Also printf-family functions often use quite a lot of stack. Maybe got an stack overflow.
Did you also define configCHECK_FOR_STACK_OVERFLOW ?
Or just try e.g. 1000 as stack size at least for the printing tasks.
Thanks for your replies.
I am still new to the freertos so i have not played yet with the library and its configuration. I have included the <Arduino_FreeRTOS.h> and that s all. i also changed the stack size but still the same problem.
I believe in Arduino you do not need vTaskStartScheduler().
The semaphore is created in the ’empty’ state, meaning the semaphore must first be given using the xSemaphoreGive() API function before it can subsequently be taken (obtained) using the xSemaphoreTake() function.
You should also check the return codes to be sure that all the semaphores and tasks etc. are successfully created.
Exactly that s what i have done and it shows nothing.in fact in the beginning of each task i added a print and i’ve seen that it does not do any task. it creates the semaphore and gives it as i asked for but does not go to the tasks. That’s the weird thing i can not really find what is the problem
Hi, first time using this forum.
I had similar problem but i solved it by lowering memory to allocate for task aka the usStackDepth argument in xTaskCreate. I also recommend check potential failure to create a task or allocation of memory.