cancel
Showing results for 
Search instead for 
Did you mean: 

How to set CAN protocol

Zek_De
Senior

Hello friends, I am trying to build a CAN protocol with CubeMX I am using STM32F103 and STM32F446 and I did set them by same clock freq, but I couldn't get any data on debug operating.Do you have any simple example that you would send me that.

5 REPLIES 5
RN
Senior

Hello,

go to \STM32Cube\Repository\STM32Cube_FW_F4_V1.21.0\Projects\STM324xG_EVAL\Examples\CAN\CAN_Networking

study this example and try to use it for your mcu. its very easy . i tried it and worked.

couldnt get data where ?

are you trying loop back mode or normal mode ?

are you using transceiver ? if not, then in loopback mode, can_rx has to be pulled vcc via 3.3k resistor

you can get more idea here :

http://www.keil.com/appnotes/files/apnt_236.pdf

Zek_De
Senior

I am using transceiver ,also I will look example,and I would like to ask a more question,If 10 device send data on the line ,how can I get all data.Is it possible by hardware or can I build extra sofware control?

T J
Lead

There are 3 onboard RxFIFOs for CanBus. that is, only 3 frames wide.

The devices will all take turns, they can see via feed-back on the RX pin that the bus is active.

Your software must remove packets from the FIFO as they arrive to free them up to receive new data. So don't expect to dilly-dally in the IRQ Handler, or printf() diagnostic info in there.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Zek_De
Senior

Thank you information, I handled it by software control,