move chconf/mcuconf/halconf in to hw_ports (#2321)

* move f4 config files

* don't need this

* f7

* f7

* h7

* this was duplicated

* turn off smart build

* loader too

* update prometheus paths

* bootloader should include confdir

* fix the flash size while we're at it

* move chconf_common

* use wait

* normalize board.mk

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2021-02-10 16:38:24 -08:00 committed by GitHub
parent e12c5db607
commit dade25ef34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 28 additions and 152 deletions

View File

@ -88,8 +88,9 @@ endif
# If enabled, this option makes the build process faster by not compiling # If enabled, this option makes the build process faster by not compiling
# modules not used in the current configuration. # modules not used in the current configuration.
# without USE_SMART_BUILD all ChibiOS (including all drivers) are builded. And all drivers includes get included.
ifeq ($(USE_SMART_BUILD),) ifeq ($(USE_SMART_BUILD),)
USE_SMART_BUILD = yes USE_SMART_BUILD = no
endif endif
ifeq ($(USE_BOOTLOADER),) ifeq ($(USE_BOOTLOADER),)
@ -143,16 +144,6 @@ BOARDS_DIR = $(PROJECT_DIR)/config/boards
include $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)/board.mk include $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)/board.mk
# If enabled, this option makes the build process faster by not compiling
# modules not used in the current configuration.
# without USE_SMART_BUILD all ChibiOS (including all drivers) are builded. And all drivers includes get included.
ifeq ($(USE_SMART_BUILD),)
USE_SMART_BUILD = yes
endif
ifeq ($(CONFDIR),)
CONFDIR = $(PROJECT_DIR)/config/stm32f4ems
endif
# Include various ChibiOS mk files # Include various ChibiOS mk files
# Licensing files. # Licensing files.
include $(CHIBIOS)/os/license/license.mk include $(CHIBIOS)/os/license/license.mk

View File

@ -12,10 +12,6 @@ ifeq ($(DEBUG_LEVEL_OPT),)
DDEFS += -DEFI_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE DDEFS += -DEFI_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE
endif endif
ifeq ($(CONFDIR),)
CONFDIR = $(PROJECT_DIR)/config/stm32f4ems
endif
# disable some modules to shrink bootloader binary # disable some modules to shrink bootloader binary
DDEFS += -DHAL_USE_ADC=FALSE -DHAL_USE_CAN=FALSE -DHAL_USE_EXT=FALSE -DHAL_USE_GPT=FALSE -DHAL_USE_ICU=FALSE -DHAL_USE_PWM=FALSE -DHAL_USE_RTC=FALSE DDEFS += -DHAL_USE_ADC=FALSE -DHAL_USE_CAN=FALSE -DHAL_USE_EXT=FALSE -DHAL_USE_GPT=FALSE -DHAL_USE_ICU=FALSE -DHAL_USE_PWM=FALSE -DHAL_USE_RTC=FALSE
#disable ChibiOS flsah driver and prevent header from include #disable ChibiOS flsah driver and prevent header from include
@ -81,7 +77,7 @@ endif
# If enabled, this option makes the build process faster by not compiling # If enabled, this option makes the build process faster by not compiling
# modules not used in the current configuration. # modules not used in the current configuration.
ifeq ($(USE_SMART_BUILD),) ifeq ($(USE_SMART_BUILD),)
USE_SMART_BUILD = yes USE_SMART_BUILD = no
endif endif
# #
@ -210,19 +206,14 @@ TCPPSRC =
# List ASM source files here # List ASM source files here
ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
ifeq ($(CONFIGPATH),)
CONFIGPATH=$(PROJECT_DIR)/config/stm32f4ems
endif
INCDIR = $(ALLINC) \ INCDIR = $(ALLINC) \
.. \ .. \
$(CHIBIOS)/os/various \ $(CHIBIOS)/os/various \
$(CHIBIOS)/os/ex/ST \ $(CHIBIOS)/os/ex/ST \
$(CHIBIOS)/os/hal/lib/peripherals/sensors \ $(CHIBIOS)/os/hal/lib/peripherals/sensors \
$(CONFIGPATH) \
$(CONFIG)/engines \ $(CONFIG)/engines \
$(CONFIG) \ $(CONFIG) \
$(CONFDIR) \
$(PROJECT_DIR)/ext \ $(PROJECT_DIR)/ext \
$(PROJECT_DIR)/ext_algo \ $(PROJECT_DIR)/ext_algo \
$(UTIL_INC) \ $(UTIL_INC) \

