STM32F405 canStart/canStop Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
omcdr
Posts: 89
Joined: Wed Aug 17, 2016 3:25 pm
Has thanked: 7 times
Been thanked: 7 times

STM32F405 canStart/canStop

Post by omcdr »

There is problem with canStop function, this code works corectly:

Code: Select all

   canStart(&CAND1, &cancfg500k_36Mhz);
   canStart(&CAND2, &cancfg500k_36Mhz);

   chThdSleepMilliseconds(500);

   canStop(&CAND2);
   canStop(&CAND1);


but this not:

Code: Select all

   canStart(&CAND1, &cancfg500k_36Mhz);
   canStart(&CAND2, &cancfg500k_36Mhz);

   chThdSleepMilliseconds(500);

   canStop(&CAND1);
   canStop(&CAND2);


I got panic message at line
#if STM32_CAN_USE_CAN2
osalDbgAssert(CAND2.state == CAN_STOP, "CAN2 must be stopped");


and debug stop at :
/* Pointing to the passed message.*/
ch.dbg.panic_msg = reason;
efuentes
Posts: 35
Joined: Wed Jul 25, 2012 6:16 am

Re: STM32F405 canStart/canStop

Post by efuentes »

In the STM32F405, CAN1 must be enabled for CAN2 to operate correctly. The panic is there to prevent you from assuming that CAN2 will operate correctly if CAN1 has been stopped.
omcdr
Posts: 89
Joined: Wed Aug 17, 2016 3:25 pm
Has thanked: 7 times
Been thanked: 7 times

Re: STM32F405 canStart/canStop

Post by omcdr »

Ok, I see, there is for intended effect
Post Reply