Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
3b51069
Feat: Add New VCU IOC file
r-kirkbride May 9, 2026
4f0b665
feat/add-new-IO-functions
r-kirkbride May 9, 2026
39476a7
feat: add useful pin labels to important pins
r-kirkbride May 9, 2026
11d214e
Update VCU.ioc with new stag12 config for digital io
Agwld Jun 12, 2026
5fa5886
I/O fixes
Agwld Jun 12, 2026
9cfc830
rename RTD_DRIVE to R2D_DRIVE in the .ioc
maartin0 Jun 13, 2026
6497f26
Fix some other IOC issues (missing ThreadX and changed the HAL timer …
maartin0 Jun 13, 2026
ca89498
Rename GREEN_LED (heartbeat) usages to ROB_LED and comment out undefi…
maartin0 Jun 13, 2026
64f43cc
Use ROB_LED alias rather than direct gpio pin, and flash every 200ms …
maartin0 Jun 13, 2026
1835e01
use uart8 instead of uart1 (todo: also mirror debug output over USART…
maartin0 Jun 13, 2026
7e6d45f
Configure adcs for apps and bps
maartin0 Jun 13, 2026
2a93ec0
Add missing files to makefile -> build now works!
maartin0 Jun 13, 2026
fe76417
remove unused adc_reading to fix warning
maartin0 Jun 13, 2026
5908961
GPIO fixes: wheelspeed inputs (3/4 were defined as outputs instead of…
maartin0 Jun 13, 2026
9e29bca
Simplify weird comparison for VCU_Input_Read
maartin0 Jun 13, 2026
56fbd5d
log over both UART and USART (debug header + rs232)
maartin0 Jun 13, 2026
422fe6f
fix all compilation warnings (except those from middlewares)
maartin0 Jun 13, 2026
de041ed
Realised we never configure SCS channels in the config (used to be on…
maartin0 Jun 13, 2026
518d9eb
Update CAN baud rate to 1Mbit/s
maartin0 Jun 14, 2026
540e617
disable SD card temporarily
maartin0 Jun 14, 2026
34b9c8b
add rs232 logic
maartin0 Jun 14, 2026
2730fb8
update Makefile
maartin0 Jun 14, 2026
f00f6f6
use gdb-multiarch to support new arm installations when debugging on …
maartin0 Jun 14, 2026
188e80b
Fix RS232 by switching UART8 RX/TX
maartin0 Jun 14, 2026
b6309b4
Sample 144 times rather than every 3 times for every SCS signal/ADC r…
maartin0 Jun 14, 2026
af5eaee
add CAN error logging
maartin0 Jun 19, 2026
3575e93
enable CAN NVIC interrupts
maartin0 Jun 19, 2026
31e9d7e
Enable auto-bus off recovery
maartin0 Jun 20, 2026
9c013fc
Switch to rtcan rewrite branch
maartin0 Jun 20, 2026
d69828c
Log errors on CAN TX failure
maartin0 Jun 20, 2026
b322719
Rename CAN-C to CAN-T, pin can-defs to stag-12 branch
maartin0 Jun 20, 2026
374f768
Update APPS calib values
maartin0 Jun 21, 2026
746c89f
Update can-defs to stag-12 layout with updated cantools output
maartin0 Jun 21, 2026
967d03d
Allow RS232 transciever to auto power off
maartin0 Jun 21, 2026
9097d57
Fix/add some missing broadcast states
maartin0 Jun 21, 2026
a71d8a7
Update to latest can-defs
maartin0 Jun 21, 2026
c9cee73
Update apps logging to do everything in 1 line so that readings don't…
maartin0 Jun 21, 2026
93f4768
Fix apps multiplier (off by factor of 10)
maartin0 Jun 21, 2026
7a86081
Lots and lots of rtcan related fixes
maartin0 Jun 21, 2026
7640c8b
Update apps calib thresholds
maartin0 Jun 21, 2026
5616363
Add wheelspeed can-defs, config and implementation
maartin0 Jun 21, 2026
8cbd536
Update rs232 header attribution
maartin0 Jun 22, 2026
cae8ebe
Update log levels for apps.c -- use a warn log level on discrepancy a…
maartin0 Jun 22, 2026
ef3e3f4
Move SUFST middlewares from src/Middlewares/SUFST to src/SUFST/Middle…
maartin0 Jun 25, 2026
c456a81
Add newlines to bps.c logging
maartin0 Jun 25, 2026
fac30a4
Add SD implementation (included both FileX and USBX middlewares, USB …
maartin0 Jun 25, 2026
6167f58
Get USB passthrough working
maartin0 Jun 25, 2026
b3ec285
Actually increment the rolling counter field
maartin0 Jun 25, 2026
034d845
Add value table for VCU_CTRL_State
maartin0 Jun 26, 2026
145a90e
Switch PM100 direction to forwards mode lol (the inverter is the corr…
maartin0 Jun 26, 2026
f082366
Remove duplicate pm100 call/break
maartin0 Jun 26, 2026
386fb73
Add PDM ECU to CAN-T
maartin0 Jun 26, 2026
d1df4f2
Update wheelspeed ticks/wheel and circumference
maartin0 Jun 26, 2026
1f9223d
Reset apps_bps_start on TS_ON
maartin0 Jun 27, 2026
08b34a1
Add Vector CANoe workspace + control panel + Ignore .cbf files genera…
maartin0 Jun 28, 2026
dcca37b
Update ctrl.c to use functions per switch statement rather than one m…
maartin0 Jun 28, 2026
5f34e6a
update can-defs
maartin0 Jun 29, 2026
384dc97
Switch CAN-S and CAN-T (sigh)
maartin0 Jun 29, 2026
0e7af61
Move PDM from CAN-S to CAN-T
maartin0 Jun 29, 2026
0f717b1
Add VCU_Sensors_Raw message
maartin0 Jun 29, 2026
4d1b8fb
Configure RTDS pin as digital output, not PWM timer
maartin0 Jun 30, 2026
9d237de
Add inverted option (enabled) to APPS config for when potentiometer i…
maartin0 Jun 30, 2026
c0f6f9f
Add implementation of raw APPS/BPS signals CAN message for debugging
maartin0 Jun 30, 2026
0e88553
Rename BPS_ADC to BPS_F_ADC, and re-configure bps code to use BPS_R_ADC
maartin0 Jun 30, 2026
3641434
Temporarily switch BPS to use SAGL ADC due to PCB opamp issues, and u…
maartin0 Jul 1, 2026
54d5cad
Update BPS threshold to 10% (from 4%), calibrate pedals, and move VCU…
maartin0 Jul 2, 2026
89dcd73
Update CANoe workspace
maartin0 Jul 2, 2026
5c5d9f8
Try and fix VCU crashing upon CAN bus error
Agwld Jul 2, 2026
5e3c30d
add filters to rtcan
maartin0 Jul 3, 2026
5cde931
Increase queue sizes for RTCAN and the inverter
maartin0 Jul 4, 2026
a4288e0
Change BPS log levels
maartin0 Jul 4, 2026
b7d4861
Update calib values
maartin0 Jul 4, 2026
e7ca804
Don't enter Error_Handler() on any CAN errors
maartin0 Jul 4, 2026
e047d7b
Update CAN-T baud rate to 500kbps, enable AutoRetransmission on both …
maartin0 Jul 4, 2026
541b6dd
Switch SAGL and BPS back over
maartin0 Jul 4, 2026
7d31285
APPS and BPS calib again
maartin0 Jul 4, 2026
25cd982
Add rtcan_s_h to canbc so we can broadcast states on both buses
maartin0 Jul 5, 2026
7e06198
Split canbc to use CAN-S for non critical sensors
maartin0 Jul 5, 2026
d9f8e03
Add SAGL implementation
maartin0 Jul 5, 2026
2075922
Don't clamp raw ADC value for APPS and BPS
maartin0 Jul 5, 2026
873c3ec
Update CANoe workspace
maartin0 Jul 5, 2026
3a21bb8
Fix apps inversion issue when at 0% throttle by applying it earlier
maartin0 Jul 5, 2026
6b55fcf
Update BPS threshold warning log level to INFO
maartin0 Jul 5, 2026
a94ee49
Fix broken error message in pm100.c (missing index)
maartin0 Jul 5, 2026
d348328
Add fans implementation (subscribing to sensor hub fan switch message…
maartin0 Jul 5, 2026
d5b0099
Allow inverting fan switch
maartin0 Jul 5, 2026
f555eaa
Switch BPS log threshold back to DEBUG
maartin0 Jul 5, 2026
9939731
Add slightly redundant (but useful for debugging) inversion conversio…
maartin0 Jul 5, 2026
93a5ced
More calibration
maartin0 Jul 5, 2026
8e4471a
Re-enable dynamic fan control while keeping override, and turn on pum…
maartin0 Jul 11, 2026
a4fe3f5
Add configurable hard max torque and config stubs for future modes im…
maartin0 Jul 11, 2026
930cc9d
Update BPS thresh from 40 to 80 and max torque to 100nm
maartin0 Jul 11, 2026
a2b75dd
Fix temperature conversions (was 10x too small for fan threshold)
maartin0 Jul 11, 2026
5e1c739
Delete backup makefile
maartin0 Jul 11, 2026
f9af08c
Move breaklight threshold into config.c (instead of hardcoded #define…
maartin0 Jul 11, 2026
188617c
Fix vscode settings for error handling
maartin0 Jul 11, 2026
f2c87a1
Fix torque map percentage (off by a factor of 10), update CAN TQ and …
maartin0 Jul 12, 2026
0c4439e
Update CANoe workspace
maartin0 Jul 12, 2026
2844345
Disable software BSPD, don't turn off inverter in TS fault
maartin0 Jul 12, 2026
3aa7b6c
Add current+requested mode enum and can defs
maartin0 Jul 12, 2026
c5101f9
Only sample SAGL (and other ext_inputs, currently just SAGL soon to b…
maartin0 Jul 12, 2026
0137b95
Implement mode switch ADC -> requested mode, Implement modes (except …
maartin0 Jul 12, 2026
f9c0c98
Add brakelight debounce
maartin0 Jul 12, 2026
c4bad0f
Reset VCU after flash
maartin0 Jul 12, 2026
9f5e4c9
Switch to only 10 modes (switch was configured differently than the s…
maartin0 Jul 12, 2026
23da9a7
Fixes
maartin0 Jul 13, 2026
cc9c3c9
Update APPS max discrepancy to 9.5% (2x bigger than before)
maartin0 Jul 13, 2026
1c758e5
Disable R2D requires brake for dyno testing
maartin0 Jul 13, 2026
86e8d15
Update priorities and thread names and logging levels for Fans + Whee…
maartin0 Jul 13, 2026
f1a8d28
Massively simplify remote control logic to just do a simple torque re…
maartin0 Jul 13, 2026
059a9ea
Fix torque map to use dynamically set max output
maartin0 Jul 13, 2026
d6de3aa
Add remote ctrl mode
maartin0 Jul 13, 2026
97b88af
Add CANoe workspace generator for remote control
maartin0 Jul 13, 2026
65a4307
Actually send errors (latching rtcan errors) in the messages that wer…
maartin0 Jul 13, 2026
0c46d06
Allow exiting TS_Run_Fault via TS_Off
maartin0 Jul 13, 2026
fc5bf8b
Clear R2D led after fault
maartin0 Jul 14, 2026
b6b1c6a
Update CANoe workspace
maartin0 Jul 15, 2026
2ef8265
Flip R2D led states (inverted due to loom/vcu pcb buffers)
maartin0 Jul 15, 2026
d755337
Don't enter a TS fault on APPS failure (just SCS fault) so it can aut…
maartin0 Jul 15, 2026
7ae10f7
Clear SCS error on success
maartin0 Jul 16, 2026
effaee6
Update CANoe workspace
maartin0 Jul 16, 2026
d5d16bd
Update can-defs to latest commit
maartin0 Jul 16, 2026
3b8ae4c
More calibration
maartin0 Jul 16, 2026
ec233c2
Use brakelight as threshold check for BPS due to noise
maartin0 Jul 17, 2026
54306f5
fixes
maartin0 Jul 17, 2026
511d322
elec scrut complete
maartin0 Jul 17, 2026
98b6e1c
FSUK 2026 endurance fixes
maartin0 Jul 21, 2026
7b56739
Drop wheelspeed priority below logging
maartin0 Jul 21, 2026
33df502
drop discrepancy configs for apps
maartin0 Jul 21, 2026
1e3e7d5
Update makefile to production builds (-DCOMPETITION_MODE), fine becau…
maartin0 Jul 21, 2026
52468e2
Update CANoe workspace
maartin0 Jul 21, 2026
858cb57
Merge reliability fixes from claude-fixes
maartin0 Jul 21, 2026
3880d28
Improve interface for setting max output torque
maartin0 Jul 26, 2026
c0e3d7b
Up torque limit for remote ctrl to 230 Nm
maartin0 Jul 26, 2026
2d8de9e
Flip motor direction
maartin0 Aug 4, 2026
2c05ef5
Switch to exponential torque map
maartin0 Aug 4, 2026
4924813
Strip out speed limiting
maartin0 Aug 4, 2026
75a9b98
Add configurable (powf) exponent to the exponential torque map
maartin0 Aug 4, 2026
362aa6c
Update README and setup script
maartin0 Aug 4, 2026
f74800f
Add clang-format command for src/SUFST and run it
maartin0 Aug 4, 2026
dc9a95a
Up discrepancies for testing
maartin0 Aug 4, 2026
17e2e8f
pre fsg apps cal
espitt Aug 6, 2026
91ab760
Add comment on apps_bps_high_threshold
maartin0 Aug 9, 2026
d3ff43d
Run trunk fmt
maartin0 Aug 11, 2026
7dd6070
Fix trunk issues
maartin0 Aug 11, 2026
0c1475e
Update CANoe workspace to include individual BMS values
maartin0 Aug 12, 2026
8147572
Add trunk CI action
maartin0 Aug 13, 2026
c84e7a3
fsg scrut changes
maartin0 Aug 14, 2026
c6bc2c6
Sketchy theories
maartin0 Aug 14, 2026
7d122d6
Update IOC for DMA
maartin0 Aug 14, 2026
46d4d43
unsafe but functional for testing
maartin0 Aug 14, 2026
7aa57dc
DMA ADC attempts
maartin0 Aug 14, 2026
23c3854
Strip out ext inputs sample divider (doesn't do anything)
maartin0 Aug 14, 2026
a4efbc4
fix: disabled reverse & change crawl to 150Nm
r-kirkbride Aug 15, 2026
cf01e32
fix: change torque + disable brake implausibility check
r-kirkbride Aug 15, 2026
95d87e4
fix: final endurance config changes
r-kirkbride Aug 16, 2026
c08c7a4
Some resets for testing
maartin0 Aug 16, 2026
3139d76
Reformat
maartin0 Aug 16, 2026
6cce5bf
Update IOC for DMA
maartin0 Aug 14, 2026
744af6e
DMA ADC attempts
maartin0 Aug 14, 2026
0048bba
Strip out ext inputs sample divider (doesn't do anything)
maartin0 Aug 14, 2026
94817a1
fix: disabled reverse & change crawl to 150Nm
r-kirkbride Aug 15, 2026
52c7aec
fix: change torque + disable brake implausibility check
r-kirkbride Aug 15, 2026
1764149
fix: final endurance config changes
r-kirkbride Aug 16, 2026
3360ddc
Some resets for testing
maartin0 Aug 16, 2026
208bf7b
Reformat
maartin0 Aug 16, 2026
6fb7c51
Merge branch 'rolling-dma-ai' into stag-12
maartin0 Aug 16, 2026
8bbd24d
Update setup script
maartin0 Aug 16, 2026
430dd79
Update fan threshold
maartin0 Aug 16, 2026
3b4397b
Fix trunk issues
maartin0 Aug 16, 2026
7b1bc92
Tidy up/refactor a lot of things
maartin0 Aug 18, 2026
fa2cdac
torque limiting implementations for wheel slip and power using PI con…
maartin0 Sep 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
399 changes: 399 additions & 0 deletions .clang-format

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Closes # (issue)

- [ ] Code has been tested on STM32 hardware.
- [ ] Changes do not generate any new compiler warnings.
- [ ] Code has been formatted using `trunk fmt`.
- [ ] Code has been formatted using `make format`.
- [ ] Commit messages follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#specification) specification.

### Additional Notes
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/trunk-action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Trunk Code Quality
on:
push:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

permissions: read-all

jobs:
trunk_check:
name: Trunk Code Quality Runner
runs-on: ubuntu-latest
permissions:
checks: write
contents: read

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install cppcheck
run: sudo apt-get update && sudo apt-get install -y cppcheck

- name: Trunk Code Quality
uses: trunk-io/trunk-action@v1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,6 @@ misra.txt

# TraceX
*.trx

# CANoe
*.cbf
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "src/Middlewares/SUFST/rtcan"]
path = src/Middlewares/SUFST/rtcan
[submodule "src/SUFST/Middlewares/rtcan"]
path = src/SUFST/Middlewares/rtcan
url = https://github.com/sufst/rtcan
[submodule "src/Middlewares/SUFST/can-defs"]
path = src/Middlewares/SUFST/can-defs
[submodule "src/SUFST/Middlewares/can-defs"]
path = src/SUFST/Middlewares/can-defs
url = https://github.com/sufst/can-defs
6 changes: 4 additions & 2 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ lint:
- src/AZURE_RTOS/**
- src/Core/**
- src/Drivers/**
- src/Middlewares/ST
- scripts/*
- src/Middlewares/**
- src/FileX/**
- src/USBX/**
- scripts/**
- linters: [clang-format]
paths:
- src/SUFST/Inc/config.h
Expand Down
2 changes: 1 addition & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"${workspaceFolder}/src/Drivers/CMSIS/**",
"${workspaceFolder}/src/Middlewares/ST/threadx/common/inc",
"${workspaceFolder}/src/Middlewares/ST/threadx/ports/cortex_m7/gnu/inc",
"${workspaceFolder}/src/SUFST/Inc/CAN",
"${workspaceFolder}/src/SUFST/Inc/",
"${workspaceFolder}/src/Drivers/STM32F7xx_HAL_Driver/Inc"
],
"defines": [
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"cwd": "${workspaceFolder}",
"name": "debug (stutil)",
"executable": "build/VCU.elf",
"executable": "build/debug/VCU.elf",
"request": "launch",
"type": "cortex-debug",
"showDevDebugOutput": "none",
Expand All @@ -16,7 +16,7 @@
// debug with openocd
{
"cwd": "${workspaceFolder}",
"executable": "build/VCU.elf",
"executable": "build/debug/VCU.elf",
"name": "debug (openocd)",
"request": "launch",
"type": "cortex-debug",
Expand Down
9 changes: 6 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@
"torque_map_funcs.h": "c",
"rtds.h": "c",
"pm100.h": "c",
"can_c.h": "c",
"can_t.h": "c",
"ctrl.h": "c"
},
"cortex-debug.gdbPath": "gdb-multiarch",
"cortex-debug.variableUseNaturalFormat": true,
"C_Cpp.errorSquiggles": "Enabled",
"mcu-debug.rtos-views.showRTOS": false
"C_Cpp.errorSquiggles": "enabled",
"C_Cpp.intelliSenseEngine": "default",
"mcu-debug.rtos-views.showRTOS": false,
"clangd.enable": false
}
516 changes: 494 additions & 22 deletions Makefile

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Table of Contents

- [About](#about)
- [Development Environment](#development-environment)
- [Development Environment](#setup--development-environment)
- [Contributing](#contributing)
- [Useful Resources](#useful-resources)
- [Related Projects](#related-projects)
Expand All @@ -20,10 +20,10 @@ SUFST Docs Site.

## Using the setup script

Run the below command once to install dependencies, clone the repository and initialise submodules

```sh
curl https://raw.githubusercontent.com/sufst/vcu/refs/heads/main/vcu-setup-script.sh -o vcu-setup-script.sh
chmod +x vcu-setup-script.sh
./vcu-setup-script.sh
curl -LsSf https://raw.githubusercontent.com/sufst/vcu/refs/heads/main/vcu-setup-script.sh | bash
```

## Submodules
Expand Down
Loading
Loading