Cannot change CAN Baud on the fly - STM32F103C8T6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-20 8:50 AM
Hi, I'm developing an CAN to USB converter, this converter needs to change the baud rate of the CAN when the user sends an determined message via UART.
The Prescaler, TimeSeg1, TimeSeg2 are all configured correctly for the baud rate I desire, as example:
Values of hcan after sending baud rate change
Solved! Go to Solution.
- Labels:
-
CAN
-
STM32F1 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-20 8:54 AM
>>Is there something that I'm missing with this routine?
Wouldn't HAL_CAN_Init() be the function to be calling? This would then presumably call HAL_CAN_MspInit(), a routine you supply to configure the clocks, pins, etc.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-20 8:54 AM
>>Is there something that I'm missing with this routine?
Wouldn't HAL_CAN_Init() be the function to be calling? This would then presumably call HAL_CAN_MspInit(), a routine you supply to configure the clocks, pins, etc.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-20 1:46 PM
Call HAL_CAN_DeInit first. Change your baud rate. Then call HAL_CAN_Init then HAL_CAN_Start
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
‎2023-10-20 6:54 PM
@Karl Yamashita @Tesla DeLorean Thank you so much! I noticed it just a few moments after posting this topic. But anyway, that was exactly the problem. Thank you so muuuuch!!
