From 3229791b60185faa47d87af80b6a8ccbb34d15e5 Mon Sep 17 00:00:00 2001 From: Takeo Takahashi Date: Mon, 1 May 2023 22:54:32 +0900 Subject: [PATCH] renesas-ra: Add a macro definition to avoid compile error of FSP v4.4.0. FSP v4.4.0 refers to CMSIS V5.4.1, and __COMPILER_BARRIER() is used in bsp. On the other hand, lib/cmsis is V5.1.0 and the macro is not defined. Therefore, compile error happens. As the workaround, the macro definition is added. If lib/cmsis is updated in the future, this addition can be removed. Signed-off-by: Takeo Takahashi --- ports/renesas-ra/Makefile | 1 + ports/renesas-ra/boards/compiler_barrier.h | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 ports/renesas-ra/boards/compiler_barrier.h diff --git a/ports/renesas-ra/Makefile b/ports/renesas-ra/Makefile index bcfae8555e..85ffd9a1e9 100644 --- a/ports/renesas-ra/Makefile +++ b/ports/renesas-ra/Makefile @@ -89,6 +89,7 @@ SYSTEM_FILE ?= lib/fsp/ra/fsp/src/bsp/cmsis/Device/RENESAS/Source/system.o # Select the cross compile prefix CROSS_COMPILE ?= arm-none-eabi- +INC += -imacros boards/compiler_barrier.h INC += -I. INC += -I$(TOP) INC += -I$(BUILD) diff --git a/ports/renesas-ra/boards/compiler_barrier.h b/ports/renesas-ra/boards/compiler_barrier.h new file mode 100644 index 0000000000..c1145b1b9d --- /dev/null +++ b/ports/renesas-ra/boards/compiler_barrier.h @@ -0,0 +1,4 @@ +// we need to provide a definition of __COMPILER_BARRIER() defined in cmsis/cmsis_gcc.h V5.4.1 for FSP v4.4.0 +#ifndef __COMPILER_BARRIER + #define __COMPILER_BARRIER() __ASM volatile ("" ::: "memory") +#endif