ardupilot/libraries/AP_HAL_ChibiOS
Andrew Tridgell 1c8048df8f HAL_ChibiOS: fixed CANFD timings
our CANFD timings were resulting in a lot of busoff errors. Here is an
example of master at 1Mbit/5MBit:

Getting @SYS/can0_stats.txt as -
------- Clock Config -------
CAN_CLK_FREQ:   80MHz
Std Timings: bitrate=1000000 presc=7
sjw=0 bs1=7 bs2=0 sample_point=90.00000%
FD Timings:  bitrate=5000000 presc=1
sjw=0 bs1=5 bs2=0 sample_point=90.00000%
------- CAN Interface Stats -------
tx_requests:    2689
tx_rejected:    0
tx_overflow:    443
tx_success:     7
tx_timedout:    2232
tx_abort:       0
rx_received:    18470
rx_overflow:    0
rx_errors:      0
num_busoff_err: 34439
num_events:     18477
ECR:            F8
fdf_rx:         18467
fdf_tx_req:     2182
fdf_tx:         0

here is an example with the new timings:

------- Clock Config -------
CAN_CLK_FREQ:   80MHz
Std Timings: bitrate=1000000 presc=8
sjw=1 bs1=8 bs2=1 sample_point=90.00000%
FD Timings:  bitrate=8000000 presc=2
sjw=3 bs1=8 bs2=3 sample_point=80.00000%
------- CAN Interface Stats -------
tx_requests:    3023
tx_rejected:    0
tx_overflow:    0
tx_success:     3023
tx_timedout:    0
tx_abort:       0
rx_received:    27865
rx_overflow:    0
rx_errors:      0
num_busoff_err: 0
num_events:     30888
ECR:            0
fdf_rx:         27862
fdf_tx_req:     3016
fdf_tx:         3016

I am testing between a CubeOrange and a Pixhawk6X. I tested 1, 2, 4, 5
and 8 MBit (which are the only valid FD bitrates in our parameters)

