From 31982de89c7023cbb168fa328b541977234f347d Mon Sep 17 00:00:00 2001 From: Andrey G Date: Sun, 1 Jan 2023 20:42:17 +0300 Subject: [PATCH] S105: initial support (#4925) * Makefile: show CPU_HWLAYER directory * s105: support --- firmware/Makefile | 1 + firmware/config/boards/s105/board.mk | 27 +++++++++++++++++++ .../boards/s105/board_configuration.cpp | 12 +++++++++ firmware/config/boards/s105/compile_s105.sh | 5 ++++ firmware/config/boards/s105/efifeatures.h | 19 +++++++++++++ 5 files changed, 64 insertions(+) create mode 100644 firmware/config/boards/s105/board.mk create mode 100644 firmware/config/boards/s105/board_configuration.cpp create mode 100755 firmware/config/boards/s105/compile_s105.sh create mode 100644 firmware/config/boards/s105/efifeatures.h diff --git a/firmware/Makefile b/firmware/Makefile index cc6c3d0d84..ad2f0875ba 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -223,6 +223,7 @@ endif $(info PROJECT_BOARD: $(PROJECT_BOARD)) $(info PROJECT_CPU: $(PROJECT_CPU)) +$(info CPU_HWLAYER: $(CPU_HWLAYER)) $(info CONFDIR: $(CONFDIR)) $(info LDSCRIPT: $(LDSCRIPT)) diff --git a/firmware/config/boards/s105/board.mk b/firmware/config/boards/s105/board.mk new file mode 100644 index 0000000000..1c2fc9cef0 --- /dev/null +++ b/firmware/config/boards/s105/board.mk @@ -0,0 +1,27 @@ +BOARD_DIR = $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD) + +HALCONFDIR = $(BOARD_DIR) + +# List of all the board related files. +BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp + +#This board has no LED +DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::Unassigned + +#This board has no USB wired out +DDEFS += -DSTM32_USB_USE_OTG1=FALSE +DDEFS += -DSTM32_USB_USE_OTG2=FALSE + +# This board has no storage +DDEFS += -DEFI_FILE_LOGGING=FALSE +USE_FATFS = no + +DDEFS += -DFIRMWARE_ID=\"s105\" +DDEFS += -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS + +# Required include directories +BOARDINC = $(BOARD_DIR) + +# Shared variables +# Add board's directory first in include dir list so files in board directory will be included instead of default +ALLINC += $(BOARDINC) diff --git a/firmware/config/boards/s105/board_configuration.cpp b/firmware/config/boards/s105/board_configuration.cpp new file mode 100644 index 0000000000..5abd636296 --- /dev/null +++ b/firmware/config/boards/s105/board_configuration.cpp @@ -0,0 +1,12 @@ +#include "pch.h" + +/** + * @brief Board-specific configuration defaults. + * @todo Add your board-specific code, if any. + */ +void setBoardDefaultConfiguration() { + /* No LEDs on this board */ + engineConfiguration->communicationLedPin = Gpio::Unassigned; + engineConfiguration->runningLedPin = Gpio::Unassigned; + engineConfiguration->warningLedPin = Gpio::Unassigned; +} diff --git a/firmware/config/boards/s105/compile_s105.sh b/firmware/config/boards/s105/compile_s105.sh new file mode 100755 index 0000000000..e769709454 --- /dev/null +++ b/firmware/config/boards/s105/compile_s105.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +export EXTRA_PARAMS="-DDUMMY" + +bash ../common_make.sh s105 ARCH_STM32F4 diff --git a/firmware/config/boards/s105/efifeatures.h b/firmware/config/boards/s105/efifeatures.h new file mode 100644 index 0000000000..a8bf5dc029 --- /dev/null +++ b/firmware/config/boards/s105/efifeatures.h @@ -0,0 +1,19 @@ +/** + * @file boards/S105/efifeatures.h + * + * @brief In this header we can override efifeatures.h. + * + * @date Jan 01, 2023 + * @author Andrey Gusakov, 2023 + */ + +#include "../../stm32f4ems/efifeatures.h" + +#ifndef EFIFEATURES_S105_H_ +#define EFIFEATURES_S105_H_ + +/* This board has no USB wired out */ +#undef EFI_USB_SERIAL +#define EFI_USB_SERIAL FALSE + +#endif /* EFIFEATURES_S105_H_ */ \ No newline at end of file