gdi firmware progress (#62)

* led port

* mc data

* debuggable

* makefile, correct spi device
This commit is contained in:
Matthew Kennedy 2022-04-10 14:38:52 -07:00 committed by GitHub
parent 924f48519b
commit be794b17df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 25087 additions and 9 deletions

21
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug GDI GD32",
"type": "cortex-debug",
"request": "launch",
"cwd": "${workspaceFolder}/GDI4-ch/firmware",
"executable": "${workspaceFolder}/GDI4-ch/firmware/build/gdi4.elf",
"device": "STM32F103CB",
"v1": false,
"svdFile": "${workspaceFolder}/GDI4-ch/firmware/STM32F103xx.svd",
"servertype": "openocd",
"configFiles": ["interface/stlink.cfg", "target/stm32f1x.cfg"],
"runToMain": true,
}
]
}

View File

@ -3,12 +3,6 @@
# NOTE: Can be overridden externally.
#
ifeq ($(BOARD),)
BOARD = f0_module
endif
BOARDDIR = boards/$(BOARD)
# Compiler options here.
ifeq ($(USE_OPT),)
USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -fsingle-precision-constant
@ -129,6 +123,7 @@ LDSCRIPT= $(STARTUPLD)/STM32F103xB.ld
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(ALLCSRC) \
mc33816_data.c
# C++ sources that can be compiled in ARM or THUMB mode depending on the global

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
#pragma once
#define LED_BLUE_PORT GPIOC
#define LED_BLUE_PORT GPIOB
#define LED_BLUE_PIN 13
#define LED_GREEN_PORT GPIOA

View File