Many thanks to Kai from Salient Motion for finding this issue and
providing the corrected timing table
2024-01-25 11:44:02 +11:00
..
hwdef AP_HAL_ChibiOS: update truenav hwdef 2024-01-24 07:58:09 +11:00
AnalogIn.cpp AP_HAL_ChibiOS: Use correct pin config for ADC2 and ADC3 2024-01-24 08:03:24 +11:00
AnalogIn.h HAL_ChibiOS: fixed asserts in AnalogIn driver 2023-05-06 07:24:58 +10:00
AP_HAL_ChibiOS_Namespace.h HAL_ChibiOS: implement BinarySemaphore 2024-01-03 07:37:05 +11:00
AP_HAL_ChibiOS_Private.h AP_HAL_ChibiOS: rename QSPIDevice to WSPIDevice 2023-04-28 08:31:15 +10:00
AP_HAL_ChibiOS.h
bxcan.hpp
CANFDIface.cpp HAL_ChibiOS: fixed CANFD timings 2024-01-25 11:44:02 +11:00
CANFDIface.h HAL_ChibiOS: fixed CANFD timings 2024-01-25 11:44:02 +11:00
CanIface.cpp HAL_ChibiOS: reimplement CAN with BinarySemaphore 2024-01-03 07:37:05 +11:00
CANIface.h HAL_ChibiOS: reimplement CAN with BinarySemaphore 2024-01-03 07:37:05 +11:00
Device.cpp
Device.h
DSP.cpp
DSP.h
Flash.h
GPIO.cpp HAL_ChibiOS: support building with no GPIOs 2024-01-21 12:30:08 +11:00
GPIO.h HAL_ChibiOS: port for STM32L4+ processor 2023-04-14 07:48:56 +10:00
HAL_ChibiOS_Class.cpp AP_HAL_ChibiOS: Only test SPI clock if SPI is enabled 2024-01-10 13:46:40 +11:00
HAL_ChibiOS_Class.h
I2CDevice.cpp HAL_ChibiOS: port for STM32L4+ processor 2023-04-14 07:48:56 +10:00
I2CDevice.h
LogStructure.h
RCInput.cpp AP_HAL_ChibiOS: add and use AP_RCPROTOCOL_ENABLED 2023-05-16 09:16:37 +10:00
RCInput.h AP_HAL_ChibiOS: exclude more code based on HAL_WITH_IO_MCU 2023-02-09 17:52:10 +11:00
RCOutput_bdshot.cpp AP_HAL_ChibiOS: allow bdshot iomcu on non-bdshot fmu 2023-12-18 19:02:52 +11:00
RCOutput_iofirmware.cpp AP_HAL_ChibiOS: allow dshot to be used even if bdshot was specified. 2023-12-18 19:02:52 +11:00
RCOutput_serial.cpp AP_HAL_ChibiOS: ensure dshot commands are send to all FMU channels when IOMCU is present 2023-12-18 19:02:52 +11:00
RCOutput.cpp AP_HAL_ChibiOS: allow dshot to be used even if bdshot was specified. 2023-12-18 19:02:52 +11:00
RCOutput.h AP_HAL_ChibiOS: allow bdshot iomcu on non-bdshot fmu 2023-12-18 19:02:52 +11:00
Scheduler.cpp AP_HAL_ChibiOS: added PRIORITY_NET 2024-01-03 12:14:47 +11:00
Scheduler.h AP_HAL_ChibiOS: added PRIORITY_NET 2024-01-03 12:14:47 +11:00
sdcard.cpp HAL_ChibiOS: added mem_is_dma_safe() function 2024-01-05 06:52:11 -08:00
sdcard.h AP_HAL_ChibiOS: add SD card support to bootloader 2023-02-28 11:26:04 +11:00
Semaphores.cpp HAL_ChibiOS: allow HAL_Semaphore in the bootloader 2024-01-21 12:30:08 +11:00
Semaphores.h HAL_ChibiOS: implement BinarySemaphore 2024-01-03 07:37:05 +11:00
shared_dma.cpp AP_HAL_ChibiOS: bdshot for f103 iofirmware 2023-12-18 19:02:52 +11:00
shared_dma.h AP_HAL_ChibiOS: bdshot for f103 iofirmware 2023-12-18 19:02:52 +11:00
SoftSigReader.cpp
SoftSigReader.h
SoftSigReaderInt.cpp
SoftSigReaderInt.h
SPIDevice.cpp AP_HAL_ChibiOS: add option to set HAL_SPI_SCK_SAVE_RESTORE 2023-10-18 19:25:19 +11:00
SPIDevice.h HAL_ChibiOS: fixed SPI build on F1xx 2023-12-20 19:33:12 +11:00
stdio.cpp
Storage.cpp
Storage.h AP_HAL_ChibiOS: Increase limit for Storage pages 2023-09-17 21:03:37 +10:00
system.cpp HAL_ChibiOS: speed up millis(), micros64() etc 2023-12-19 11:47:24 +11:00
UARTDriver.cpp HAL_ChibiOS: allow for up to 12.5MBps on H7 UARTs 2024-01-02 08:12:37 +11:00
UARTDriver.h AP_HAL_ChibiOS: eliminate legacy UART ordering/references 2023-12-19 06:53:15 +11:00
Util.cpp AP_HAL_ChibiOS: allow dshot beeps to play on all dshot ESC types 2024-01-23 11:58:55 +11:00
Util.h AP_HAL_ChibiOS: use @ROMFS/defaults.parm rather than apj_tool for defaul parms 2024-01-17 18:28:48 +11:00
WSPIDevice.cpp AP_HAL_ChibiOS: correct OSPI clock in WSPIDevice 2023-04-28 08:31:15 +10:00
WSPIDevice.h AP_HAL_ChibiOS: support is_busy() on WSPI device 2023-04-28 08:31:15 +10:00