Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2d7e92b
dronecan/h7: reduce FDCAN SJW from 8 to 3
daijoubu May 23, 2026
be17792
dronecan/h7: extend PLL2 block to cover USE_DRONECAN, fix PLL2Q for F…
daijoubu May 28, 2026
98d76dc
dronecan/h7: use system PLL2 clock for FDCAN; add KAKUTEH7WING CAN su…
daijoubu May 29, 2026
b165d39
dronecan/h7: remove BusOff/ErrorPassive LOG_DEBUG spam from GetProtoc…
daijoubu May 29, 2026
d3cc8e4
dronecan/h7: fix FDCAN timing clock source and restore SJW=3
daijoubu May 29, 2026
f294f3f
dronecan/h7: remove LOG_DEBUG spam and fix PLL2 VCI range
daijoubu May 29, 2026
a1f4c99
dronecan: remove LOG_DEBUG spam from H7/F7 drivers and dronecan.c
daijoubu May 29, 2026
c21c7a2
dronecan/h7: set SJW=1 for ISO 11898-1 conformance and verified 1Mbps…
daijoubu May 29, 2026
2ea077e
dronecan: set SJW=1 in F7 driver; clean up stale comments in H7/F7 dr…
daijoubu May 29, 2026
5e07d1d
dronecan: gate GPS fix handlers on GPS_DRONECAN provider
daijoubu May 29, 2026
173b909
dronecan/f7: restore SJW=3 (hardware 4 tq); document register encodin…
daijoubu May 29, 2026
dbe3ace
dronecan: add STATE_DRONECAN_FAILED; set on CAN peripheral init failure
daijoubu May 29, 2026
5f55bec
dronecan: add FAILED to CLI state name array
daijoubu May 29, 2026
a814040
dronecan/h7: flush TX FIFO before clearing CCCR.INIT on bus-off recovery
daijoubu May 29, 2026
3865228
dronecan: disable AutoRetransmission on H7/F7 to prevent TX FIFO stall
daijoubu May 29, 2026
57f8536
dronecan/f7: check canardSTM32ComputeTimings return value
daijoubu May 29, 2026
8fa8233
dronecan: increase bus-off recovery delay from 1ms to 20ms
daijoubu May 29, 2026
af897d8
dronecan: move GPS provider guard to dispatch layer in dronecan.c
daijoubu May 29, 2026
5390248
dronecan: rate-limit protocol status check to 1Hz in NORMAL state
daijoubu May 29, 2026
da72c03
dronecan/f7: implement RecoverFromBusOff to clear sticky ESR.BOFF flag
daijoubu May 29, 2026
f1fa4c7
dronecan/h7: fix static_assert comment for PLL2M HSE divisibility check
daijoubu May 29, 2026
ef0fe3a
dronecan: rate-limit protocol status check in BUS_OFF state to 20ms c…
daijoubu May 29, 2026
cca23b3
dronecan/f7: revert RecoverFromBusOff HAL_CAN_Stop/Start — causes lockup
daijoubu May 29, 2026
5a47b87
dronecan: only log CAN status when BusOff or ErrorPassive is non-zero
daijoubu May 29, 2026
fe8d859
dronecan/f7: remove TX failure log spam
daijoubu May 29, 2026
69f6570
dronecan/gps: guard GNSSAuxiliary DOP fields against NaN and overflow
daijoubu May 29, 2026
e6e2c7c
dronecan/gps: remove lastVDOP — no vdop field in gpsSol and not EPV-c…
daijoubu May 29, 2026
3aa922f
dronecan: add STATE_DRONECAN_COUNT sentinel and assert dronecanStateN…
daijoubu May 29, 2026
d2be273
dronecan: handle STATE_DRONECAN_COUNT in switch to satisfy -Werror=sw…
daijoubu May 29, 2026
9747c8e
dronecan: fix ARRAYLEN macro name in dronecanStateNames assert
daijoubu May 30, 2026
97c939b
dronecan: clamp state index before dronecanStateNames lookup in CLI
daijoubu May 30, 2026
03b1614
dronecan/f7: document why RecoverFromBusOff is a no-op
daijoubu May 31, 2026
f916fc1
dronecan: fix sign-compare in CLI state name clamp
daijoubu May 31, 2026
48c1d7c
dronecan: fix %lu format specifier for uint32_t fields
daijoubu May 31, 2026
60b8f45
fix: use PRIu32 for uint32_t format specifiers in dronecan LOG_DEBUG
daijoubu May 31, 2026
9c1b352
fix(dronecan): send elapsed ms since last seen in MSP2_INAV_DRONECAN_…
daijoubu Jun 1, 2026
1d53383
fix(dronecan): send elapsed ms since last seen in MSP2_INAV_DRONECAN_…
daijoubu Jun 1, 2026
f52241c
dronecan/h7: TX queue mode, depth 3, ISR pump, NVIC masking
daijoubu Jun 12, 2026
8d34897
dronecan: F7 ISR-driven TX, NVIC masking, TEC/REC/LEC counters, cliDr…
daijoubu Jun 12, 2026
da08d0d
dronecan: fix H7 ISR pump, ECR TEC field, narrow TX mask window
daijoubu Jun 12, 2026
3c889c0
dronecan: reorder driver files to public API before private helpers
daijoubu Jun 12, 2026
b24900d
dronecan: address code review findings
daijoubu Jun 12, 2026
5da300c
dronecan: address third code review findings
daijoubu Jun 12, 2026
484e46f
dronecan: address fourth code review findings
daijoubu Jun 12, 2026
9c038c4
dronecan: address fifth code review findings
daijoubu Jun 12, 2026
85183b3
dronecan: address sixth code review findings
daijoubu Jun 12, 2026
9dd06ae
dronecan: fix H7 FDCAN filter type to accept all extended IDs
daijoubu Jun 12, 2026
e0b5f82
Enforce FIFO ordering to prevent spin errors in multi frame messages …
daijoubu Jun 13, 2026
cf3f98b
Allow FDCAN targets to use 18 quanta per bit solution as well at 1 MBps.
daijoubu Jun 13, 2026
6079e86
test(dronecan): add bxCAN timing unit tests for max_quanta=18 change
daijoubu Jun 13, 2026
c1b52a5
dronecan: reduce flash waste, improve GPIO config, add diagnostics
daijoubu Jun 15, 2026
08c4768
dronecan: guard STM32 CAN drivers with USE_DRONECAN
daijoubu Jun 15, 2026
37ec2ba
Set max_quanta_per_bit back to 10 for H7 targets as well
daijoubu Jun 16, 2026
17d2370
dronecan: log cumulative bus-off count to blackbox slow frame
daijoubu Jul 15, 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
18 changes: 17 additions & 1 deletion src/main/blackbox/blackbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@
#include "sensors/esc_sensor.h"
#include "flight/wind_estimator.h"
#include "sensors/temperature.h"

