Hardware CI specifies exact device serial number (#4912)

* scripts specify exact hardware CI device

* proteus serial number

* dropped this: |

* read envionment variable for correct port

* it's lowercase for whatever reason

* d'oh
This commit is contained in:
Matthew Kennedy 2022-12-21 09:46:25 -08:00 committed by GitHub
parent d755831d6d
commit f7a10a8a68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 7 deletions

View File

@ -18,6 +18,8 @@ jobs:
# folder: f407-discovery
# config-name: all
# ini-file: rusefi_f4-disco.ini
# openocd-script: ../.github/workflows/openocd_ci_f4_discovery.cfg
# serial-device: /dev/serial/by-id/TODO
- build-target: proteus_f4
script: hardware_ci_proteus
@ -25,6 +27,8 @@ jobs:
folder: proteus
config-name: proteus_f4
ini-file: rusefi_proteus_f4.ini
openocd-script: ../.github/workflows/openocd_ci_proteus.cfg
serial-device: /dev/serial/by-id/usb-rusEFI_LLC_rusEFI_Engine_Management_ECU_41003D000451383037343335-if01
runs-on: ${{matrix.runs-on}}
@ -66,7 +70,9 @@ jobs:
run: make clean
- name: Set EXTRA env
run: echo "EXTRA_2_PARAMS=-DHARDWARE_CI" >> $GITHUB_ENV
run: |
echo "EXTRA_2_PARAMS=-DHARDWARE_CI" >> $GITHUB_ENV
echo "HARDWARE_CI_SERIAL_DEVICE=${{matrix.serial-device}}" >> $GITHUB_ENV
- name: Build Firmware
run: bash misc/jenkins/compile_other_versions/compile.sh ${{matrix.folder}} ${{matrix.build-target}} ${{matrix.ini-file}}
@ -76,7 +82,7 @@ jobs:
- name: OpenOCD wipe & flash STM32
working-directory: ./firmware
run: openocd -f "interface/stlink.cfg" -f "target/stm32f4x.cfg" -c init -c targets -c "reset halt" -c "flash erase_sector 0 0 11" -c "flash write_image "deliver/rusefi.bin" 0x08000000" -c "reset run" -c "shutdown"
run: openocd -f "${{matrix.openocd-script}}" -c init -c targets -c "reset halt" -c "flash erase_sector 0 0 11" -c "flash write_image "deliver/rusefi.bin" 0x08000000" -c "reset run" -c "shutdown"
- name: Generate Java (Antlr)
working-directory: ./java_tools

View File

@ -0,0 +1,15 @@
# Openocd script for STM32F4 Discovery Hardware CI
source [find interface/stlink.cfg]
hla_serial wrong_serial
transport select hla_swd
# increase working area to 128KB
set WORKAREASIZE 0x20000
# chip name
set CHIPNAME F4_DISCOVERY
source [find target/stm32f4x.cfg]
reset_config srst_only

View File

@ -0,0 +1,15 @@
# Openocd script for Proteus hardware CI
source [find interface/stlink.cfg]
hla_serial 004D00323137511133333639
transport select hla_swd
# increase working area to 128KB
set WORKAREASIZE 0x20000
# chip name
set CHIPNAME PROTEUS
source [find target/stm32f4x.cfg]
reset_config srst_only

View File

@ -35,12 +35,16 @@ public class ControllerConnectorState {
*/
TestingUtils.isRealHardware = true;
FileLog.MAIN.start();
String port = System.getProperty("ecu.port");
String port = System.getenv("HARDWARE_CI_SERIAL_DEVICE");
if (port == null) {
port = PortDetector.autoDetectSerial(null).getSerialPort();
if (port == null)
throw new IllegalStateException("ECU serial not detected");
System.out.println("Auto-connected to " + port);
port = System.getProperty("ecu.port");
if (port == null) {
port = PortDetector.autoDetectSerial(null).getSerialPort();
if (port == null)
throw new IllegalStateException("ECU serial not detected");
System.out.println("Auto-connected to " + port);
}
}
IoUtil.realHardwareConnect(linkManager, port);