Skip to content

Commit

Permalink
esp32[s2|s3]: add volatile bitfields compilation flag
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
almir-okato committed Jul 3, 2024
1 parent ad2d660 commit 7b016b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/xtensa/src/esp32s2/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions arch/xtensa/src/esp32s3/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b016b8

Please sign in to comment.