STM32 CAN driver Topic is solved

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

STM32 CAN driver  Topic is solved

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

Hi,

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);
                        ^~~~~
                        CAND3


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

Code: Select all

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


User avatar
Giovanni
Site Admin
Posts: 12179
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 571 times
Been thanked: 488 times
Contact:

Re: STM32 CAN driver

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

Fixed as bug #1052.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest