Sterling
Sterling
DIIDevHeads IoT Integration Server
Created by Sterling on 7/14/2024 in #firmware-and-baremetal
Do I need a mutex to protect 8-bit variables on STM32L476 with ARMv7E-M architecture using FreeRTOS?
Good day @Middleware & OS , I am using an STM32L476 with CMSIS OS2, which implements FreeRTOS v10.3.1. The STM32L476 is based on a Cortex-M4 MCU that follows the ARMv7E-M architecture: https://en.wikipedia.org/wiki/ARM_Cortex-M. The key difference between ARMv7E-M and ARMv7-M is the inclusion of DSP extensions in ARMv7E-M, which I do not use in my application. Hence, functionally, my setup is akin to ARMv7-M: https://developer.arm.com/documentation/ddi0403/latest (Page A1-22). According to the ARM reference manual, ARMv7-M guarantees atomicity for single-byte (8-bit) operations: https://developer.arm.com/documentation/ddi0403/latest (Page A3-80). Given this, do I still need to use a mutex to protect 8-bit variables (e.g., uint8_t and int8_t) in my application? I have found discussions on the need for mutexes with 32-bit variables and for non-ARM Cortex M4 environments, but I seek clarity specifically for this scenario. My expectation is that a mutex is not required for 8-bit variable types, but I would like to confirm this understanding.
6 replies