ESP32 and FreeRTOS and atomic updates

Idahowalker:
Going off this . Your update task would be the only task or have the highest preemptive priority, for the moment, running on the assigned core. I would, also assign such a task to Core0. Hrrumph or is that Core1, I got it wrote down somewhere. Yup, I am correct, setup() and loop() are run on core1. So you'd run your task on core0.

Okay I'll take a closer look at the xTaskCreate() function but I recall that I can assign a priority but not necessarily a core. It's good to know setup() and loop() run on core 1, thanks.

If you are meaning that the ESP32 memory/register changes are done as a single 32 bit operation, then yes that is the case.

Yes so I expect the compiler generated code moves the variable through the register.

If you want to run freeRTOS on the ESP32 you'l need to include freeRTOS.

#include "esp_system.h" //This inclusion configures the peripherals in the ESP system.

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/timers.h"
#include "freertos/event_groups.h"

Interestingly, selecting the ESP32 in the Arduino dev environment, I was able to create tasks in my app, and run the samples, without including any of that. I don't know why.