Spark Logic

CAN Bus Library for STM32F103

STM32F103C8T6 Example · LQFP48 Pinout

I’m looking for a working CAN library for the STM32F103STM32F103Microcontrollers and processors…19.html . ag123 Sat Apr 28, 2018 5:54 pm come to think of it blue pill / maple mini ( stm32f103 ) is an *ideal* keyboard controller, the scanning can be done with assistance of sh…View in hardware catalog . I know it has the hardware for it, but looking at some example code (found here: https://www.olimex.com/Products/Duino/S … e-hardware), I’m totally lost.

Can someone create a CAN library similar to the MCP2515MCP2515Communications, navigation, interfaces and RFID…re: … e-hardware), I’m totally lost. Can someone create a CAN library similar to the MCP2515 library for Arduino? That library is intuitive and easy to use, even for users who kno…View in hardware catalog library for Arduino? That library is intuitive and easy to use, even for users who know almost nothing about CAN.

The MCP2515MCP2515Communications, navigation, interfaces and RFID…re: … e-hardware), I’m totally lost. Can someone create a CAN library similar to the MCP2515 library for Arduino? That library is intuitive and easy to use, even for users who kno…View in hardware catalog Library can be found here: https://github.com/coryjfowler/MCP_CAN_lib

Replies20

Tue May 05, 2015 9:08 pm

Hi,
the MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog world already has a CAN library that eventually worked with some effort and various contributions, including mine.
you can have a look here : http://forums.leaflabs.com/topic.php?id=802
I think I will try to port it to Arduino when I have the time to do it. So far, the MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog version works pretty well.

Thu Jul 23, 2015 5:11 pm

I need this :roll:

Thu Jul 23, 2015 9:25 pm

you probably need to see if you can contact the author of this link

http://akb77.com/g/files/media/Maple.Ha … 0.0.12.rar

as its been over a year since anyone was active on the MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog forum, discussing this, and there may also be updates in the forum not incorporated into this code.

It may not even compile

Fri Jul 24, 2015 8:08 am

Can I use this library for STM32F103CBT6STM32F103CBT6Microcontrollers and processors…le Ok, let me know. VadimEL Mon May 01, 2017 8:18 pm can not compile Sad Maple mini ( STM32F103CBT6 ) In file included from C:\Documents and Settings\Vadim\Мои документы\Arduino\h…View in hardware catalog board?

Fri Jul 24, 2015 8:29 am

I’ve just downloaded that file, and its more than just a library, it has replacement for some core files including RCC and USB, so basically I suspect its not going to work.

i.e Its unlikely that you can just replace the rcc.c and usb.c files with the ones from that download, as almost certainly rcc.c has been updated since those files were crated (in 2012) and I suspect so has usb.c

You’d need to diff those files against the ones shipped as part of the MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog IDE back in 2012 (the IDE can still be download), and determine what changes were made by the author, then you’d need to apply the same changes to the current copies of usb.c and rcc.c and .h

Without actually doing all that myself, I have no idea how easy or complex, it would be to merge in the changes.

Please feel free to work out what needs to be updated and preferably send me a pull request when you’ve updated the core.
But I don’t have time to add CAN support at the moment, and I’m not even sure I have any CAN devices to test with, even if I did have time to look at this.

Thanks

Roger

Fri Jul 24, 2015 12:01 pm

Thanks a lot :)

Sat Jul 25, 2015 9:08 am

I’m interested too to this library, i try to build a Nmea2000 interface with Maple MiniMaple MiniDevelopment and computing boards…8MHz petertumler Thu Sep 24, 2015 10:58 am Hi, I’m trying to underclock a STM32F103 ( Maple Mini ) to 48MHz (for energy efficiency reasons). According to the datasheet .. The full…View in hardware catalog (Arduino UnoArduino UnoDevelopment and computing boards…ime debugging. konczakp Mon Jul 18, 2016 12:18 pm OK, so I took working example from Arduino UNO . I’ve cut off everything from library that I don’t need and from rest I have crea…View in hardware catalog is too slow for handle all data on the can bus). Please keep me updated about this.

Sat Jul 25, 2015 11:38 am

