Comments on: ESP32 with FreeRTOS Queues: Inter-Task Communication (Arduino IDE) https://randomnerdtutorials.com/esp32-freertos-queues-inter-task-arduino/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Sun, 07 Dec 2025 22:34:32 +0000 hourly 1 https://wordpress.org/?v=6.8.5 By: Reiner Ulrich https://randomnerdtutorials.com/esp32-freertos-queues-inter-task-arduino/#comment-1135459 Sun, 07 Dec 2025 22:34:32 +0000 https://randomnerdtutorials.com/?p=173794#comment-1135459 I love the tutorials about using the FreeRTOS features – thanks for all the work and publishing it (and all the other great and inspiring content on Randomnerdtutorials which I frequently access!!!). I am now re-thinking where I would use the RTOS features in my past and future projects: the “blink” example makes perfect sense to me as it is a “realtime” requirement with hardware directly connected locally. Also example 1 and 2 above are a great working samples for completely decoupling 2 tasks which access locally connected native Hardware. However, when it comes to I2C communication (example 3) I have some questions/doubts: I assume I2C is not “multi-tasking-capable” at all by itself, as it is not a “network stack” – saying the master will call the slave and must wait for the answer from that slave, kind of “locking” the bus – the master cannot/should not call another slave before the answer from the first slave arrived – as otherwise collisions on the I2C-bus could happen and the master might not even know which slave answered? If this assumption is correct: In Example 3 this does not seem to be an issue as after reading the sensor data the read task sleeps for 2 sec. and the “display task” has more than enough time to send the data over the same I2C bus to the display… Nevertheless it brings up a conceptual question: what kind of requirements benefit from RTOS tasks: Blink-Example: yes. Example 1 and 2 above: yes. In Example 3: if I2C is a “single use resource” then semaphore locking would be an elegant solution to “locally reserve” the resource, however: would this kind of requirement really benefit from realtime tasks as the resources clearly are not realtime (they are rather “asynchronous” with undefined response time and therefore cannot be part of a “realtime” requirement ever). My design pattern therefore would be: the use of RTOS-Features is helpful with “local realtime resources” like GPIO-connected local hardware while “asynchronous resources” or “single use bus-resources” like I2C devices, RS485, SPI and alike are not “realtime” resources from a master perspective and therefore should rather run sequentially e.g. inside the regular loop() OR inside the same task for all communication on that bus (like an “I2C/RS-485 handler task”): ensuring “single, sequential use” without too much programming overhead like semaphores. As said, a “design guideline” question when using RTOS features – looking forward to any comments on above thoughts.

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-freertos-queues-inter-task-arduino/#comment-1117348 Sat, 01 Nov 2025 11:20:37 +0000 https://randomnerdtutorials.com/?p=173794#comment-1117348 In reply to Ray Leiter.

Hi.
You’re right.
Thanks for letting me now.
It is fixed now.
Regards,
Sara

]]>
By: Ray Leiter https://randomnerdtutorials.com/esp32-freertos-queues-inter-task-arduino/#comment-1117086 Fri, 31 Oct 2025 17:30:59 +0000 https://randomnerdtutorials.com/?p=173794#comment-1117086 Just in case nobody reported these errors:
Under “Creating a Queue”
This doesn’t look right: “Use the xQueueCreate(size, item_size) to create a task—size corresponds to the number of items that can be on the queue and item_size is the bytes size of heap allocated for each item on the queue.”

Under “Send an Item to the Queue”
This seems to be missing code: “Then, we’ll use the xQueueSend() function to send an item to the queue. We’re sending the potValue to the potQueue as follows.”
printf instead of xQueueSend()

]]>
By: Andrei-Viorel ENACHE https://randomnerdtutorials.com/esp32-freertos-queues-inter-task-arduino/#comment-1100992 Tue, 23 Sep 2025 07:38:15 +0000 https://randomnerdtutorials.com/?p=173794#comment-1100992 Hy, if different tasks run on the same core and have the same priority, why use FreeRTOS?

]]>
By: DuAlvim https://randomnerdtutorials.com/esp32-freertos-queues-inter-task-arduino/#comment-1100602 Mon, 22 Sep 2025 02:45:32 +0000 https://randomnerdtutorials.com/?p=173794#comment-1100602 Yes, I believe too that they will fix this in a future update. At least for me, I don’t see as a big deal, because it’s easily reversible installing in the Arduino IDE a not so old version of the compiler.
Anyway, thanks again for giving us a good time with this post!

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-freertos-queues-inter-task-arduino/#comment-1099948 Sat, 20 Sep 2025 18:38:19 +0000 https://randomnerdtutorials.com/?p=173794#comment-1099948 In reply to DuAlvim.

Hi.
Thanks for letting us know.
Hopefully, they’ll fix in the next update.

Regards,
Sara

]]>
By: DuAlvim https://randomnerdtutorials.com/esp32-freertos-queues-inter-task-arduino/#comment-1098679 Thu, 18 Sep 2025 09:14:00 +0000 https://randomnerdtutorials.com/?p=173794#comment-1098679 Hey guys,
Thank you for another great tutorial about FreeRTOS!

One thing worthy to note here is about the I2C bug related to the ESP32 compiler (when I was using the 3.3.1 version of the ESP32 driver/compiler). The Serial Monitor of the Arduino IDE was showing the error messages shown in the end of this comment.

After searching for this on the web, I found that this is a problem related to the 3.2.0 and newer versions of the hardware, and the problem stoped when I installed the 3.1.3 of the ESP32 driver in the Arduino IDE.
Regards!

The error messages which appeared when the 3.3.1 version of the driver was installed was:
E (597046) i2c.master: I2C hardware NACK detected
E (597046) i2c.master: I2C transaction unexpected nack detected
E (597046) i2c.master: s_i2c_synchronous_transaction(924): I2C transaction failed
E (597052) i2c.master: i2c_master_transmit_receive(1220): I2C transaction failed

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-freertos-queues-inter-task-arduino/#comment-1098231 Wed, 17 Sep 2025 09:54:26 +0000 https://randomnerdtutorials.com/?p=173794#comment-1098231 In reply to rboeije.

Thanks for noticing, we’ll fiz that.

Regards,
Sara

]]>
By: rboeije https://randomnerdtutorials.com/esp32-freertos-queues-inter-task-arduino/#comment-1098223 Wed, 17 Sep 2025 09:10:09 +0000 https://randomnerdtutorials.com/?p=173794#comment-1098223 Just a minor one, but if you change code, make sure you adjust the comments as well….

vTaskDelay(300 / portTICK_PERIOD_MS); // 100ms

It is now 300 ms..
Al the best, René

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-freertos-queues-inter-task-arduino/#comment-1097898 Tue, 16 Sep 2025 10:48:15 +0000 https://randomnerdtutorials.com/?p=173794#comment-1097898 In reply to Matt Gessner.

That’s great.
Thanks.
Regards,
Sara

]]>