View File

@ -4,16 +4,6 @@
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen72/board_configuration.cpp BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen72/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellen72 BOARDINC = $(BOARDS_DIR)/hellen/hellen72
# Target processor details
ifeq ($(PROJECT_CPU),ARCH_STM32F4)
BOARDINC += $(PROJECT_DIR)/config/stm32f4ems # For board.h
else
# todo: add support for STM32H7
CONFDIR = config/stm32h7ems
BOARDINC += $(PROJECT_DIR)/config/boards/nucleo_h743 # For board.h
BOARDINC += $(PROJECT_DIR)/config/stm32h7ems # efifeatures/halconf/chconf.h
endif
# Set this if you want a default engine type other than normal Hellen72 # Set this if you want a default engine type other than normal Hellen72
ifeq ($(DEFAULT_ENGINE_TYPE),) ifeq ($(DEFAULT_ENGINE_TYPE),)
DEFAULT_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_NB2 DEFAULT_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_NB2

View File

@ -1,12 +1,10 @@
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/me7_pnp/board_configuration.cpp BOARDCPPSRC = $(PROJECT_DIR)/config/boards/me7_pnp/board_configuration.cpp
# Required include directories
BOARDINC = $(PROJECT_DIR)/config/stm32f7ems
# Override DEFAULT_ENGINE_TYPE # Override DEFAULT_ENGINE_TYPE
DDEFS += -DDEFAULT_ENGINE_TYPE=VAG_18_TURBO -DSTM32F767xx DDEFS += -DDEFAULT_ENGINE_TYPE=VAG_18_TURBO -DSTM32F767xx
# Shared variables # Shared variables
ALLCSRC += $(BOARDSRC)
ALLCPPSRC += $(BOARDCPPSRC) ALLCPPSRC += $(BOARDCPPSRC)
ALLINC += $(BOARDINC) ALLINC += $(BOARDINC)

View File

@ -9,8 +9,6 @@ ifeq ($(PROJECT_CPU),ARCH_STM32F4)
BOARDINC += $(PROJECT_DIR)/config/stm32f4ems # For board.h BOARDINC += $(PROJECT_DIR)/config/stm32f4ems # For board.h
BOARDINC += $(BOARDS_DIR)/microrusefi # For knock_config.h BOARDINC += $(BOARDS_DIR)/microrusefi # For knock_config.h
else else
CONFDIR = config/stm32f7ems
BOARDINC += $(PROJECT_DIR)/config/stm32f7ems # efifeatures/halconf/chconf.h
BOARDINC += $(BOARDS_DIR)/microrusefi # For knock_config.h BOARDINC += $(BOARDS_DIR)/microrusefi # For knock_config.h
endif endif

View File

@ -1,10 +1,6 @@
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/nucleo_f767/board_configuration.cpp BOARDCPPSRC = $(PROJECT_DIR)/config/boards/nucleo_f767/board_configuration.cpp
# Required include directories
BOARDINC = $(PROJECT_DIR)/config/stm32f7ems
CONFDIR = config/stm32f7ems
# Override DEFAULT_ENGINE_TYPE # Override DEFAULT_ENGINE_TYPE
DDEFS += -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS -DSTM32F767xx DDEFS += -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS -DSTM32F767xx

View File

