STM32F103C8T6 (Blue Pill) CAN BUS Communication
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-06 10:46 AM
Hi,
I´m trying to communicate two blue pills between them using CAN bus, but when I try to run it, it doesn´t even finish the start up, because I tried to use a blink program selecting the CAN in the .ioc and not using it and doesn´t work.
Does anyone knows why does this happen?
- Labels:
-
CAN
-
STM32F1 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-06 12:27 PM
Perhaps you should use a debugger to establish what's going on?
​
I​ will note the F103 can't support CAN and USB concurrently.
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
‎2022-10-07 12:30 AM
Hello @Javier Parra​ and welcome to the Community :)
As @Community member​ said , it may be related to the use of USB and CAN with STM32F103:
Concurrent use of USB and CAN with STM32F103
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Imen
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-07 6:20 AM
Hello,
Does "Blue Pill" board embed CAN transceiver (I think not) ? If not, did you add this external component?
If not, it will never work!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-09 5:36 AM
@SofLit,
I think your statement is not correct: if on both side there is no tranceiver it can work for sure.
See "Beginning STM32, by Warren Gay ISBN978-1-4842-3623-9" P317 Chapter 18 CAN-bus"
RX and TX are connected to the same bus with a 4.7K pull up resistor.
Best Regards,
Johi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-10 1:54 AM
@Johi,
We do NOT support this kind of "exotic" connections and we don't guarantee the behavior during the communication .. So, in normal mode, CAN bus SHOULD be used with transceivers in a complete bus configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-10 12:16 PM
Hello, thank you for your comment.
I'm not using the USB, I have the st-link v2 programmer but I don´t use the USB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-10 12:22 PM
Hello,
Yes I´m using two transceivers with a 120 OHM resistance between CANH and CANL.
I have a configuration like in the image but with both BluePills and the transceiver model is a TJA1050.
And when I program the boards the main doesn´
t even start due to the can
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-11 2:03 AM
Ok then..
What is the voltage level of "S" pin (Silent mode)?
In the TJA1050 datasheet it was stated the following:
"Control pin S allows two operating modes to be selected: high-speed mode or silent mode....
In the silent mode, the transmitter is disabled. All other IC functions continue to operate. The silent mode is selected by connecting pin S to VCC and can be used to prevent network communication from being blocked, due to a CAN controller which is out of control."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-14 12:01 PM
I´ve been trying to see what´s going on and its a HAL_Error.
When I init the can it enters here:And the HAL_GetTick () sets to -128 and there is the problem.
But i dont know why.
