Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Handle Global Memory

Posted by canalrun on February 27, 2019

Hello, I am brand-new to Free RTOS. I have two questions.

  1. I am using an Adafruit Feather ESP32 board purchased in Feb 2019 with the newest Arduino 1.8.8 IDE. I ran the simple examples from Random Nerd Tutorials and they worked using RTOS calls – so I guess I have it installed. Does this make sense? Do I have it installed? Or, am I fooling myself?

  2. I plan to run two tasks on my ESP32. Core 0 will continually acquire ADC samples and store them in ping-pong buffers. Core 1 (within Loop()) will check a buffer position and/or full variable and perform FFT's on the data. This requires a few global variables: the buffers, and the buffer position/full variables. Core 0 will be the only writer. Both core 0 and core 1 will read the variables.

Do global memory variables require mutexes or semaphores? The reads or writes will be atomic – either 16 or 32 bit integers.

Thanks, Barry.

Handle Global Memory

Posted by rtel on February 27, 2019

I have no idea about the platform or the software you are running on .... but to answer your question: Generally if you have multiple readers but only one writer to a single value (rather than a structure) then you do not need a critical section provided the value can be written in one go (i.e. a 32-bit write on a 32-bit architecture can be written in one go, whereas a 64-bit value on a 32-bit architecture cannot). On the other hand if you have multiple writers then you would need a critical section.

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner