Page 1 of 1

CAN driver for stm32F072 absent?

Posted: Wed Jun 17, 2015 8:44 am
by DeusExMachina
Hello,

I tried to use common CAN lld STM32 driver for STM32F072.
But it doesn't work at all (2.6.8 and 3.0) . It seems that CAN module in STM32F072 uses just single interrupt vector, but existing CAN driver is based on usage of 4 interrupts (TX, RX0, RX1, SCE).
How can I make this driver workable?

Can anybody provide more advanced example for CAN driver usages for Chibios?

Re: CAN driver for stm32F072 absent?

Posted: Wed Jun 17, 2015 1:24 pm
by Giovanni
The driver requires a change because the unified IRQ vector, it is in the to-do list. About examples, the demo does about everything there is to it except filters, those are documented in the Reference Manual in case you need them. Do you need a specific example?

Giovanni

Re: CAN driver for stm32F072 absent?

Posted: Thu Jun 18, 2015 5:35 am
by DeusExMachina
I updated lld driver for one common IRQ. Testhal example now works fine, but it is very basic.
Maybe it is better to make some testhal example for F4 with two CANs?
It is possible to send from CAN1 to CAN2. I think some filtering example could be also useful.
Also, it unclear to me how to set communication speed.

Re: CAN driver for stm32F072 absent?

Posted: Thu Jun 18, 2015 8:13 am
by Giovanni
Hi,

Communication speed must be set following the indications of the STM32 Reference manual, it is not matter of setting simply the baud rate. On the RM there is a table with values for various speeds, see "32.7.7 Bit timing" section on the F4 manual (RM0090), the settings are those documented for the CAN_BTR register. Do you need a specific setting?

About the demo, it simulates two boards communicating using the CAN "loopback mode" those two threads, placed on different boards would operate exactly as in the demo, you just need to disable the loopback in the configuration structure.

I will updated the CAN driver to use a single IRQ during the weekend, P6 will contain the fix.

Giovanni

Re: CAN driver for stm32F072 absent?

Posted: Sat Jun 20, 2015 3:32 pm
by DeusExMachina
Thank you!