Hi,
I am sorry I had no time yet to work on this port. If you browse the thread in the MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog forum (http://forums.leaflabs.com/topic.php?id=802), you will find mentions of changes in USB and RCC.
This is because in the STM32F103CBT6STM32F103CBT6Microcontrollers and processors…le Ok, let me know. VadimEL Mon May 01, 2017 8:18 pm can not compile Sad Maple mini ( STM32F103CBT6 ) In file included from C:\Documents and Settings\Vadim\Мои документы\Arduino\h…View in hardware catalog used in MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog and Olimexino boards, the USB and the CAN are mutually exclusive, since they use a shared portion or the memory (which is a pity, for you cannot debug a CAN application by writing information to the SerialUSB channel).
In addition, the CAN and the USB share a common interrupt vector.
In the original library, they had forgotten to add the switch to route the interrupt either to the USB or to the CAN processing. Which I added.
The drawback is that I had to declare an identifier in the core, which belongs to the CAN library. So far, I have to include the CAN library in every project, even if it does not use the CAN, just because the lacking identifier would produce a compile error.
In my contribution in the forum, you will see the lines that are changed in both USB.c and RCC.c and .h.
Roger Clark is right saying these files are likely to have changed since the version I used; but if you only do the mentioned changes in the current core files, I guess it will work.
If by the way you find a means to relieve the user from the need to include the CAN library when it is not needed, It would be great.
Regards,
Jean-Marc

Sat Jul 25, 2015 12:34 pm

Jean-Marc

Did you try using a weak reference to a dummy identifer?

The core code does this quite a lot for default ISRs

Sat Jul 25, 2015 4:07 pm

I understand, i had suspect about USB/CAN pins and memory sharing, now you confirm me my worry. By the way i think that the best and easy solution is the use of a standard MCP2515MCP2515Communications, navigation, interfaces and RFID…re: … e-hardware), I’m totally lost. Can someone create a CAN library similar to the MCP2515 library for Arduino? That library is intuitive and easy to use, even for users who kno…View in hardware catalog board with integrated transceiver like this. With 3usd we have transceiver and can controller in little module (in any case we must add the transceiver for interface the Maple MiniMaple MiniDevelopment and computing boards…8MHz petertumler Thu Sep 24, 2015 10:58 am Hi, I’m trying to underclock a STM32F103 ( Maple Mini ) to 48MHz (for energy efficiency reasons). According to the datasheet .. The full…View in hardware catalog with can bus). I have tested the Flori1989 MCP2515MCP2515Communications, navigation, interfaces and RFID…re: … e-hardware), I’m totally lost. Can someone create a CAN library similar to the MCP2515 library for Arduino? That library is intuitive and easy to use, even for users who kno…View in hardware catalog library and it compile without errors the Maple MiniMaple MiniDevelopment and computing boards…8MHz petertumler Thu Sep 24, 2015 10:58 am Hi, I’m trying to underclock a STM32F103 ( Maple Mini ) to 48MHz (for energy efficiency reasons). According to the datasheet .. The full…View in hardware catalog sketch , the library communicate with MCP2515MCP2515Communications, navigation, interfaces and RFID…re: … e-hardware), I’m totally lost. Can someone create a CAN library similar to the MCP2515 library for Arduino? That library is intuitive and easy to use, even for users who kno…View in hardware catalog by SPI (all problems with SPI seem to be solved with the last version of STM32STM32Microcontrollers and processors…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…View in hardware catalog arduino). I don’t have canbus or nmea2000 hardware at moment for testing (i wait too the Maple MiniMaple MiniDevelopment and computing boards…8MHz petertumler Thu Sep 24, 2015 10:58 am Hi, I’m trying to underclock a STM32F103 ( Maple Mini ) to 48MHz (for energy efficiency reasons). According to the datasheet .. The full…View in hardware catalog baite boards).

Sat Jul 25, 2015 4:32 pm

To Roger Clark : please explain the technique of weak reference to a dummy identifier.
To peppeve : I know the sharing is annoying, but with olimexino boards it is very convenient to use the built-in CAN without any shield or extension. If you need a serial port you still can use a physical port plus a FTDIFTDICommunications, navigation, interfaces and RFID…something like: while true; do openocd -f /usr/local/share/openocd/scripts/interface/ ftdi /ch340.cfg -f /usr/local/share/openocd/scripts/target/stm32f1x.cfg ; sleep 1;done I’m tr…View in hardware catalog adapter. Which I did recently because I needed a data rate of 115,200 bps on the serial port, and the fake serial port via USB is very slow.

Sat Jul 25, 2015 4:49 pm

Phono wrote:the fake serial port via USB is very slow.

Sat Jul 25, 2015 9:34 pm

@Phono

The Due core code makes some use of weak references which is easy to understand

see

https://github.com/arduino/Arduino/blob … Serial.cpp

starting at line 38

then on line 66

Perhaps the same technique can be used for CAN.

i.e add weak refs to the core, and checks in the core, that only call the CAN function if it really exists ?.

Sat Jul 25, 2015 9:44 pm

To peppeve: I do not have exact figures, but the bit rate of the built-in USB-COM converter is in the range of 9600 bps.
Yes, the Olimexino STM32Olimexino STM32Development and computing boards…nt to make sure whether I get it right or not. I have two boards – with STM32F103RB ( Olimexino-STM32 ) and with STM32F407ZG (STM32-E407). For the STM32F1 board I follow these ins…View in hardware catalog board has the CAN transceiver built-in and a screw header for directly connecting the CAN bus. Very nice !

Tue Nov 17, 2015 9:23 am

BUMP

Any updates on CAN Library?

Sat Nov 21, 2015 7:37 pm

I would very much like to participate in supplying a CAN library, but actually the investment required to jump in the bandwagon of this new environment is a bit high for me to start working on it.
However, if someone could handle the integration of the library into the new environment, I am available to help with the CAN side of the things.
So if someone is willing to try and port the MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog -compatible CAN library to Arduino, let him call on me, and I will give him support for this task.
Sorry for not being able to do more so far.

Thu Oct 20, 2016 10:39 am

any update ?

Thu Oct 20, 2016 5:23 pm

I have eventually found the time to port this library and I have ported some of my projects to Arduino for STM32STM32Microcontrollers and processors…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…View in hardware catalog . The CAN library works satisfactorily (I even fixed bugs that existed in the original MapleMapleDevelopment and computing boards…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…View in hardware catalog version by X893). I allowed myself some time to ensure it is bug free, and my intent was to submit it in the next weeks.
I am not familiar with the push request stuff, which held me from submitting it so far.
If someone would like to help me, I could send him the files.

Thu Oct 20, 2016 5:37 pm

Im also not very familiar with source control either. But I think you can just upload all the files at once in github ?

Thu Oct 20, 2016 6:29 pm

A quick guide to github :

– create your own account on github
– log into it
– navigate to Roger’s github
– click on Fork button on upper right corner (this will create a fork into your account)
– use “git clone <you forked github URL>” in a location of your choice on your local disk.
– add the new library into the tree, then do “git add <the library folder>”
– git commit -m “the comment describing the new lib”
– git push (it will push the change into github web)
– navigate back on you github web and press “compare” button, it will show diffs against Roger’s main branch.
– click on “Create a Pull Request” and provide comments to Roger.

Post a reply

Optional · up to 10 MiB