#ifdef USE_DRONECAN
#include "drivers/dronecan/dronecan.h"
#endif

#if defined(ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT)
#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH
Expand Down Expand Up @@ -468,6 +470,9 @@ static const blackboxSimpleFieldDefinition_t blackboxSlowFields[] = {
{"escRPM", -1, UNSIGNED, PREDICT(0), ENCODING(UNSIGNED_VB)},
{"escTemperature", -1, SIGNED, PREDICT(PREVIOUS), ENCODING(SIGNED_VB)},
#endif
#ifdef USE_DRONECAN
{"droneCANBusOffCount", -1, UNSIGNED, PREDICT(0), ENCODING(UNSIGNED_VB)},
#endif
};

#define BLACKBOX_FIRST_HEADER_SENDING_STATE BLACKBOX_STATE_SEND_HEADER
Expand Down Expand Up @@ -575,6 +580,9 @@ typedef struct blackboxSlowState_s {
#endif
uint16_t rxUpdateRate;
uint8_t activeWpNumber;
#ifdef USE_DRONECAN
uint32_t droneCANBusOffCount;
#endif
} __attribute__((__packed__)) blackboxSlowState_t; // We pack this struct so that padding doesn't interfere with memcmp()

//From rc_controls.c
Expand Down Expand Up @@ -1358,6 +1366,10 @@ static void writeSlowFrame(void)
blackboxWriteSignedVB(slowHistory.escTemperature);
#endif

#ifdef USE_DRONECAN
blackboxWriteUnsignedVB(slowHistory.droneCANBusOffCount);
#endif

blackboxSlowFrameIterationTimer = 0;
}

Expand Down Expand Up @@ -1432,6 +1444,10 @@ static void loadSlowState(blackboxSlowState_t *slow)
slow->escRPM = escSensor->rpm;
slow->escTemperature = escSensor->temperature;
#endif

#ifdef USE_DRONECAN
slow->droneCANBusOffCount = dronecanGetBusOffCount();
#endif
}

/**
Expand Down
Loading
Loading