New CAN Bus Library for the stm32f103

Working libraries, libraries being ported and related hardware
mack
Posts: 8
Joined: Sat Feb 08, 2020 2:33 am

Re: New CAN Bus Library for the stm32f103

Post by mack »

Thank you, works well for me as well. :D

Arduino IDE 1.8.13 official core
Bluepill - (128k)
65HVD234 transceiver

I do get this warning:

WARNING: library eXoCAN claims to run on STM32F1 architecture(s) and may be incompatible with your current board which runs on stm32 architecture(s).
kjn
Posts: 8
Joined: Wed Apr 15, 2020 4:21 am

Re: New CAN Bus Library for the stm32f103

Post by kjn »

mack wrote: Wed Jul 08, 2020 12:40 am WARNING: library eXoCAN claims to run on STM32F1 architecture(s) and may be incompatible with your current board which runs on stm32 architecture(s).
Yes I had this too, it said the example wouldn't suit my board, this is just a pretty straightforward library definition.

There are a few funky things in the library too, which I'm sure serve some purpose to the original author, but could be tidied up.

e.g. BusType in msgFrm struct seems unnecessary (and confusing)

with a little bit of work it would be a perfect library to include with the core.

Ideally it would be refactored to match the other Arduino can libraries (e.g. avr_can, due_can or FlexCAN) for ease of use and porting of existing code.

I might even have a look at this, time permitting.
mack
Posts: 8
Joined: Sat Feb 08, 2020 2:33 am

Re: New CAN Bus Library for the stm32f103

Post by mack »

It would be very good if it could use the 2nd CAN port of the stm32F105RBT.

Btw I like the way you can select Alternate pins. In my case I did use PA11,PA12
kjn
Posts: 8
Joined: Wed Apr 15, 2020 4:21 am

Re: New CAN Bus Library for the stm32f103

Post by kjn »

mack wrote: Thu Jul 09, 2020 4:19 am It would be very good if it could use the 2nd CAN port of the stm32F105RBT.

Btw I like the way you can select Alternate pins. In my case I did use PA11,PA12
Are the STM32F105xxxx parts supported by this core?
mack
Posts: 8
Joined: Sat Feb 08, 2020 2:33 am

Re: New CAN Bus Library for the stm32f103

Post by mack »

No the stm32F105 isn't supported. It is very similar to the 103. I hope to add the 105 for my purposes but it will be the first time for to attempt to add a new variant.
kelvinrdsilva
Posts: 1
Joined: Wed Aug 03, 2022 1:57 pm

Re: New CAN Bus Library for the stm32f103

Post by kelvinrdsilva »

First, thanks for sharing!

Certainly will help a lot!

I´m using bluepill but with a different transceiver, MCP2551, is there any problem?

Thanks again,

Kelvin Rosa da Silva.
ZNikolas
Posts: 1
Joined: Mon Sep 26, 2022 10:53 am

Re: New CAN Bus Library for the stm32f103

Post by ZNikolas »

Thank you for this library. I love it, when it gets simple. :D

I am a total noob though, so please bear with me.

The need I have for my project is to have CAN-bus speed set to 100kbit/s, but I can see in the code that it is not an option.

To what enum-value would I need to set BR100K in eXoCAN.h?

Code: Select all

enum BitRate : uint8_t
{
  BR125K = 15,
  BR250K = 7,
  BR500K = 3, // 500K and faster requires good electical design practice
  BR1M = 1
};
How do you make the calculations?

Would I need to make any other changes as well to be able to set the speed to 100k?
Thank you.
Post Reply

Return to “Libraries & Hardware”