Closed spiralray closed 8 years ago
I tested on STM32F103VET6 and the fixed program worked successfully.
I also verified that CAN2 successfully worked on F4 devices. My sample program is here. https://github.com/spiralray/stm32f4_template/blob/master/src/sample/f4mini/can/main.cpp
Thanks for this. Would you be able to eliminate the use of floating point instructions? They bring with them a significant increase in flash usage that I'd prefer to avoid on the smaller MCUs if possible. One way is to perform all your calculations scaled up then divide down when you're finished.
Okay, I fixed the problem, and tested on F4 devices.
Many thanks!
I found some serious problems related to CAN Interface.
First, CanPinInitialiser for F4 devices mistakenly initialize CAN_RX as Gpio::INPUT. This pin must be initialized as Gpio::ALTERNATE_FUNCTION.
Second, baudrate of CAN isn`t calculated correctly. Baudrate is more important than sample point for CAN interface, but the previous program doesn't work so.
I might fixed these problems, but only tested on STM32F407. We should tested on other series.