CAN Communication using STM32F303KB (Nucleo) and SN65VD230 transceiver (help!)
- March 10, 2020
- 2 replies
- 3098 views
Hi, I am a beginner on STM32. I got assigned into a project where i'll use some MCUs from STM32 family (F103VE, F103CT, F303KB) to build a sensor grabber to get data from OBD-II of a vehicle and some sensor modules (Vibration, BMP280, IMU). My F103VE board has a CAN transmitter built-in, so i don't have to use a discrete module, but my F103CT and F303KB does not.
This is the CubeMX GPIO layout and CAN Settings. I did not utilize Timer because i am still not sure how to do it (if someone has a introduction to timers for CAN, please let me know)


I wish to use the SN65VD230 transceiver to request data from the OBD-II, save the data alongside sensors and transmit them to a PC via USB-to-CAN, but i can't seem to get the CAN communication to work. I connected the Transceiver as-is (without resistors) with
RX->PA11
TX->PA12
When i try to debug it in KEIL, it shows error of cannot initialize CAN.
I tried searching around, but haven't found a similar problem using the STM32F303 and SN65VD230 hardware. Can someone enlighten me of a solution to this problem and a general usage guide of CANBUS with discrete CAN Transmitter on STM32?
The code for main.c file is attached. Thank you very much in advance.
Cheers,
Satria