Subaru board update (#2600)

* board: subaru eg33: linker script: stack, bss and heap to ram0

* Board: Subaru EG33: clean-up configs

* board-subaru-eg33: fix board config

* engine: subaru: eg33: fixes
This commit is contained in:
Andrey G 2021-04-29 03:25:33 +03:00 committed by GitHub
parent abfbc48d70
commit 6d6dca8d07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 16 deletions

View File

@ -14,14 +14,13 @@ ifeq ($(USE_BOOTLOADER),yes)
endif
#LED
LED_CRITICAL_ERROR_BRAIN_PIN = -DLED_CRITICAL_ERROR_BRAIN_PIN=GPIOG_7
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=GPIOG_7
# We are running on Subaru EG33 hardware!
DDEFS += -DHW_SUBARU_EG33=1
# Override DEFAULT_ENGINE_TYPE
# Fix
DDEFS += -DDEFAULT_ENGINE_TYPE=SUBARUEG33_DEFAULTS -DSTM32F765xx $(LED_CRITICAL_ERROR_BRAIN_PIN)
DDEFS += -DDEFAULT_ENGINE_TYPE=SUBARUEG33_DEFAULTS
#Some options override
DDEFS += -DHAL_TRIGGER_USE_PAL=TRUE

View File

@ -50,8 +50,9 @@ void setBoardDefaultConfiguration(void) {
engineConfiguration->vbattAdcChannel = EFI_ADC_6;
/* Throttle position */
engineConfiguration->tps1_1AdcChannel = EFI_ADC_12;
/* MAP */
engineConfiguration->map.sensor.hwChannel = EFI_ADC_10;
/* MAP: stock car dows not have MAP
* but EFI_ADC_10 is reserved for this purpose */
engineConfiguration->map.sensor.hwChannel = EFI_ADC_NONE;
/* MAF */
engineConfiguration->mafAdcChannel = EFI_ADC_3;
/* coolant t */
@ -118,13 +119,13 @@ void setBoardDefaultConfiguration(void) {
/* MC33972 */
engineConfiguration->mc33972spiDevice = SPI_DEVICE_4;
engineConfiguration->mc33972_cs = GPIOE_10; /* SPI4_NSS2 */
engineConfiguration->mc33972_csPinMode = OM_OPENDRAIN;
engineConfiguration->mc33972_csPinMode = OM_DEFAULT;
/* TLE6240 - OUT3, also PG2 */
engineConfiguration->tachOutputPin = TLE6240_PIN_2;
engineConfiguration->tachOutputPinMode = OM_DEFAULT;
/* spi driven - TLE6240 - OUT5 */
#if 0
#if 1
engineConfiguration->fuelPumpPin = TLE6240_PIN_5;
engineConfiguration->fuelPumpPinMode = OM_DEFAULT;
/* self shutdown? */

View File

@ -10,6 +10,7 @@
#include "subaru.h"
#include "custom_engine.h"
#include "allsensors.h"
EXTERN_CONFIG;
@ -81,9 +82,7 @@ void setSubaruEG33Defaults(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
/* TODO: */
engineConfiguration->globalTriggerAngleOffset = 114; // the end of 19th tooth?
/* TODO: */
//engineConfiguration->fuelAlgorithm = LM_REAL_MAF;
engineConfiguration->fuelAlgorithm = LM_ALPHA_N;
engineConfiguration->fuelAlgorithm = LM_REAL_MAF;
engineConfiguration->specs.displacement = 3.30;
engineConfiguration->injector.flow = 250;
@ -101,10 +100,9 @@ void setSubaruEG33Defaults(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->canReadEnabled = true;
engineConfiguration->canWriteEnabled = false;
/* TODO: */
//engineConfiguration->tpsMin = convertVoltageTo10bitADC(0.250);
//engineConfiguration->tpsMax = convertVoltageTo10bitADC(4.538);
//engineConfiguration->tpsMax = convertVoltageTo10bitADC(5.000);
/* Reversed: fully closed - 4.7V, fully opened - 0.9 */
engineConfiguration->tpsMin = convertVoltageTo10bitADC(4.7);
engineConfiguration->tpsMax = convertVoltageTo10bitADC(0.9);
engineConfiguration->tpsErrorDetectionTooLow = -10; // -10% open
engineConfiguration->tpsErrorDetectionTooHigh = 110; // 110% open

View File

@ -73,11 +73,11 @@ 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", ram3);
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", ram3);
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
/* RAM region to be used for data segment.*/
REGION_ALIAS("DATA_RAM", ram0);