Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
8880602
Set DAC_HAS_MCR FALSE in STM32F1xx registry. (#336)
rusefillc Jun 20, 2025
051a116
toggle ESR driver before starting sampling
mck1117 Jun 20, 2025
16d7439
c++20 (#339)
rusefillc Jun 20, 2025
35e12c0
implement F1 async adc
mck1117 Jun 20, 2025
59e2391
rename fault -> status
mck1117 Jul 24, 2025
2846547
add more status states
mck1117 Jul 24, 2025
99b5f04
CAN bootloader cmds using defines (#333)
dron0gus Jul 24, 2025
9cadfa7
add a hacky knob for pump gain over CAN
mck1117 Jul 24, 2025
9abce1d
fix Status::None
mck1117 Jul 24, 2025
f16b9aa
s
mck1117 Jul 24, 2025
5d3bf8d
use signalI, not signal for ADC done callback
mck1117 Jul 25, 2025
485654d
enable state check on F0
mck1117 Jul 25, 2025
38d6e86
lock / unlock in adcDoneCallback
mck1117 Jul 25, 2025
9609877
F0 module board.h #340
mck1117 Jul 25, 2025
77916b4
this is always defined, so the guard is a noop
mck1117 Jul 27, 2025
b4cfb51
better voltage sense guards
mck1117 Jul 27, 2025
930ef7d
heater control comment
mck1117 Aug 19, 2025
d446982
add error status helper
mck1117 Aug 19, 2025
7c0097d
static -> static inline
mck1117 Aug 21, 2025
09c7221
remove NoHeaterSupply state (#292)
mck1117 Aug 22, 2025
14a2d30
bump f0 image
mck1117 Aug 22, 2025
0a4daac
typo
mck1117 Oct 2, 2025
5e2f598
fix typo
mck1117 Oct 2, 2025
b126ce9
comment accuracy
mck1117 Oct 2, 2025
919e3ea
read the correct byte for pump gain
mck1117 Oct 13, 2025
dcafdf5
bump f0 image
mck1117 Oct 13, 2025
8716f6a
remove pump validity condition
mck1117 Nov 23, 2025
1f77d82
bump f0 image
mck1117 Nov 23, 2025
acd0463
CAN RX: filter out not ours packets by WB_BL_HEADER (#343)
rusefillc Dec 13, 2025
9018004
heater: 5 sec stabilization time after switching to closed loop
dron0gus Jul 15, 2022
3a186d2
heater_control: retry heating attempt after timeout
dron0gus Feb 4, 2023
70bd7f9
f1_dual: select bigger Vbat voltage from two heater voltages
dron0gus Feb 1, 2023
85bd36f
TODO
dron0gus Feb 1, 2023
baf4b73
livedata: show per-channel heater supply voltage
dron0gus Feb 1, 2023
09911a5
livedata: show Nernst voltage
dron0gus Apr 26, 2023
e94bd19
sampling, heater: fix Battery vs Heater naming mess
dron0gus Jul 21, 2023
bb63734
heater: always rely on localy measured heater voltage
dron0gus Jul 21, 2023
0ad3305
Fix reset to DFU command
dron0gus Sep 24, 2023
27529ca
Add reset to DFU script
dron0gus Sep 25, 2023
32355d4
sampling: do not try to calculate ESR if NerstAc is clamped
dron0gus Oct 14, 2023
68b635f
openbtl: f1_dual_rev1: enable OpenBLT on USART2 (Bluetooth)
dron0gus Oct 16, 2023
4d6c6b3
OpneBLT: switch to my repo
dron0gus Oct 16, 2023
719bb7c
can_helper: DLC can be less than 8, support extended ID
dron0gus Feb 5, 2024
00dbcf5
CAN: protocol configuration to settings
dron0gus Feb 5, 2024
d475ad0
ini files: cleanup
dron0gus Feb 5, 2024
039dc4e
ini file update
dron0gus Feb 5, 2024
5d1d5c1
byteswap.h: add BE storage types
dron0gus Feb 10, 2024
8c965be
AEMNET: AFR and EGT
dron0gus Dec 10, 2023
d321bb8
CAN: EGT message rate is 20Hz
dron0gus Feb 10, 2024
087c673
f1_dual_rev1: bump signature
dron0gus Feb 11, 2024
0f09356
Github action to auto-generate releases
esaulenka Apr 8, 2024
a678e72
README update
dron0gus Jun 2, 2024
0d134e9
README: flashing
dron0gus Jun 2, 2024
6e4a21f
Missed flashing scripts
dron0gus Jun 2, 2024
cccc08a
README: minor changes
dron0gus Jun 2, 2024
9944b98
uart: directly chprintf() to SD device
dron0gus Jan 6, 2025
625ade3
port: make Configuration::LoadDefaults() common
dron0gus May 12, 2025
0e19403
port: Configuration: bump version
dron0gus May 12, 2025
dd19ae0
port: do not read ID pins if we have valid Configuration in flash
dron0gus May 12, 2025
e86e8ae
CAN: do not load configuration twice
dron0gus May 12, 2025
a6495bb
CAN: fix RusEFI CAN frame ID calculation
dron0gus May 12, 2025
8b1eb8a
Config: rename RusEfiOffset to RusEfiIdx
dron0gus May 12, 2025
b990a6d
f1_dual_rev1: fix clamped ADC input detection
dron0gus Jun 3, 2025
e7c2d99
WIP: LSU4.9 vs FAE detection
dron0gus Jun 3, 2025
c095e74
Update README.md
rusefillc Nov 18, 2025
6caedd5
Fix dual ini
xtitoris Dec 28, 2025
3397f5f
Add heater control parameters to TunerStudio
xtitoris Dec 29, 2025
f61d7b0
Added pixi environment for the ease of bootstrapping new development …
xtitoris Feb 10, 2026
d7caf56
Added c_cpp configuration for vscode pointing to pixi-provided compiler
xtitoris Feb 15, 2026
0ae68b4
fix f1_dual_rev1 UART1 connectivity
xtitoris Jun 11, 2026
4711d95
Update f1_dual_rev1 ADC order
xtitoris Jun 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@

*.sh text eol=lf
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
36 changes: 18 additions & 18 deletions .github/workflows/build-firmware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@ jobs:
matrix:
include:
- build-target: f0_module
# - build-target: f1_rev2
# - build-target: f1_rev3
# - build-target: f1_dual
# - build-target: f1_dual_rev1
- build-target: f1_rev2
- build-target: f1_rev3
- build-target: f1_dual
- build-target: f1_dual_rev1

steps:
- uses: actions/checkout@v1
with:
submodules: recursive

# Build machines don't have arm-none-eabi gcc, so let's download it and put it on the path
- name: Download & Install GCC
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: | # Compiler hosted on our other git repo - avoids having to download from the nice folks at ARM every time
wget 'https://github.com/rusefi/build_support/raw/master/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz' -O compiler.tar.xz
tar -xvf compiler.tar.xz
echo "::add-path::`pwd`/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin"

# Make sure the compiler we just downloaded works - just print out the version
- name: Test Compiler
run: arm-none-eabi-gcc -v
- uses: prefix-dev/setup-pixi@v0.9.4
with:
pixi-version: v0.63.2
cache: true

- name: Install build tools
run: |
sudo apt-get install srecord libarchive-zip-perl

- name: Build Firmware
working-directory: ./firmware/boards/${{matrix.build-target}}
run: ./build_wideband.sh
run: pixi run build ${{matrix.build-target}}

- name: Attach binaries
uses: actions/upload-artifact@v4
with:
name: Wideband ${{matrix.build-target}}
path: ./firmware/deliver/${{matrix.build-target}}/wideband*

- name: Zip artifacts
run: zip Wideband\ ${{matrix.build-target}}.zip ./firmware/deliver/${{matrix.build-target}}/wideband*

- name: Make a new Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: Wideband\ ${{matrix.build-target}}.zip
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ build/

# cortex-debug vscode extension local state
.vscode/.cortex-debug*state.json
# pixi environments
.pixi/*
!.pixi/config.toml
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
url = https://github.com/rusefi/kicad-libraries
[submodule "firmware/ext/openblt"]
path = firmware/ext/openblt
url = https://github.com/rusefi/openblt
url = https://github.com/dron0gus/openblt
[submodule "firmware/libfirmware"]
path = firmware/libfirmware
url = https://github.com/rusefi/libfirmware.git
Expand Down
133 changes: 133 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"configurations": [
{
"name": "F0 Module (default)",
"includePath": [
"${workspaceFolder}/firmware/boards/f0_module",
"${workspaceFolder}/firmware/ChibiOS/os/hal/include",
"${workspaceFolder}/firmware/ChibiOS/os/hal/templates/**",
"${workspaceFolder}/firmware/ChibiOS/os/hal/ports/STM32/LLD/ADCv1",
"${workspaceFolder}/firmware/ChibiOS/os/hal/ports/STM32/STM32F0xx",
"${workspaceFolder}/firmware/ChibiOS/os/hal/ports/STM32/**",
"${workspaceFolder}/firmware/ChibiOS/os/common/ext/ST/STM32F0xx",
"${workspaceFolder}/firmware/ChibiOS/os/common/startup/ARMCMx/devices/STM32F0xx",
"${workspaceFolder}/firmware/**"
],
"forcedInclude": [
"${workspaceFolder}/firmware/boards/f0_module/board.h"
],
"defines": [
"STM32F042x6",
"WB_PROD=1",
"USE_BOOTLOADER=1",
"_DEBUG"
],
"compilerPath": "${workspaceFolder}/.pixi/envs/default/bin/arm-none-eabi-gcc",
"cStandard": "gnu11",
"cppStandard": "c++20",
"intelliSenseMode": "gcc-arm"
},
{
"name": "F1 Dual",
"includePath": [
"${workspaceFolder}/firmware/boards/f1_dual",
"${workspaceFolder}/firmware/ChibiOS/os/hal/include",
"${workspaceFolder}/firmware/ChibiOS/os/hal/templates/**",
"${workspaceFolder}/firmware/ChibiOS/os/hal/ports/STM32/**",
"${workspaceFolder}/firmware/ChibiOS/os/hal/ports/STM32/STM32F1xx",
"${workspaceFolder}/firmware/ChibiOS/os/common/ext/ST/STM32F1xx",
"${workspaceFolder}/firmware/ChibiOS/os/common/startup/ARMCMx/devices/STM32F1xx",
"${workspaceFolder}/firmware/**"
],
"forcedInclude": [
"${workspaceFolder}/firmware/boards/f1_dual/board.h"
],
"defines": [
"WB_PROD=1",
"TS_ENABLED=TRUE",
"_DEBUG"
],
"compilerPath": "${workspaceFolder}/.pixi/envs/default/bin/arm-none-eabi-gcc",
"cStandard": "gnu11",
"cppStandard": "c++20",
"intelliSenseMode": "gcc-arm"
},
{
"name": "F1 Dual Rev1",
"includePath": [
"${workspaceFolder}/firmware/boards/f1_dual_rev1",
"${workspaceFolder}/firmware/ChibiOS/os/hal/include",
"${workspaceFolder}/firmware/ChibiOS/os/hal/templates/**",
"${workspaceFolder}/firmware/ChibiOS/os/hal/ports/STM32/STM32F1xx",
"${workspaceFolder}/firmware/ChibiOS/os/hal/ports/STM32/**",
"${workspaceFolder}/firmware/ChibiOS/os/common/ext/ST/STM32F1xx",
"${workspaceFolder}/firmware/ChibiOS/os/common/startup/ARMCMx/devices/STM32F1xx",
"${workspaceFolder}/firmware/**"
],
"forcedInclude": [
"${workspaceFolder}/firmware/boards/f1_dual_rev1/board.h",
"${workspaceFolder}/firmware/boards/f1_dual_rev1/io/io_pins.h"
],
"defines": [
"WB_PROD=1",
"TS_ENABLED=TRUE",
"_DEBUG"
],
"compilerPath": "${workspaceFolder}/.pixi/envs/default/bin/arm-none-eabi-gcc",
"cStandard": "gnu11",
"cppStandard": "c++20",
"intelliSenseMode": "gcc-arm"
},
{
"name": "F1 Rev2",
"includePath": [
"${workspaceFolder}/firmware/boards/f1_rev2",
"${workspaceFolder}/firmware/ChibiOS/os/hal/include",
"${workspaceFolder}/firmware/ChibiOS/os/hal/templates/**",
"${workspaceFolder}/firmware/ChibiOS/os/hal/ports/STM32/**",
"${workspaceFolder}/firmware/ChibiOS/os/hal/ports/STM32/STM32F1xx",
"${workspaceFolder}/firmware/ChibiOS/os/common/ext/ST/STM32F1xx",
"${workspaceFolder}/firmware/ChibiOS/os/common/startup/ARMCMx/devices/STM32F1xx",
"${workspaceFolder}/firmware/**"
],
"forcedInclude": [
"${workspaceFolder}/firmware/boards/f1_rev2/board.h"
],
"defines": [
"WB_PROD=1",
"TS_ENABLED=TRUE",
"_DEBUG"
],
"compilerPath": "${workspaceFolder}/.pixi/envs/default/bin/arm-none-eabi-gcc",
"cStandard": "gnu11",
"cppStandard": "c++20",
"intelliSenseMode": "gcc-arm"
},
{
"name": "F1 Rev3",
"includePath": [
"${workspaceFolder}/firmware/boards/f1_rev3",
"${workspaceFolder}/firmware/ChibiOS/os/hal/include",
"${workspaceFolder}/firmware/ChibiOS/os/hal/templates/**",
"${workspaceFolder}/firmware/ChibiOS/os/hal/ports/STM32/**",
"${workspaceFolder}/firmware/ChibiOS/os/hal/ports/STM32/STM32F1xx",
"${workspaceFolder}/firmware/ChibiOS/os/common/ext/ST/STM32F1xx",
"${workspaceFolder}/firmware/ChibiOS/os/common/startup/ARMCMx/devices/STM32F1xx",
"${workspaceFolder}/firmware/**"
],
"forcedInclude": [
"${workspaceFolder}/firmware/boards/f1_rev3/board.h"
],
"defines": [
"WB_PROD=1",
"TS_ENABLED=TRUE",
"_DEBUG"
],
"compilerPath": "${workspaceFolder}/.pixi/envs/default/bin/arm-none-eabi-gcc",
"cStandard": "gnu11",
"cppStandard": "c++20",
"intelliSenseMode": "gcc-arm"
}
],
"version": 4
}
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Wideband

This fork is for development of FW for [RusEFI](https://github.com/rusefi) [dual channel wideband](https://github.com/rusefi/rusefi-hardware/tree/main/lambda-x2). Based on [original design](https://github.com/mck1117/wideband) from [mck1117](https://github.com/mck1117)

For stm32f042 FW please refer to original repo. While I try to keep it buildable and unaffected by my modification I can not guaranty its functionality and provide any support.

# Initial flashing

For initial flashing of newly assembled device under Windows please refer to [this instruction](https://rusefi.com/forum/viewtopic.php?p=48379#p48379).

I hope Linux users are experience enough to know how to use [stm32flash tool](https://github.com/ARMinARM/stm32flash). There are two sample scripts to [flash OpenBLT only](/firmware/dfu_flash_openblt.sh) and [flash combined image of OpenBLT + main FW](/firmware/dfu_flash.sh).

# Update using OpenBLT

[OpenBLT](https://github.com/feaser/openblt) bootloader is used for FW update functionality. Please reffer to original [documentation](https://www.feaser.com/openblt/doku.php?id=faq) on how to compile host tools and use it.

There are few sample linux scripts for updating device over [CAN](/firmware/flash_can.sh) or [UART](/firmware/flash_uart.sh).

Linux users can use almost any USB to CAN adapter supported by linux and providing SocketCAN interface ([for example](https://rusefi.com/forum/viewtopic.php?f=13&t=2209)). Windows users please check OpenBLT documentation.

# Original readme

[![Build Firmware](https://github.com/mck1117/wideband/actions/workflows/build-firmware.yaml/badge.svg)](https://github.com/mck1117/wideband/actions/workflows/build-firmware.yaml) ![license](https://img.shields.io/github/license/mck1117/wideband)

# rusEFI Wideband Controller
Expand Down
2 changes: 1 addition & 1 deletion firmware/ChibiOS
15 changes: 8 additions & 7 deletions firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ endif

# C++ specific options here (added to USE_OPT).
ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -fno-rtti -fno-exceptions -ffast-math -funsafe-math-optimizations -fno-threadsafe-statics -fno-use-cxa-atexit -std=c++17
USE_CPPOPT = -fno-rtti -fno-exceptions -ffast-math -funsafe-math-optimizations -fno-threadsafe-statics -fno-use-cxa-atexit -std=c++20
endif

# Enable this if you want the linker to remove unused code and data.
Expand Down Expand Up @@ -136,7 +136,9 @@ LDSCRIPT=app.ld

# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(ALLCSRC) $(BOARDDIR)/board.c
CSRC = $(ALLCSRC) \
$(BOARDDIR)/board.c \
boards/f1_common/openblt/shared_params.c

# C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
Expand All @@ -148,7 +150,8 @@ CPPSRC = $(ALLCPPSRC) \
shared/flash.cpp \
can.cpp \
can_helper.cpp \
fault.cpp \
can_aemnet.cpp \
status.cpp \
lambda_conversion.cpp \
pwm.cpp \
dac.cpp \
Expand Down Expand Up @@ -187,7 +190,8 @@ INCDIR = $(CONFDIR) \
console/binary/ \
boards/ \
shared/ \
$(BOARDDIR)/io/
$(BOARDDIR)/io/ \
boards/f1_common/openblt

# Define C warning options here.
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
Expand Down Expand Up @@ -236,9 +240,6 @@ ifeq ($(USE_OPENBLT),yes)
# Reserve start of flash for OpenBLT
USE_OPT += -Wl,--defsym=USE_BOOTLOADER=1
DDEFS += -DUSE_OPENBLT=TRUE
# Shared params
INCDIR += boards/f1_common/openblt
CSRC += boards/f1_common/openblt/shared_params.c
endif

#
Expand Down
14 changes: 11 additions & 3 deletions firmware/boards/build_f1_board.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ mkdir -p ${DELIVER_DIR}
rm -f ${DELIVER_DIR}/*

if uname | grep "NT"; then
HEX2DFU=./ext/encedo_hex2dfu/hex2dfu.exe
if command -v hex2dfu.exe >/dev/null 2>&1; then
HEX2DFU=hex2dfu.exe
else
HEX2DFU=./ext/encedo_hex2dfu/hex2dfu.exe
fi
SREC_CAT=srec_cat.exe
else
HEX2DFU=./ext/encedo_hex2dfu/hex2dfu.bin
chmod u+x $HEX2DFU
if command -v hex2dfu >/dev/null 2>&1; then
HEX2DFU=hex2dfu
else
HEX2DFU=./ext/encedo_hex2dfu/hex2dfu.bin
chmod u+x $HEX2DFU
fi
SREC_CAT=srec_cat
fi

Expand Down
30 changes: 16 additions & 14 deletions firmware/boards/f0_module/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,12 @@
* GPIOA setup:
*
* PA0 - Un_sense (analog in).
* PA1 - Vm_sense (analog in).
* PA1 - LSU_vm (analog in).
* PA2 - Ip_sense (analog in).
* PA3 - Vm_sense (analog in).
* PA6 - Ip_dac (PWM) (output pushpull, alternate 1).
* PA7 - Heater PWM (output pushpull, alternate 2).
* PA8 - SEL2 (digital input)
* PA9 - UART TX (alternate 1).
* PA10 - UART RX (alternate 1).
* PA11 - CAN RX (alternate 4).
Expand All @@ -179,19 +181,19 @@
*/
#define VAL_GPIOA_MODER (PIN_MODE_ANALOG(GPIOA_PIN0) | \
PIN_MODE_ANALOG(GPIOA_PIN1) | \
PIN_MODE_ANALOG(GPIOA_PIN2) | \
PIN_MODE_INPUT(GPIOA_PIN3) | \
PIN_MODE_INPUT(GPIOA_PIN4) | \
PIN_MODE_INPUT(GPIOA_PIN5) | \
PIN_MODE_ALTERNATE(GPIOA_PIN6) | \
PIN_MODE_ALTERNATE(GPIOA_PIN7) | \
PIN_MODE_INPUT(GPIOA_PIN8) | \
PIN_MODE_ALTERNATE(GPIOA_PIN9) | \
PIN_MODE_ALTERNATE(GPIOA_PIN10) | \
PIN_MODE_ALTERNATE(GPIOA_PIN11) | \
PIN_MODE_ALTERNATE(GPIOA_PIN12) | \
PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
PIN_MODE_ANALOG(GPIOA_PIN2) | \
PIN_MODE_ANALOG(GPIOA_PIN3) | \
PIN_MODE_INPUT(GPIOA_PIN4) | \
PIN_MODE_INPUT(GPIOA_PIN5) | \
PIN_MODE_ALTERNATE(GPIOA_PIN6) | \
PIN_MODE_ALTERNATE(GPIOA_PIN7) | \
PIN_MODE_INPUT(GPIOA_PIN8) | \
PIN_MODE_ALTERNATE(GPIOA_PIN9) | \
PIN_MODE_ALTERNATE(GPIOA_PIN10) | \
PIN_MODE_ALTERNATE(GPIOA_PIN11) | \
PIN_MODE_ALTERNATE(GPIOA_PIN12) | \
PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
PIN_MODE_ALTERNATE(GPIOA_PIN15))
#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \
PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
Expand Down
2 changes: 1 addition & 1 deletion firmware/boards/f0_module/bootloader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif

# C++ specific options here (added to USE_OPT).
ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -fno-rtti -fno-exceptions -ffast-math -funsafe-math-optimizations -fno-threadsafe-statics -fno-use-cxa-atexit -std=c++17
USE_CPPOPT = -fno-rtti -fno-exceptions -ffast-math -funsafe-math-optimizations -fno-threadsafe-statics -fno-use-cxa-atexit -std=c++20
endif

# Enable this if you want the linker to remove unused code and data.
Expand Down
Loading
Loading