Closed Chris-Idema-WizzDev closed 6 months ago
ST Internal Reference: 167320
Hi @Chris-Idema-WizzDev,
Best wishes for the new year 2024. Thank you again for your report. The following fix has been implemented in version 1.2.3 which has been released a couple of weeks ago:
FDCAN_DLC_BYTES_X
macros are now shift-free so they comply to the definition of the DLC.With regards,
https://github.com/STMicroelectronics/stm32g4xx_hal_driver/blob/19bed7c9f84aa74aba98c6d1ea54bed39bd8e61a/Inc/stm32g4xx_hal_fdcan.h#L212
The struct member DataLength (found in multiple structs) has a misleading name and description. It is neither data length in bytes nor a CAN Data Length Code (DLC). It is a shifted DLC value. No conversion function/macro is provided (DLCtoBytes is static).