From 78836a3565a53a8e67af36144d8658c15317362d Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Tue, 31 Jan 2023 21:55:22 -0800 Subject: [PATCH] add info about config generation --- Config-Generation.md | 52 ++++++++++++++++++++++++++++++++++++++++++++ _Sidebar.md | 1 + 2 files changed, 53 insertions(+) create mode 100644 Config-Generation.md diff --git a/Config-Generation.md b/Config-Generation.md new file mode 100644 index 00000000..2d0e16c8 --- /dev/null +++ b/Config-Generation.md @@ -0,0 +1,52 @@ + +# Input Files + +## `integration/rusefi_config.txt` + +Defines the data types, scaling, and memory layout of the ECU's configuration. All parameters/tables/etc are defined here. + +## `tunerstudio/rusefi.input` + +Defines the template to generate the TunerStudio ini file. This defines the UI layout that presents the ECU's configuration to the user. + +## `config/boards//connectors/*.yaml` + +One yaml file per physical connector on a board defines the mapping between MCU pins and the corresponding name and function that pin serves on the outside world. + +For example, this section from `config/boards/proteus/connectors/white35.yaml`: + +```yaml +- pin: 18 + id: [A6, EFI_ADC_6] + class: [switch_inputs, analog_inputs] + ts_name: Analog Volt 11 + function: "Analog Voltage Input #11" + type: av +``` + +This means: +- Pin 18 on the connector (any string, not just numbers is possible) +- `id` and `class` are paired arrays that list things this pin can do. When acting as the type `switch_input`, use CPU pin `A6`. When acting as type `analog_inputs`, use `EFI_ADC_6` (adc channel 6). +- In TunerStudio, this pin will appear as "Analog Volt 11" +- The type of the pin is `av`, which means "analog voltage input" + +## `config/boards//prepend.txt` + +Parsed before `rusefi_config.txt`, to set any definitions that should be different for this board. For example, Proteus uses this file to allocate more configuration space to the Lua script than other boards. + + +# Output Files + +These inputs generate various files: +- `engine_configuration_generated_structures.h`, `rusefi_generated.h`, etc: these generated headers tell the firmware build where various configuration parameters are, and the values of various definitions. +- `signature_.h`: Tells the firmware what signature to report to TunerStudio (et al) so that it can select a matching ini file for this exact firmware. +- `rusefi_.ini`: The ini file used to describe to TunerStudio both the layout of configuration parameters and the layout of the UI presenting those parameters to the user. +- `ramdisk_image.h`, `ramdisk_image_compressed.h`: Generated to create the read-only USB drive presented by the ECU that contains the ini file and some links. Means you don't need internet to connect TunerStudio to the ECU. + +# Usage + +To generate configs for a board called `proteus_f4` from the folder `config/boards/proteus`, run: + +`./gen_config.sh proteus proteus_f4` + +_nb: the second parameter is there so that you can have multiple generated configs for "similar" boards, for example Proteus has F4, F7 and H7 variants that use the same folder but potentially different configs._ diff --git a/_Sidebar.md b/_Sidebar.md index 43743f53..227685a4 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -75,6 +75,7 @@ - [Firmware Code Automated Test Coverage](https://rusefi.com/docs/unit_tests_coverage) - [HOWTO Contribute To Firmware](HOWTO-contribute-to-firmware) - [Firmware performance tracing](Developer-Performance-Tracing) +- [Config generation](Config-Generation) ## Misc