@ -1,9 +1,9 @@
# List of all the board related files. # List of all the board related files.
# Required include directories
BOARDINC = $(PROJECT_DIR)/config/stm32h7ems
CONFDIR = config/stm32h7ems
# Shared variables # Shared variables
ALLCPPSRC += $(PROJECT_DIR)/config/boards/nucleo_h743/board_configuration.cpp ALLCPPSRC += $(PROJECT_DIR)/config/boards/nucleo_h743/board_configuration.cpp
# Shared variables
ALLCSRC += $(BOARDSRC)
ALLCPPSRC += $(BOARDCPPSRC)
ALLINC += $(BOARDINC) ALLINC += $(BOARDINC)

View File

@ -9,7 +9,7 @@
#include "efifeatures.h" #include "efifeatures.h"
#include "mcuconf.h" #include "mcuconf.h"
#include "../../stm32f4ems/halconf.h" #include "../../../hw_layer/ports/stm32/stm32f4/cfg/halconf.h"
#ifndef _HALCONF_PROMETHEUS_H_ #ifndef _HALCONF_PROMETHEUS_H_
#define _HALCONF_PROMETHEUS_H_ #define _HALCONF_PROMETHEUS_H_

View File

@ -8,7 +8,7 @@
*/ */
#include "efifeatures.h" #include "efifeatures.h"
#include "../../stm32f4ems/mcuconf.h" #include "../../../hw_layer/ports/stm32/stm32f4/cfg/mcuconf.h"
#ifndef _MCUCONF_PROMETHEUS_H_ #ifndef _MCUCONF_PROMETHEUS_H_
#define _MCUCONF_PROMETHEUS_H_ #define _MCUCONF_PROMETHEUS_H_

View File

@ -5,10 +5,7 @@ BOARDINC = $(PROJECT_DIR)/config/boards/proteus
# Target processor details # Target processor details
ifeq ($(PROJECT_CPU),ARCH_STM32F4) ifeq ($(PROJECT_CPU),ARCH_STM32F4)
BOARDINC += $(PROJECT_DIR)/config/stm32f4ems # For board.h
else else
BOARDINC += $(PROJECT_DIR)/config/stm32f7ems # efifeatures/halconf/chconf.h
CONFDIR = config/stm32f4ems
PROTEUS_LEGACY = TRUE PROTEUS_LEGACY = TRUE
endif endif

View File

@ -6,9 +6,6 @@ BOARDCPPSRC = $(BOARDS_DIR)/skeleton/board_configuration.cpp
# Target processor details # Target processor details
ifeq ($(PROJECT_CPU),ARCH_STM32F4) ifeq ($(PROJECT_CPU),ARCH_STM32F4)
BOARDINC = $(BOARDS_DIR)/skeleton BOARDINC = $(BOARDS_DIR)/skeleton
BOARDINC += $(PROJECT_DIR)/config/stm32f4ems # For board.h
else
BOARDINC += $(PROJECT_DIR)/config/stm32f7ems # efifeatures/halconf/chconf.h
endif endif
# Set this if you want a default engine type # Set this if you want a default engine type

View File

@ -1,6 +1,5 @@
# List of all the board related files. # List of all the board related files.
BOARDSRC = $(PROJECT_DIR)/config/boards/st_stm32f4/board_extra.c BOARDSRC = $(PROJECT_DIR)/config/boards/st_stm32f4/board_extra.c
BOARDCPPSRC =
# MCU defines # MCU defines
DDEFS += -DSTM32F407xx DDEFS += -DSTM32F407xx

View File

