STM32 CAN driver Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Posts: 451
Joined: Sat Nov 19, 2011 6:47 pm
Location: Versailles, France
Has thanked: 12 times
Been thanked: 17 times

STM32 CAN driver  Topic is solved

Postby mobyfab » Tue Oct 08, 2019 6:01 pm


There's a bug in the current CAN driver (stable 19.1.x) when only using CAN3

Code: Select all

ChibiOS/os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c: In function 'can_lld_init':
ChibiOS/os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c:661:24: error: 'CAND1' undeclared (first use in this function); did you mean 'CAND3'?
   can_lld_set_filters(&CAND1, STM32_CAN_MAX_FILTERS / 2, 0, NULL);

A simple fix is to add #if before the block like this:

Code: Select all

#if STM32_HAS_CAN2
  can_lld_set_filters(&CAND1, STM32_CAN_MAX_FILTERS / 2, 0, NULL);
  can_lld_set_filters(&CAND1, STM32_CAN_MAX_FILTERS, 0, NULL);

User avatar
Site Admin
Posts: 13012
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 745 times
Been thanked: 621 times

Re: STM32 CAN driver

Postby Giovanni » Sat Oct 19, 2019 12:45 pm

Fixed as bug #1052.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 14 guests