Arduino and ESP32 whims

Arduino and ESP32 whims

The format of this article is different from the regular ones. The reason is that I want to post as soon as possible the quircks and whims I’ve found now that I’m experimenting with Arduino and the ESP32 board. I hope this info might be useful for you in case you’re are facing the same problems.

Be aware that, in this regards, this post it’s not a tutorial (maybe someday I’ll write one), and it will be a dynamic post, kind of log where I’ll be writing down those strange things with such combination of software and hardware.

If you speak spanish (or you know how to translate webpages to your language) you might want to visit this series of articles I wrote about FreeRTOS (you’ll need this real time operating system to work with ESP32 anyway) HERE.

Feel free to ask questions!

Let’s start with the Captain’s log.

Day 2 (17/12/25)

Interesting facts

  • There’s a max of 20 FreeRTOS priorities out of the box. It means that if you need a task to run with the highest priority in the system, set it to 19.
  • The FreeRTOS task’s maximum length name out of the box is 16 (15 alphanumeric symbols plus the end of string character).
  • There are, out of the box again, 20 FreeRTOS timers.
  • The minimum RAM for a task is 1024 Bytes. You might choose a larger figure than that for your tasks (never less!) (I saw an example to blink a LED that set this ammount in 10 KB!)

Things to investigate: Can we have our own FreeRTOSConfig.h file in a per project basis?

Day 1 (16/12/25 (december 16th, 2025, (In México we use dd/mm/yy) ) ):

Choose the correct file system (ESP-WROOM-32 devkit board)

It was a nice day until I wasn’t able to make ESP32 work with Arduino. I followed the tutorials step by step, but the board refuses to work: it was something about the partitions.

This error was Weird because previously I was able to blink a LED using the Zephyr OS.

Solution: Inside the Arduino’s IDE, in the board’s property menu, choose DIO instead of QIO. (I figured it out after watching the build output from compiling a project with Zephyr. Crazy!)

The loop() function is inside a FreeRTOS task

Playing around with FreeRTOS tasks I let the loop function to be empty because I didn’t think it thouroghly: «I don’t need it, I’ve written my main task«, What a mistake!

void loop
{
   /* empty */
}

Although my main task was correct, the system did nothing, why? Because tasks in FreeRTOS must block at some point in order to release the CPU to other tasks. When the loop() function is empty, it takes the CPU for itself all the time (unless the other tasks have priorities greater than 0; anyway, don’t let it be empty).

Solution: Let the loop() function to block calling either an Arduino’s delay() function, or a FreeRTOS xTaskDelay() function (I guess the Arduino’s delay() is based upon the FreeRTOS one):

void loop
{
   delay(1);

   // or
   // vTaskDelay( 1000 );

   // or use it!
}

Interesting facts:

  1. The loop() function lives inside a FreeRTOS task:
void loopTask( void* pvParameters )
{
   // some setup (maybe it calls the setup() function)

   while( 1 )
   {
      loop(); 

      // that's way you both: must block it and you can use the vTaskDelay() function inside
   }
}

2. The loopTask has the lowest priority ranking in the system (tskIDLE_PRIORITY = 0 (zero)). It means that it runs whenever the system has some spare time to process it.

WiFiScan example didn’t run

It was the first example I wanted to try; however, the board kept reseting itself, and from time to time it showed (through the serial monitor) the WiFi networks around here. It seemed to be an electric power issue: maybe it was the cheap USB cable I was using or the board needs some extra capacitors.

The board has power bursts when in WiFi mode (transmiting/receiving) that the USB cable can’t provide. Some say that you need an external 5V power supply but, be aware, you can’t connect such external power supply directly to the board along the USB power supply (as per the schematic I had access).

I’m working on that.

Fco. Javier Rodríguez
Escrito por:

Fco. Javier Rodríguez

Soy Ingeniero Electrónico con 20+ años de experiencia en el diseño y desarrollo de productos electrónicos de consumo y a medida, y 12+ años como profesor. Egresado de la UNAM, también tengo el grado de Maestro en Ingeniería por la misma universidad. Mi perfil completo lo puede encontrar en: https://www.linkedin.com/in/fjrg76-dot-com/

Ver todas las entradas