Skip to content

Fix broken Linux ECU A flashing script (dfu-util + .hex) - #68

Merged
CamilleTTT merged 1 commit into
ToyotaInfoTech:mainfrom
Zec-Wicks:fix/programecua-hex-dfu
Aug 5, 2026
Merged

Fix broken Linux ECU A flashing script (dfu-util + .hex)#68
CamilleTTT merged 1 commit into
ToyotaInfoTech:mainfrom
Zec-Wicks:fix/programecua-hex-dfu

Conversation

@Zec-Wicks

Copy link
Copy Markdown
Contributor

Problem

scripts/STbootloader/linux/ProgramECU_A.sh currently fails on every
run with:

dfu-util: Only DfuSe file version 1.1a is supported
dfu-util: (for raw binary download, use the --dfuse-address option)

This regressed in e34ad5f, which switched the script to pass ECUA.hex
straight to dfu-util (dropping --dfuse-address) and removed the
ECUA.bin the previous, working version relied on. dfu-util has never
been able to parse Intel HEX for DfuSe devices — it needs either a raw
binary + --dfuse-address, or a .dfu-wrapped file.

Fix

Convert ECUA.hex to a raw binary with objcopy at flash time, then
pass --dfuse-address 0x08000000:leave as before e34ad5f. This avoids
re-adding a binary artifact to the repo and keeps .hex as the single
source of truth, matching the Windows script (STM32_Programmer_CLI)
which reads .hex natively via its own parser.

Testing

Verified end-to-end on a fresh (never-flashed) RAMN board:

  • Fedora 42 KDE, dfu-util 0.11
  • Board enumerates as 0483:df11 in DFU mode
  • Script now flashes successfully and board re-enumerates as a CDC
    serial device afterwards
  • ProgramECU_BCD.sh then completes normally

Closes #67

Note: This bug does not exist in ProgramECU_BCD.sh.
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🔨 Build & Macro Coverage Report

Default Builds — Hex File Sizes

ECU Debug (tag 15.0) Debug (tag 2.1.1) Release (tag 15.0) Release (tag 2.1.1)
ECUA 544 KiB (557127 bytes) 544 KiB (557082 bytes) 367 KiB (376308 bytes) 367 KiB (376292 bytes)
ECUB 363 KiB (372496 bytes) 363 KiB (372496 bytes) 217 KiB (222211 bytes) 216 KiB (221671 bytes)
ECUC 345 KiB (353325 bytes) 345 KiB (353325 bytes) 196 KiB (201638 bytes) 196 KiB (201127 bytes)
ECUD 354 KiB (363053 bytes) 354 KiB (363053 bytes) 204 KiB (209063 bytes) 203 KiB (208793 bytes)

Macro Coverage Build Results

Variant Macros Changed Result Warnings
gsusb +ENABLE_GSUSB ✅ Pass 5
gsusb_and_bb +ENABLE_GSUSB +ENABLE_BITBANG ✅ Pass 5
i2c +ENABLE_I2C ✅ Pass 5
j1939 +DEFAULT_TRAFFIC_MODE=TRAFFIC_MODE_J1939 ✅ Pass 5
j1939_showcase_mode +DEFAULT_TRAFFIC_MODE=TRAFFIC_MODE_J1939 +RAMN_SHOWCASE_MODE ✅ Pass 5
kwp +ENABLE_KWP ✅ Pass 5
no_debug ENABLE_USB_DEBUGENABLE_JOYSTICK_CONTROLSENABLE_SCREENENABLE_CHIP8GENERATE_RUNTIME_STATS ✅ Pass 5
no_dynamic_bitrate ENABLE_DYNAMIC_BITRATE ✅ Pass 5
no_extras ENABLE_J1979ENABLE_MINICTFENABLE_CHIP8ENABLE_SCREENENABLE_SPI ✅ Pass 5
no_uds ENABLE_UDSENABLE_UDS_REPROGRAMMING ✅ Pass 6
uart +ENABLE_UARTENABLE_CDCENABLE_USB ✅ Pass 5
usb_autodetect +ENABLE_USB_AUTODETECT ✅ Pass 5
watchdog +WATCHDOG_ENABLE ✅ Pass 5

Source Code Compile Coverage

  • Total .c source lines: 21762
  • Lines compiled in ≥1 configuration: 20624 (~95%)
  • ENABLE_ macro coverage: 22/22 (100.0%) macros tested in both ON and OFF states
Full ENABLE_ Macro Coverage Table
# Macro Tested ON Tested OFF Covered
1 ENABLE_ADC default (ECUB, ECUC, ECUD) default (ECUA)
2 ENABLE_BITBANG default (ECUA), variant: gsusb_and_bb default (ECUB, ECUC, ECUD)
3 ENABLE_CDC default (ECUA) default (ECUB, ECUC, ECUD), variant: uart
4 ENABLE_CHIP8 default (ECUA) default (ECUB, ECUC, ECUD), variant: no_debug, variant: no_extras
5 ENABLE_DYNAMIC_BITRATE default (ECUA, ECUB, ECUC, ECUD) variant: no_dynamic_bitrate
6 ENABLE_GSUSB variant: gsusb, variant: gsusb_and_bb default (ECUA, ECUB, ECUC, ECUD)
7 ENABLE_I2C variant: i2c default (ECUA, ECUB, ECUC, ECUD)
8 ENABLE_J1979 default (ECUA, ECUB, ECUC, ECUD) variant: no_extras
9 ENABLE_JOYSTICK_CONTROLS default (ECUA) default (ECUB, ECUC, ECUD), variant: no_debug
10 ENABLE_KWP variant: kwp default (ECUA, ECUB, ECUC, ECUD)
11 ENABLE_MINICTF default (ECUA, ECUD) default (ECUB, ECUC), variant: no_extras
12 ENABLE_SCREEN default (ECUA) default (ECUB, ECUC, ECUD), variant: no_debug, variant: no_extras
13 ENABLE_SPI default (ECUA, ECUD) default (ECUB, ECUC), variant: no_extras
14 ENABLE_UART variant: uart default (ECUA, ECUB, ECUC, ECUD)
15 ENABLE_UDS default (ECUA, ECUB, ECUC, ECUD) variant: no_uds
16 ENABLE_UDS_REPROGRAMMING default (ECUA, ECUB, ECUC, ECUD) variant: no_uds
17 ENABLE_USB default (ECUA) default (ECUB, ECUC, ECUD), variant: uart
18 ENABLE_USB_AUTODETECT variant: usb_autodetect default (ECUA, ECUB, ECUC, ECUD)
19 ENABLE_USB_DEBUG default (ECUA) default (ECUB, ECUC, ECUD), variant: no_debug
20 ENABLE_XCP default (ECUB, ECUC, ECUD) default (ECUA)
21 GENERATE_RUNTIME_STATS default (ECUA, ECUB, ECUC, ECUD) variant: no_debug
22 WATCHDOG_ENABLE variant: watchdog default (ECUA, ECUB, ECUC, ECUD)

@CamilleTTT
CamilleTTT merged commit b402f9f into ToyotaInfoTech:main Aug 5, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ProgramECU_A.sh (Linux) broken since e34ad5f — passes .hex to dfu-util without --dfuse-address

2 participants