[P0] Firmware build broken on main — 7 compile errors across 6 files #337

Closed
opened 2026-03-03 11:21:27 -05:00 by seb · 0 comments
Owner

Priority: P0 — BLOCKS ALL FIRMWARE WORK

main branch does not compile. Multiple agent PRs merged broken code. This must be fixed before any new firmware PRs are merged.

Errors on clean build of main (ffc69a0)

File Error Root Cause
src/battery.c unknown type name bool, false undeclared Missing #include <stdbool.h>
src/main.c BUZZER_PATTERN_ARM_CHIME undeclared Renamed/removed constant, caller not updated
src/main.c bno055_active undeclared Variable removed but references left behind
src/servo.c conflicting types for ServoState Duplicate typedef in .c (already in .h)
src/ultrasonic.c static declaration follows non-static HAL_TIM_IC_Init_Compat declared static but previously non-static
src/fan.c TIM_TypeDef has no member Instance HAL_TIM_PWM_Start(FAN_TIM, ...) passes TIM_TypeDef* instead of TIM_HandleTypeDef*
src/watchdog.c lvalue required as unary & operand HAL_IWDG_Refresh(&IWDG)IWDG is a register base, not a handle; hiwdg is local to wrong scope

Linker errors (after fixing compile errors)

Symbol Referenced From
i2c1_write, i2c1_read src/ina219.c — functions called but never defined
servo_tick src/main.c — called but missing from servo.c
imu_calibrated src/main.c — called but never defined anywhere
crsf_is_active src/main.c — called but missing (crsf.c has no such function)

Impact

  • No firmware can be built or flashed from current main
  • Salty had to write temporary stubs/fixups to get a working build for UART remapping work
  • All firmware agent PRs are blocked until this is resolved

Required Actions

  1. Fix all 7 compile errors listed above
  2. Implement or properly stub the 4 missing linker symbols
  3. Verify pio run succeeds with zero errors on a clean checkout
  4. Add CI build check — PRs must not be merged if pio run fails

Temporary Workaround

Salty's fixes are in the working tree on mbpm4 (~/Projects/saltylab-firmware). Files modified: battery.c, fan.c, main.c, servo.c, ultrasonic.c, watchdog.c, plus new fixups.c with linker stubs. These are hacks — proper fixes needed.

/cc @max

## Priority: P0 — BLOCKS ALL FIRMWARE WORK `main` branch does not compile. Multiple agent PRs merged broken code. This must be fixed before any new firmware PRs are merged. ### Errors on clean build of `main` (ffc69a0) | File | Error | Root Cause | |------|-------|------------| | `src/battery.c` | `unknown type name bool`, `false undeclared` | Missing `#include <stdbool.h>` | | `src/main.c` | `BUZZER_PATTERN_ARM_CHIME undeclared` | Renamed/removed constant, caller not updated | | `src/main.c` | `bno055_active undeclared` | Variable removed but references left behind | | `src/servo.c` | `conflicting types for ServoState` | Duplicate typedef in .c (already in .h) | | `src/ultrasonic.c` | `static declaration follows non-static` | `HAL_TIM_IC_Init_Compat` declared static but previously non-static | | `src/fan.c` | `TIM_TypeDef has no member Instance` | `HAL_TIM_PWM_Start(FAN_TIM, ...)` passes `TIM_TypeDef*` instead of `TIM_HandleTypeDef*` | | `src/watchdog.c` | `lvalue required as unary & operand` | `HAL_IWDG_Refresh(&IWDG)` — `IWDG` is a register base, not a handle; `hiwdg` is local to wrong scope | ### Linker errors (after fixing compile errors) | Symbol | Referenced From | |--------|-----------------| | `i2c1_write`, `i2c1_read` | `src/ina219.c` — functions called but never defined | | `servo_tick` | `src/main.c` — called but missing from servo.c | | `imu_calibrated` | `src/main.c` — called but never defined anywhere | | `crsf_is_active` | `src/main.c` — called but missing (crsf.c has no such function) | ### Impact - **No firmware can be built or flashed** from current main - Salty had to write temporary stubs/fixups to get a working build for UART remapping work - All firmware agent PRs are blocked until this is resolved ### Required Actions 1. Fix all 7 compile errors listed above 2. Implement or properly stub the 4 missing linker symbols 3. Verify `pio run` succeeds with zero errors on a clean checkout 4. **Add CI build check** — PRs must not be merged if `pio run` fails ### Temporary Workaround Salty's fixes are in the working tree on mbpm4 (`~/Projects/saltylab-firmware`). Files modified: `battery.c`, `fan.c`, `main.c`, `servo.c`, `ultrasonic.c`, `watchdog.c`, plus new `fixups.c` with linker stubs. These are hacks — proper fixes needed. /cc @max
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seb/saltylab-firmware#337
No description provided.