2017-02-28 03:01 AM
hello dear forum, I try to make CANBUS of
RC work I managed to make CANBUS send message in loopback mode however when I turn on receive interrupt the processor hangs at first message and watchdog resets the micro --------------------------------------------- CAN_ITConfig(CAN1, CAN_IT_FMP0, ENABLE); --------------------------------------------- I suspect the code enters the interrupt handler and cannot leave it I want to ask how do I fill following lines to reset interupt flag and pending bit ( in std library I couldnot find any information about this ) --------------------------------------------- void USB_LP_CAN1_RX0_IRQHandler(void) { CAN_ClearFlag(CAN1, ??????????); CAN_ClearITPendingBit(CAN1,??????????); CanRxMsg RxMessage; CAN_Receive(CAN1, CAN_FIFO0, &RxMessage); --------------------------------------------- thank you#canbus #stm32f1032017-02-28 05:35 AM
Did you get it working ?
I purchased a CanDo unit from the UK, it is the best way to debug since you can see what is happening on the Canbus.
My Canbus solution works very well.
The reason is that the Canbus fifo's do all the work and my foreground only needs to check in every 1 frames...
which is dependent on the transmission baud rate.
I am running 250KHz on a 48MHz '091, it works flawlessly.
I use an 8byte frame, maybe that's why is seems easy..
100 bits each @ 250Khz, is 300uS per RxFifo full Flag,
So I had to use the interrupt to be sure we don't lose any frames.
2017-02-28 07:50 AM
hello Marsh
I would be thankfull if you can post your code
2017-02-28 04:14 PM