Menu ▾ ▴

#795 Misplaced and fatally wrong assertion in STM32 CAN driver

2.6.10
closed-rejected
None
STM32-HAL
High
2.6.9
False
2016-12-22
2016-11-24
No

There is a wrong assert in os/hal/platform/STM32/can_lld.c, function can_lld_stop:

505 #if STM32_CAN_USE_CAN2
506 chDbgAssert(CAND2.state == CAN_STOP,
507 "can_lld_stop(), #1", "CAN2 must be stopped");
508 #endif

Not only driver state assertions belong in the common high level driver, it is code for CAN1 but it is checking CAN2 state.

Trivial fix: just remove the assertion.

Discussion

  • Giovanni Di Sirio

    • status: open --> closed-rejected
    • assigned_to: Giovanni Di Sirio
     
  • Giovanni Di Sirio

    Hi,

    CAN2 cannot operate independtly from CAN1 because the filters are shared, this is why that assertion exists, this is also an extra check in can_lld.h. Enabling CAN2 requires CAN1 enabled too.

    It is an STM32-specific check too so it does not beling to the high level.

    Giovanni

     

Log in to post a comment.