Thank you Mike, I'll try it, if I manage to make it work on Olimexino, I post it here. And if someone else have another experiences with CAN (especially Olimexino), please, let me know :-)
Using the CAN interface
(103 posts) (27 voices)-
Posted 3 years ago #
-
Please, is there anybody who have a functional bxCAN library for Olimexino? I!m trying to make it work, but it is not working... I still can't manage that yet...
Posted 3 years ago # -
Is there anybody in there? Just nod if you can hear me, is there anyone at home?
Posted 3 years ago # -
I guess not so many peoples using CAN to write something helpful in your case.
Posted 3 years ago # -
I guess too, so I'm going to try to write own library... It take a lot of time to me :-D and I hope that it will work...
Posted 3 years ago # -
Have you tried posting at https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx
There are several people there who have mentioned CAN (a fairly awkward search term :-)
EDIT: A person called 'clive1' is extremely helpful and knowledgeable over there. If he answers, it is often definitive.
(Full disclosure: I am not a member of LeafLabs staff.)
Posted 3 years ago # -
Thank you gbulmer, I'll try it.
Posted 3 years ago # -
You can make as you want - but you never use CAN with maple. You need changes in core because maple dev. never change own code (also fix own error). I try say about this but maple man very close and make as they make. So for implement CAN you need change some file in core (i think never maple man make this) and implement from ST libs for filter and support. I use CAN for ST 103 series with limited (USB) and with 205 w/o limitation. i read about new Maple II with F4 but not trust. i think all old bugs go to F4. Very durty code inside maple code. It's only me opinion and not a all.
Posted 3 years ago # -
Hi x893, I'm using Olimexino (STM32F103RB) from Olimex and don't want to use maple board. Olimexino have fully HW supported CAN.2A and CAN.2B, but I don't have a library to make it work...
Posted 3 years ago # -
Why you can't use standard library from ST ?
Only need disable USB and add support to interrupt handler (because USB and CAN use the same memory and interrupt)Posted 3 years ago # -
I have CAN working on Olimexino-STM32. I'm using Eclipse though, not maple. I just took CAN.c/h from keil with a few minor changes. You should be able to find their "CanDemo" example online. I'm very new to all this arduino/maple stuff though, so it was a fair bit of trial and error, but the CAN was actually the easiest thing to get working!
The CAN has broken single step debugging though, since the debugger always breaks on the CAN interrupt.
I'd really like to get CAN working on Maple though. Maple has a lot more pre-made code for stuff like LCDs and serial ports etc etc. I tried to persist with the raw Eclipse type development, but it quickly gets out of hand trying to add something like LCD support to my project.
1. So I started with the "Blink" example project from Olimex in the Olimex eclipse install.
2. Next I added the CAN library from ST, and added it to my project, it needs manually uncommenting the interrupt handlers for CAN in the example project.
3. Then I added NVRam support from an ST Appnote example.
4. now I'm stuck trying to add a (DFRobot) LCD. I spent basically a day on it to no avail, but by changing over to Maple, I was up and running with the LCD within half an hour. But now it seems CAN might be too hard to get working here!Posted 3 years ago # -
Hi stumo, I've just ordered an Olimexino-STM32 as I want to use the CAN interface on it.
Would it be possible for you to post a little more detail of step 2 above, and why you did step 3 please?
I'm also very new to Arduino/Maple - this will be my first project!
Posted 3 years ago # -
It was my first Arduino project, and I got CAN working within a few hours of building/loading/running the blink example, so its fairly straightforward to get it working (though I have been embedded C programming for over 10 years in my day job).
But my memory of exactly what I did is all a bit sketchy at the moment. I just needed to get something out "quick and dirty" at the time, and it was more than a good few months ago that I did it.
So IIRC... I just looked at the Keil CanDemo code as a template for what needed to be set up and done CAN wise. Then I used the CAN.c/h (part of standard library from ST) to do my actual CAN code. The Keil and ST CAN function calls are all pretty similar, but names are changed slightly etc.
The main part I stumbled at was that when I started from using the Olimex blink example project as a base for mine, and all of the interrupt handlers were commented out.
And then it took a bit of poncing around to get it all to build with just my new CAN code and libs I added with the correct function/variable/constant names I needed. And remove/ignore all the other crap they like to tag on to their example/demo code.
I added NVRam support just because I needed it for my project, you don't need it for CAN. I mentioned it because it gets increasingly hard to quickly add more stuff when you are on a limited time-scale. Which is why I thought about moving over to maple. But it looks like CAN is a bit of a stumbling block on maple.
Posted 3 years ago # -
Brilliant, thanks for this Stumo - I know what to look out for now. My embedded experience is limited but I have a fair amount of experience in CAPL, C/C++ and Matlab, so hopefully I'll find my way through!
Posted 3 years ago # -
Hi stumo.
When you say you have the CAN interface working on the Olimexino-STM32, is that through the loopback or actually communicating with another board?
I've managed to get the CAN interface working through the internal loopback, but I'm having a devil of a time making it work through the transceiver.
The problem I'm having is that the CAN Tx pin is permanently stuck low, therefore the transceiver is constantly driving a dominant state onto the bus and both nodes go bus-off almost immediately. If I reconfigure the pin as a GPIO output I can toggle it high, but with it remapped as a CAN pin it's always stuck low...
Posted 3 years ago #
Reply »
You must log in to post.