2024-05-30 01:15 AM
To implement a "bridge" devise between two independent CAN buses, the STM32F105R8 chip was chosen. From the specifications it follows that it has 2 CAN buses, but going deeper into it I realized that they share a lot of resources among themselves.
could you help me clarify the following:
1. can this chip, from a software/hardware point of view, support 2 CAN buses operating at different speeds CAN1=250kbps and CAN2=500kbps for example?
2. the delay in sending messages from CAN1 to CAN2 is critical for this device, could someone let me know if problems can arise with this?
3. are there any restrictions on the maximum number of TX/RX messages (CAN_IDs) for two buses? As far as I understand, CAN filters are shared to CAN1 and CAN2...
Thanks in advance everyone for your help!
Solved! Go to Solution.
2024-06-05 06:27 AM
Hello,
These are my comments:
1. can this chip, from a software/hardware point of view, support 2 CAN buses operating at different speeds CAN1=250kbps and CAN2=500kbps for example?
Yes. CAN1 and CAN2 are independent from this standpoint.
2. the delay in sending messages from CAN1 to CAN2 is critical for this device, could someone let me know if problems can arise with this?
It depends on the number of messages handled at a time and how the CPU can manage it. I think you need to handle Rx/Tx message with a ring buffer.
3. are there any restrictions on the maximum number of TX/RX messages (CAN_IDs) for two buses? As far as I understand, CAN filters are shared to CAN1 and CAN2...
Each CAN instance has:
Hope I answered your questions.
2024-06-05 06:27 AM
Hello,
These are my comments:
1. can this chip, from a software/hardware point of view, support 2 CAN buses operating at different speeds CAN1=250kbps and CAN2=500kbps for example?
Yes. CAN1 and CAN2 are independent from this standpoint.
2. the delay in sending messages from CAN1 to CAN2 is critical for this device, could someone let me know if problems can arise with this?
It depends on the number of messages handled at a time and how the CPU can manage it. I think you need to handle Rx/Tx message with a ring buffer.
3. are there any restrictions on the maximum number of TX/RX messages (CAN_IDs) for two buses? As far as I understand, CAN filters are shared to CAN1 and CAN2...
Each CAN instance has:
Hope I answered your questions.
2024-06-05 09:38 AM
I've used an STM32F105 as a bridge without using filters. So all CAN messages were received on CAN1 and CAN2. They would pass messages through from CAN1 to CAN2 and CAN2 to CAN1, except for the ones I was interested in. For those messages I just modify the CAN data and then pass the modified message through. I used a IntrepidCS neoVI Fire 2 to monitor the messages on both sides of the bridge. Not one message was missed being passed through.
I did use a ring buffer for both Rx and Tx messages. Depending on what you do in the CAN interrupt, can make or break your project. I'm in and out of the interrupt using an efficient ring buffer. That is why i don't miss any CAN messages even using 1 CAN Rx Fifo. I was pleasantly surprised how well the STM32F105 could handle the CAN messages efficiently without CAN ID filters.
One of the several things i did was intercept the vehicle gear information while the vehicle was being driven but tricked the Radio into thinking the vehicle was in reverse. This would enable the rear camera input so we could feed in an outside video source.
2024-06-05 12:49 PM
As I recall most of the commonality between the cores was the parallel pattern matching circuit for the filters. Took up a lot of gates, and ran very fast.
Not sure if it was CAM (content address-able memory), but it definitely wasn't a sequential look-up-compare design.
Each had it's own FIFO, and transmission buffers.
2024-06-11 01:06 AM
thanks for sharing your experience!