From f3da42627207c45a7b8c5ade46730fc25878b221 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 30 Mar 2022 16:18:18 -0700 Subject: [PATCH] stub tdg pdm (#4025) * stub tdg pdm * mk * happy build * some actual config * CAN * script * chmod * skip rate now that we know it builds --- .github/workflows/build-firmware.yaml | 6 + firmware/config/boards/tdg-pdm8/board.mk | 14 +++ .../boards/tdg-pdm8/board_configuration.cpp | 16 +++ .../boards/tdg-pdm8/compile_tdg-pdm8.sh | 4 + .../boards/tdg-pdm8/connectors/main.yaml | 119 ++++++++++++++++++ firmware/config/boards/tdg-pdm8/prepend.txt | 0 firmware/gen_config.sh | 1 + 7 files changed, 160 insertions(+) create mode 100644 firmware/config/boards/tdg-pdm8/board.mk create mode 100644 firmware/config/boards/tdg-pdm8/board_configuration.cpp create mode 100755 firmware/config/boards/tdg-pdm8/compile_tdg-pdm8.sh create mode 100644 firmware/config/boards/tdg-pdm8/connectors/main.yaml create mode 100644 firmware/config/boards/tdg-pdm8/prepend.txt diff --git a/.github/workflows/build-firmware.yaml b/.github/workflows/build-firmware.yaml index 6cb35e1418..c6cfc4d9dd 100644 --- a/.github/workflows/build-firmware.yaml +++ b/.github/workflows/build-firmware.yaml @@ -51,6 +51,7 @@ jobs: f429-discovery, core8, atlas, + tdg-pdm8, ] include: @@ -211,6 +212,11 @@ jobs: ini-file: rusefi_atlas.ini skip-rate: 90 + - build-target: tdg-pdm8 + folder: tdg-pdm8 + ini-file: rusefi_tdg-pdm8.ini + skip-rate: 90 + steps: - name: Execution throttle early exit # Don't skip any jobs if this workflow was run manually. diff --git a/firmware/config/boards/tdg-pdm8/board.mk b/firmware/config/boards/tdg-pdm8/board.mk new file mode 100644 index 0000000000..98c6315163 --- /dev/null +++ b/firmware/config/boards/tdg-pdm8/board.mk @@ -0,0 +1,14 @@ + +BOARDCPPSRC = $(PROJECT_DIR)/config/boards/tdg-pdm8/board_configuration.cpp + +PROJECT_CPU = ARCH_STM32F4 + +DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=GPIOC_11 + +# We're running on TDG PDM hardware! +DDEFS += -DHW_TDG_PDM8=1 + +DDEFS += -DEFI_CAN_SERIAL=TRUE + +DDEFS += -DFIRMWARE_ID=\"tdg-pdm8\" +DDEFS += -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS diff --git a/firmware/config/boards/tdg-pdm8/board_configuration.cpp b/firmware/config/boards/tdg-pdm8/board_configuration.cpp new file mode 100644 index 0000000000..abcacca562 --- /dev/null +++ b/firmware/config/boards/tdg-pdm8/board_configuration.cpp @@ -0,0 +1,16 @@ +#include "pch.h" + +void setSdCardConfigurationOverrides() { +} + +void setBoardConfigOverrides() { + // No divider, just direct connected analog inputs (they're all internal, so why divide?) + engineConfiguration->analogInputDividerCoefficient = 1; + + // 10k/100k divider + engineConfiguration->vbattDividerCoeff = 11; + engineConfiguration->vbattAdcChannel = EFI_ADC_4; + + engineConfiguration->canTxPin = GPIOA_12; + engineConfiguration->canRxPin = GPIOA_11; +} diff --git a/firmware/config/boards/tdg-pdm8/compile_tdg-pdm8.sh b/firmware/config/boards/tdg-pdm8/compile_tdg-pdm8.sh new file mode 100755 index 0000000000..a6fb7bf5a3 --- /dev/null +++ b/firmware/config/boards/tdg-pdm8/compile_tdg-pdm8.sh @@ -0,0 +1,4 @@ +#!/bin/bash +export PROJECT_BOARD=tdg-pdm8 + +bash ../common_make.sh diff --git a/firmware/config/boards/tdg-pdm8/connectors/main.yaml b/firmware/config/boards/tdg-pdm8/connectors/main.yaml new file mode 100644 index 0000000000..442e209005 --- /dev/null +++ b/firmware/config/boards/tdg-pdm8/connectors/main.yaml @@ -0,0 +1,119 @@ +pins: + - pin: 2 + id: EFI_ADC_4 + class: analog_inputs + function: Battery Sense + type: av + ts_name: Battery Sense + + - pin: 3/13 + id: GPIOA_10 + class: outputs + function: High Side Output + type: hs + ts_name: Out 8 + + - pin: 4/14 + id: GPIOA_9 + class: outputs + function: High Side Output + type: hs + ts_name: Out 7 + + - pin: 5/15 + id: GPIOA_8 + class: outputs + function: High Side Output + type: hs + ts_name: Out 6 + + - pin: 6/16 + id: GPIOC_9 + class: outputs + function: High Side Output + type: hs + ts_name: Out 5 + + - pin: 7/17 + id: GPIOA_3 + class: outputs + function: High Side Output + type: hs + ts_name: Out 4 + + - pin: 8/18 + id: GPIOA_2 + class: outputs + function: High Side Output + type: hs + ts_name: Out 3 + + - pin: 9/19 + id: GPIOA_1 + class: outputs + function: High Side Output + type: hs + ts_name: Out 2 + + - pin: 10/20 + id: GPIOA_0 + class: outputs + function: High Side Output + type: hs + ts_name: Out 1 + + - pin: 3/13 + id: EFI_ADC_9 + class: analog_inputs + function: Current Sense + type: av + ts_name: Sense 8 + + - pin: 4/14 + id: EFI_ADC_8 + class: analog_inputs + function: Current Sense + type: av + ts_name: Sense 7 + + - pin: 5/15 + id: EFI_ADC_15 + class: analog_inputs + function: Current Sense + type: av + ts_name: Sense 6 + + - pin: 6/16 + id: EFI_ADC_14 + class: analog_inputs + function: Current Sense + type: av + ts_name: Sense 5 + + - pin: 7/17 + id: EFI_ADC_13 + class: analog_inputs + function: Current Sense + type: av + ts_name: Sense 4 + + - pin: 8/18 + id: EFI_ADC_12 + class: analog_inputs + function: Current Sense + type: av + ts_name: Sense 3 + + - pin: 9/19 + id: EFI_ADC_11 + class: analog_inputs + function: Current Sense + type: av + ts_name: Sense 2 + + - pin: 10/20 + id: EFI_ADC_10 + class: analog_inputs + function: Current Sense + type: av + ts_name: Sense 1 diff --git a/firmware/config/boards/tdg-pdm8/prepend.txt b/firmware/config/boards/tdg-pdm8/prepend.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/firmware/gen_config.sh b/firmware/gen_config.sh index 0d6644e337..5498f343b5 100755 --- a/firmware/gen_config.sh +++ b/firmware/gen_config.sh @@ -38,6 +38,7 @@ for BOARD in \ "proteus proteus_h7" \ "f429-discovery f429-discovery" \ "atlas atlas"\ + "tdg-pdm8 tdg-pdm8"\ ; do BOARD_NAME=$(echo "$BOARD" | cut -d " " -f 1) BOARD_SHORT_NAME=$(echo "$BOARD" | cut -d " " -f 2)