esp32[s2|s3]: add volatile bitfields compilation flag

This compilation flag was added in the same way as done for esp32
in order to avoid unexpected behaviors when accessing registers
using struct bitfields.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
This commit is contained in:
Almir Okato 2024-07-03 18:46:04 +02:00 committed by Alan Carvalho de Assis
parent 593dc946d1
commit 652f4f1fe1
2 changed files with 8 additions and 0 deletions

View File

@ -168,6 +168,10 @@ chip/$(ESP_HAL_3RDPARTY_REPO):
CFLAGS += -Wno-undef -Wno-unused-variable
# Enable strict volatile bitfield access
CFLAGS += -fstrict-volatile-bitfields
CHIP_SERIES = $(patsubst "%",%,$(CONFIG_ESPRESSIF_CHIP_SERIES))
include chip/hal.mk

View File

@ -230,6 +230,10 @@ chip/$(ESP_HAL_3RDPARTY_REPO):
CFLAGS += -Wno-undef -Wno-unused-variable
CFLAGS += ${DEFINE_PREFIX}_RETARGETABLE_LOCKING
# Enable strict volatile bitfield access
CFLAGS += -fstrict-volatile-bitfields
AFLAGS += $(CFLAGS)
# Files that require the HAL recipe