SourceForge has been redesigned. Learn more.
Close

#385 CAN_USE_SLEEP_MODE compilation problem

closed-fixed
2014-05-09
2013-03-02
wild-boar
No

I disabled sleep mode in CAN driver for STM32.

The interrupt handler was trying to access an event that was no longer present.

This patch against trunk fixes the problem by disabling the wakeup check:

Index: os/hal/platforms/STM32/can_lld.c

--- os/hal/platforms/STM32/can_lld.c (revision 5343)
+++ os/hal/platforms/STM32/can_lld.c (working copy)
@@ -211,6 +211,7 @@

msr = canp->can->MSR;
canp->can->MSR = CAN_MSR_ERRI | CAN_MSR_WKUI | CAN_MSR_SLAKI;
+#if CAN_USE_SLEEP_MODE
/* Wakeup event.*/
if (msr & CAN_MSR_WKUI) {
canp->state = CAN_READY;
@@ -219,6 +220,7 @@
chEvtBroadcastI(&canp->wakeup_event);
chSysUnlockFromIsr();
}
+#endif /* CAN_USE_SLEEP_MODE */
/* Error event.*/
if (msr & CAN_MSR_ERRI) {
flagsmask_t flags;

Discussion

  • Giovanni Di Sirio

    Hi,

    fixed in repository, will be fixed in 2.2.10stable, 2.4.2stable and 2.5.2unstable.

     
  • Giovanni Di Sirio

    • assigned_to: nobody --> gdisirio
    • priority: 5 --> 4
    • milestone: --> 2.2.0
    • status: open --> open-fixed
     
  • Giovanni Di Sirio

    • status: open-fixed --> closed-fixed
     

Log in to post a comment.