STM32F103C8 CAN transmit using HAL Cube MX and CUBE IDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-31 2:08 AM
Hi all,
I am new to ST.
I am struggling with the attached code.
I am trying to transmit CAN message.
Thanks
- Labels:
-
CAN
-
STM32CubeIDE
-
STM32CubeMX
-
STM32F1 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-03 4:54 AM
You'll need to supply more information/code.
1. How are you checking that you are transmitting? CAN bus analyzer, oscilloscope? Is you hardware connected to another CAN node, with terminating resistor?
2. What baud rate are you running at? You need to supply the code that shows MX_CAN_Init() and relevant code so we can see if the bit timing is correct
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-03 5:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-03 6:19 AM
Some things i am seeing that are incorrect...
- i believe you should call HAL_CAN_Start(&hcan); after you set up the CAN filter.
- hcan is already defined in can.c and MX_CAN_Init() is called. So you should be only referring to hcan variable.
- You have only 1 can controller and yet i see you defined hcan2. So hcan1 and hcan2 are not valid.
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
