Enhance documentation and can filtering

Hi everyone, I think that SDK is pretty stable now and I believe that GHI team with the help of the community could enhance the documentation.

As an example, for those who want to use CAN, there’s not enough information about filtering:

Can I use SetGroupFilters and SetExplicitFilters simultaneously?
Does a second call of these methods overwrite the previous filter?
Why not adding an example?

This has already been discussed on the forum 1 or 2 years ago and at this moment the main reason given by GHI team was that they were focused on solving software issue. May be priority are different now?

Moreover, a lot of CAN applications use standards such a SAEJ1939 or NMEA2K which is based on the PGN value. However PGN is somehow hidden in the can identifier. Adding a PGN filtering in the core would be very usefull.

1 Like

We are already working in documentation however CAN is a very deep subject and is beyond our documentation.

Yes both fillers work together.

@ Gus, I’ve looked that the STm32F405XX specifications on the features of the bxCAN; it’s alot! Did you guys actually implement all that stuff or is it a basic subset?

@ leforban I intend to be using the CAN bus a lot over the next few weeks (once I can figure out how to connect the devices with schottky diodes). So you’re trailblazing for me right now. Thanks much.

I am still trying to find how to manage efficiently PGN for NMEA2K and SAE J1939. I need to filter specific PGN and this is described inside the CANID. so filtering with mask would be a must have but it does not seem to exist in .netmf. Any idea?

There is no PGN on CAN. That is a higher layer protocol probably.

If it is part of the ID then you can filter IDs.


J1939 is a protocol on top of the basic CAN layer, with a specific breakdown of the identifier. I work on passenger cars, so I am not very familiar with the details of this protocol, but my understanding is that the PDN is effectively the central section excluding the top 3 bits (priority) and the bottom 6 bits (source address).

So, if all the messages you need in a PDN are the same priority, you should be able to use a group filter to span a complete PDN. If you have more than one priority, you will need more than one group filter.

Alternatively, you could have a wider group filter and mask in the CAN received event, although I find that the processing needed there is a potential killer. My Panda II struggles with Rx and Tx on 2x 500kbps buses with some signal translation in between (basically a covering gateway), and any rough filtering I am able to add helps massively. J1939 appears to be typically 250kbps, so that will help.

Hope that is of some use!



Just a sidenote on documentation, you can continue your discussions about CAN challenges.

BUT, I still think the GHI documentation is a core value in my work, but also think it can be improved significantly - and that the community can load off some work from GHI. Not sure though how its done, as my experience with the mbed.org developer site is really BAD and at the same time impressive. Bad because the quality of some of the things you find is horrible, and really good sometimes … you know what I mean.

The need for a version indicator on all documentation, and a need for visible user-comments is the two most important things in my opinion.

Just saying…

@ HalfGeek - an excellent first post. Thank you.

Welcome to the community.