@ -13,11 +13,6 @@ ifeq ($(USE_BOOTLOADER),yes)
BOOTLOADERINC = $(PROJECT_DIR)/bootloader/subaru_eg33 BOOTLOADERINC = $(PROJECT_DIR)/bootloader/subaru_eg33
endif endif
#FIX THIS
CONFIGPATH = $(PROJECT_DIR)/config/stm32f7ems
CONFDIR = config/stm32f7ems
#LED #LED
LED_CRITICAL_ERROR_BRAIN_PIN = -DLED_CRITICAL_ERROR_BRAIN_PIN=GPIOG_7 LED_CRITICAL_ERROR_BRAIN_PIN = -DLED_CRITICAL_ERROR_BRAIN_PIN=GPIOG_7
@ -29,5 +24,6 @@ DDEFS += -DHW_SUBARU_EG33=1
DDEFS += -DDEFAULT_ENGINE_TYPE=SUBARUEG33_DEFAULTS -DSTM32F765xx $(LED_CRITICAL_ERROR_BRAIN_PIN) DDEFS += -DDEFAULT_ENGINE_TYPE=SUBARUEG33_DEFAULTS -DSTM32F765xx $(LED_CRITICAL_ERROR_BRAIN_PIN)
# Shared variables # Shared variables
ALLCSRC += $(BOARDSRC)
ALLCPPSRC += $(BOARDCPPSRC) ALLCPPSRC += $(BOARDCPPSRC)
ALLINC += $(BOARDINC) ALLINC += $(BOARDINC)

View File

@ -1,89 +0,0 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* STM32F407xG memory setup.
* Note: Use of ram1 and ram2 is mutually exclusive with use of ram0.
* 'bl' is related to rusefi bootloader
*/
MEMORY
{
bl : org = 0x08000000, len = 16k /* bootloader section */
/* 1M minus 128k for first copy of tune minus another 128k since another sector for another copy of tune */
flash0 : org = DEFINED(BOOTLOADER) ? 0x08008000 : 0x08000000, len = DEFINED(BOOTLOADER) ? 736k : 768k
flash1 : org = 0x00000000, len = 0
flash2 : org = 0x00000000, len = 0
flash3 : org = 0x00000000, len = 0
flash4 : org = 0x00000000, len = 0
flash5 : org = 0x00000000, len = 0
flash6 : org = 0x00000000, len = 0
flash7 : org = 0x00000000, len = 0
ram0 : org = 0x20000000, len = 128k /* SRAM1 + SRAM2 */
ram1 : org = 0x20000000, len = 112k /* SRAM1 */
ram2 : org = 0x2001C000, len = 16k /* SRAM2 */
ram3 : org = 0x00000000, len = 0
ram4 : org = 0x10000000, len = 64k /* CCM SRAM */
ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */
ram6 : org = 0x00000000, len = 0
ram7 : org = 0x00000000, len = 0
}
/* For each data/text section two region are defined, a virtual region
and a load region (_LMA suffix).*/
/* Flash region to be used for exception vectors.*/
REGION_ALIAS("VECTORS_FLASH", flash0);
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
/* Flash region to be used for constructors and destructors.*/
REGION_ALIAS("XTORS_FLASH", flash0);
REGION_ALIAS("XTORS_FLASH_LMA", flash0);
/* Flash region to be used for code text.*/
REGION_ALIAS("TEXT_FLASH", flash0);
REGION_ALIAS("TEXT_FLASH_LMA", flash0);
/* Flash region to be used for read only data.*/
REGION_ALIAS("RODATA_FLASH", flash0);
REGION_ALIAS("RODATA_FLASH_LMA", flash0);
/* Flash region to be used for various.*/
REGION_ALIAS("VARIOUS_FLASH", flash0);
REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
/* Flash region to be used for RAM(n) initialization data.*/
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
/* RAM region to be used for Main stack. This stack accommodates the processing
of all exceptions and interrupts.*/
REGION_ALIAS("MAIN_STACK_RAM", ram0);
/* RAM region to be used for the process stack. This is the stack used by
the main() function.*/
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
/* RAM region to be used for data segment.*/
REGION_ALIAS("DATA_RAM", ram0);
REGION_ALIAS("DATA_RAM_LMA", flash0);
/* RAM region to be used for BSS segment.*/
REGION_ALIAS("BSS_RAM", ram0);
/* RAM region to be used for the default heap.*/
REGION_ALIAS("HEAP_RAM", ram0);
/* Generic rules inclusion.*/
INCLUDE rules.ld

View File