@ -0,0 +1,97 @@
/*
* mc33816_data.c
*
* For historic reasons rusEFI source code refers to all this as mc33816 while the microcode
* is signed with MC33PT2001 key. to use real mc33816 you would have to replace binary data with true mc33816 version
*
* this is manual copy-paste of sample_code/PT2001_LoadData.c
* see mc33816/rusefi/readme.md
*/
// Data to be loaded into the Code RAM 1 memory space
const unsigned short MC33816_code_RAM1[88] =
{
0x7612, 0x6C2B, 0x917F, 0xA514, 0x8DD1, 0xC289, 0x7C38, 0xA73B, 0xF359, 0x56C3,
0xEE73, 0x812F, 0xDFA9, 0x2ED5, 0x2722, 0xBC58, 0x649B, 0xFB66, 0xFAD7, 0xBB51,
0xBD0C, 0xBEA9, 0x2F34, 0xDA2C, 0x41CF, 0x8DDD, 0xB4F4, 0xCA54, 0xAF19, 0x6707,
0xDA8A, 0x1D69, 0x6015, 0xA215, 0xB473, 0xF3AB, 0x6CC1, 0xE620, 0x8D0F, 0x5FC6,
0x3DA2, 0x4662, 0x0EF2, 0x63A6, 0xEFAD, 0x9915, 0xA134, 0xBB55, 0xD6E8, 0xBDC9,
0x433D, 0x3943, 0x4AEA, 0xCD3C, 0xE90A, 0xC413, 0xD3A3, 0xF690, 0xE423, 0x0106,
0x72BC, 0xD39A, 0x0329, 0x3AF3, 0x9F62, 0x9FA6, 0xD615, 0xEF1D, 0xAF32, 0x31BF,
0x5A43, 0x2FAD, 0xFD4E, 0xB35B, 0x56F3, 0xFAB7, 0x5ADE, 0x3A4C, 0xCA7D, 0x20AF,
0x24CE, 0x808E, 0x43CD, 0xDF83, 0xE8DF, 0x7CC1, 0xE738, 0x1B09
};
// Data to be loaded into the Code RAM 2 memory space
const unsigned short MC33816_code_RAM2[43] =
{
0x761B, 0x6F45, 0x838D, 0x80B4, 0x53F2, 0x0EBC, 0x8F2D, 0xA78E, 0xE8AB, 0xE3DB,
0xF477, 0x800F, 0x2336, 0x2F77, 0x267B, 0xBC19, 0x007E, 0x4E55, 0x28AA, 0x52E4,
0x40CF, 0x0AFD, 0x8B32, 0xFF03, 0x3D8E, 0x802E, 0x1340, 0x95D0, 0x1E86, 0x6591,
0xDBEB, 0x786D, 0xB2DF, 0xF4BF, 0xBEB2, 0xF1F4, 0x9E53, 0xE743, 0xE842, 0x3DD7,
0x3DA2, 0x4663, 0x03AF
};
// Data to be loaded into the Data RAM memory space
const unsigned short MC33816_data_RAM[128] =
{
0x00F0, 0x00F0, 0x008C, 0x2000, 0x01F4, 0x00B4, 0x003C, 0xEA60, 0x0000, 0x003D,
0x6000, 0x003C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x00C1, 0x00BF, 0x002F, 0x001D, 0x0000, 0x0046,
0x0037, 0x003C, 0xEA60, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
// 0x1CE
// if set to '1' Driver_status register is reset on read.
#define Rsetbr 1
// Data to be loaded into the Main register memory space
const unsigned short MC33816_main_config[29] =
{
0x0003, 0x1FFE, 0x0000, 0x1200, 0x0000, 0x0000, 0x0001, 0x0000, 0x001F, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, Rsetbr, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
// Data to be loaded into the CH1 register memory space
const unsigned short MC33816_ch1_config[19] =
{
0x0008, 0x0000, 0x0000, 0x0000, 0x0303, 0x0000, 0x0000, 0x0058, 0x8E62, 0x7B23,
0x0000, 0x002C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
// Data to be loaded into the CH2 register memory space
const unsigned short MC33816_ch2_config[19] =
{
0x0008, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0000, 0x0000, 0x002B, 0x218C, 0xDCB6,
0x0000, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
// Data to be loaded into the IO register memory space
const unsigned short MC33816_io_config[44] =
{
0x0000, 0x0000, 0x0000, 0x0000, 0x0063, 0x018C, 0x0800, 0x0410, 0x0041, 0x0098,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0041, 0x0041, 0x0041, 0x0000, 0x0004, 0x1000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7F7F, 0x7F7F,
0x007F, 0x0000, 0x0000, 0x0000
};
// Data to be loaded into the Diag register memory space
const unsigned short MC33816_diag_config[44] =
{
0x0000, 0x0000, 0x001E, 0x0000, 0x0000, 0x001E, 0x0000, 0x0000, 0x001E, 0x0000,
0x0000, 0x001E, 0x0000, 0x0000, 0x001E, 0x0000, 0x0000, 0x001E, 0x001E, 0x0000,
0x0000, 0x001E, 0x0000, 0x0000, 0x001E, 0x0000, 0x0000, 0x001E, 0x0000, 0x0000,
0x001E, 0x0000, 0x0000, 0x001E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0001
};

View File

@ -0,0 +1,18 @@
/*
* mc33816_data.h
*
* @date May 3, 2019
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#pragma once
extern const unsigned short MC33816_code_RAM1[88]; // CODE RAM CH 1
extern const unsigned short MC33816_code_RAM2[43]; // CODE RAM CH 2
extern const unsigned short MC33816_data_RAM[128]; // DATA RAM
extern const unsigned short MC33816_main_config[29]; // main configurations
extern const unsigned short MC33816_ch1_config[19]; // CH 1 configurations
extern const unsigned short MC33816_ch2_config[19]; // CH 2 configurations
extern const unsigned short MC33816_io_config[44]; // IO configurations
extern const unsigned short MC33816_diag_config[44]; // diag configurations

View File

@ -0,0 +1,24 @@
/**
* see mc33816/rusefi/readme.md
*/
typedef enum {
// see dram1.def values
Iboost = 0,
Ipeak = 1,
Ihold = 2,
Tpeak_off = 3,
Tpeak_tot = 4,
Tbypass = 5,
Thold_off = 6,
Thold_tot = 7,
// see dram2.def values, base 64 for channel 2
Vboost_high = 64,
Vboost_low = 65,
Isense4_high = 66,
Isense4_low = 67,
HPFP_Ipeak = 69,
HPFP_Ihold = 70,
HPFP_Thold_off = 71,
HPFP_Thold_tot = 72,
} MC33816Mem;

View File

@ -167,8 +167,8 @@
/*
* SPI driver system settings.
*/
#define STM32_SPI_USE_SPI1 FALSE
#define STM32_SPI_USE_SPI2 TRUE
#define STM32_SPI_USE_SPI1 TRUE
#define STM32_SPI_USE_SPI2 FALSE
#define STM32_SPI_USE_SPI3 FALSE
#define STM32_SPI_SPI1_DMA_PRIORITY 1
#define STM32_SPI_SPI2_DMA_PRIORITY 1