Skip to main content
ABhat.7
Associate III
March 1, 2021
Solved

Not able to receive and transmit data over CAN network

  • March 1, 2021
  • 8 replies
  • 1742 views

Hi, i am trying to implement CAN Protocol in STM32F103C8 Controller in Normal Mode

1) not knew what should be the hardware required for implement Can protocol

2) is their any bug in stm32cubemx code generate using library 1.8.0

This topic has been closed for replies.
Best answer by Ons KOOLI

Hi ABhat.7,

Thank you for your reply. Can you please mark this question as answered by checking Select as Best, Fist?

Then, you can open a new question to ask about USB Mass Storage since it is a different topic.

Best Regards,

Ons.

8 replies

Ons KOOLI
Visitor II
March 1, 2021

Hi ABhat.7,

1) Can you please explain what do you mean ? You can use an STM32F1 Eval board or you can google the solution. There are several sites that describe the hardware implementation of CAN protocol. I took a look an found a lot , but unfortunately , I cannot provide you non-ST links.

2) I generate F1 projects with FW v1.8.0 and later , and I have no problem with that. Can you please specify the issue you faced ?

Best regards,

Ons.

ABhat.7
ABhat.7Author
Associate III
March 2, 2021

Hi,Ons Kooli,

​

Thank for early reply i am implement Can bus in stm32f108c8 for the first time ,i qm pretty new to this i have generate code in cubemx want to configure can in normal mode so my first doubt can we configure normal mode on single board or we required 2 stm32f1 board to perform this .Secondly how to configure filter to pass a range of id

Javier1
Principal
March 1, 2021

I can provide non ST links ;)

this one is pretty good https://www.youtube.com/watch?v=ar3I38lCLT4&ab_channel=MutexEmbedded-Education

Most of the times i had problems with canbus was either incorrect canfilter configuration (they are confusing) or hardware issues(EOL resistor missing or swapped H and L canbus lines)

hit me up in https://www.linkedin.com/in/javiermuñoz/
Ons KOOLI
Visitor II
March 3, 2021

Hi ABhat.7,

As far as I know, CAN in normal mode requires two boards and CAN in loopback mode requires only one board (because the board is looping back to itself). In STM32CubeF1 Package Firmware, you can find an example of CAN protocol in normal mode under the following directory: Projects\STM3210E_EVAL\Examples\CAN\CAN_Networking

I hope this is helpful.

Best Regards,

Ons.

ABhat.7
ABhat.7Author
Associate III
March 4, 2021

Thanks for reply i have been able to transmit data over can and checked with CAN Analzyer ,now when i code for the receive as per the directory give above STM32CubeF1 Package Firmware, you can find an example of CAN protocol in normal mode under the following directory: Projects\STM3210E_EVAL\Examples\CAN\CAN_Networking in STM32F103C8 i found that my callback function is never called where RXADD_Message is present and i also noted that my interrupt is enable as the FMPIE bit in CAN_IER register is set to 1.what could be the reason that the callback is not called attached is my main file .

Ons KOOLI
Visitor II
April 12, 2021

Hi ABhat.7,

Can you please share your .ioc file ?

Best Regards,

Ons K.

ABhat.7
ABhat.7Author
Associate III
April 12, 2021

Sorry for late reply but i am able to transmit as well recive data through can but once agsin thank you for your support.

​

I want to know one mre thing can we use stm32f103 as a mass storage device to store data in usb any support is useful to me as i am new to usb .

​