@ -22,7 +22,7 @@
MEMORY MEMORY
{ {
bl : org = 0x08000000, len = 16k /* bootloader section */ bl : org = 0x08000000, len = 16k /* bootloader section */
flash0 : org = DEFINED(BOOTLOADER) ? 0x08008000 : 0x08000000, len = DEFINED(BOOTLOADER) ? 864k : 896k /* change address & length if bootloader */ flash0 : org = DEFINED(BOOTLOADER) ? 0x08008000 : 0x08000000, len = DEFINED(BOOTLOADER) ? 736k : 768k /* change address & length if bootloader */
flash1 : org = 0x00000000, len = 0 flash1 : org = 0x00000000, len = 0
flash2 : org = 0x00000000, len = 0 flash2 : org = 0x00000000, len = 0
flash3 : org = 0x00000000, len = 0 flash3 : org = 0x00000000, len = 0

View File

@ -402,7 +402,7 @@
* @note Disabling this option saves both code and data space. * @note Disabling this option saves both code and data space.
*/ */
#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) #if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
#define USB_USE_WAIT FALSE #define USB_USE_WAIT TRUE
#endif #endif
#include "halconf_community.h" #include "halconf_community.h"

View File

@ -9,3 +9,7 @@ HW_LAYER_EMS_CPP += $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f4/mpu_util.cpp \
DDEFS += -DSTM32F407xx DDEFS += -DSTM32F407xx
LDSCRIPT = $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f4/STM32F405xG.ld LDSCRIPT = $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f4/STM32F405xG.ld
ALLCSRC += $(CHIBIOS)/os/hal/boards/ST_STM32F4_DISCOVERY/board.c ALLCSRC += $(CHIBIOS)/os/hal/boards/ST_STM32F4_DISCOVERY/board.c
CONFDIR = $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f4/cfg
# TODO: remove, for efifeatures.h
ALLINC += $(PROJECT_DIR)/config/stm32f4ems

View File

@ -400,7 +400,7 @@
* @note Disabling this option saves both code and data space. * @note Disabling this option saves both code and data space.
*/ */
#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) #if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
#define USB_USE_WAIT FALSE #define USB_USE_WAIT TRUE
#endif #endif
#endif /* HALCONF_H */ #endif /* HALCONF_H */

View File

@ -9,3 +9,7 @@ HW_LAYER_EMS_CPP += $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f7/mpu_util.cpp \
DDEFS += -DSTM32F767xx DDEFS += -DSTM32F767xx
LDSCRIPT = $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f7/STM32F76xxI.ld LDSCRIPT = $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f7/STM32F76xxI.ld
ALLCSRC += $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_F767ZI/board.c ALLCSRC += $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_F767ZI/board.c
CONFDIR = $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f7/cfg
# TODO: remove, for efifeatures.h
ALLINC += $(PROJECT_DIR)/config/stm32f7ems

View File

@ -503,7 +503,7 @@
* @note Disabling this option saves both code and data space. * @note Disabling this option saves both code and data space.
*/ */
#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) #if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
#define USB_USE_WAIT FALSE #define USB_USE_WAIT TRUE
#endif #endif
/*===========================================================================*/ /*===========================================================================*/

View File

@ -8,3 +8,7 @@ HW_LAYER_EMS_CPP += $(PROJECT_DIR)/hw_layer/ports/stm32/stm32h7/mpu_util.cpp
DDEFS += -DSTM32H743xx DDEFS += -DSTM32H743xx
LDSCRIPT = $(PROJECT_DIR)/hw_layer/ports/stm32/stm32h7/STM32H743xI.ld LDSCRIPT = $(PROJECT_DIR)/hw_layer/ports/stm32/stm32h7/STM32H743xI.ld
ALLCSRC += $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_H743ZI/board.c ALLCSRC += $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_H743ZI/board.c
CONFDIR = $(PROJECT_DIR)/hw_layer/ports/stm32/stm32h7/cfg
# TODO: remove, for efifeatures.h
ALLINC += $(PROJECT_DIR)/config/stm32h7ems