From 1585cb2137bf72cc9a5da163223bcbecca12aa64 Mon Sep 17 00:00:00 2001 From: andreika-git Date: Sat, 30 Dec 2023 22:34:23 +0200 Subject: [PATCH] Fix subaru_eg33 for OpenBLT --- firmware/config/boards/subaru_eg33/board.mk | 2 ++ firmware/config/boards/subaru_eg33/board_configuration.cpp | 2 ++ firmware/config/boards/subaru_eg33/efifeatures.h | 2 ++ firmware/hw_layer/ports/stm32/stm32f7/hw_ports.mk | 6 +++++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/firmware/config/boards/subaru_eg33/board.mk b/firmware/config/boards/subaru_eg33/board.mk index 97b38f2692..8a51366263 100644 --- a/firmware/config/boards/subaru_eg33/board.mk +++ b/firmware/config/boards/subaru_eg33/board.mk @@ -2,6 +2,8 @@ BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp \ $(BOARD_DIR)/board_storage.cpp +# board.c from this directory +BOARD_C = $(BOARD_DIR)/board.c # Required include directories BOARDINC += $(BOARD_DIR)/config/controllers/algo diff --git a/firmware/config/boards/subaru_eg33/board_configuration.cpp b/firmware/config/boards/subaru_eg33/board_configuration.cpp index 062bdd0da7..4b361acd40 100644 --- a/firmware/config/boards/subaru_eg33/board_configuration.cpp +++ b/firmware/config/boards/subaru_eg33/board_configuration.cpp @@ -303,6 +303,7 @@ static const struct mc33810_config mc33810_even = { static void board_init_ext_gpios() { +#ifndef EFI_BOOTLOADER int ret; ret = mc33810_add(Gpio::MC33810_0_OUT_0, 0, &mc33810_odd); @@ -313,6 +314,7 @@ static void board_init_ext_gpios() if (ret < 0) { /* error */ } +#endif // EFI_BOOTLOADER } /** diff --git a/firmware/config/boards/subaru_eg33/efifeatures.h b/firmware/config/boards/subaru_eg33/efifeatures.h index c34de72249..2cda67e383 100644 --- a/firmware/config/boards/subaru_eg33/efifeatures.h +++ b/firmware/config/boards/subaru_eg33/efifeatures.h @@ -102,9 +102,11 @@ #define EFI_NARROW_EGO_AVERAGING TRUE +#ifndef EFI_BOOTLOADER // bootloader needs INT_FLASH and doesn't have MFS /* this board has external QSPI NOR flash */ #undef EFI_STORAGE_MFS #define EFI_STORAGE_MFS TRUE #undef EFI_STORAGE_INT_FLASH #define EFI_STORAGE_INT_FLASH FALSE +#endif // EFI_BOOTLOADER diff --git a/firmware/hw_layer/ports/stm32/stm32f7/hw_ports.mk b/firmware/hw_layer/ports/stm32/stm32f7/hw_ports.mk index 6737733d5d..fee0a40ac6 100644 --- a/firmware/hw_layer/ports/stm32/stm32f7/hw_ports.mk +++ b/firmware/hw_layer/ports/stm32/stm32f7/hw_ports.mk @@ -12,7 +12,11 @@ USE_OPT += -falign-functions=16 DDEFS += -DSTM32F767xx MCU = cortex-m7 LDSCRIPT = $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f7/STM32F7.ld -ALLCSRC += $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_F767ZI/board.c +# kludge: while we the very generic ChibiOS board.c we use our custom board.h from current folder! +ifeq ($(BOARD_C),) + BOARD_C = $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_F767ZI/board.c +endif +ALLCSRC += $(BOARD_C) CONFDIR = $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f7/cfg # TODO: remove, for efifeatures.h