We have been running into some issues with our module when we attempt to change the CAN bitrate in the middle of our application.
What we are attempting to do is send a command to our remote modules at one bitrate, which tells them to switch to a different bitrate, and then we communicate at that speed for the remainder of the communication. However, when we do so we frequently do not receive communication back from one or two modules (out of 16), whereas if we do not change the bitrate all nodes report back every time.
We are using the ip (route 2) utility (as referenced in http://processors.wiki.ti.com/index.php/Sitara_AM35x_CAN_%28HECC%29_Linux_Driver) to set up the CAN interface and from there use sockets to send and receive frames inside our program. To switch bitrates we the execute the following commands, using system(), from within our program: “./ip link set can0 down” “./ip link set can0 type can bitrate <new bitrate> triple-sampling on” and “./ip link set can0 up”. Is there a better way to do this from within our program? We notice that this takes a couple seconds (2-3) to execute and, if possible, we would like it to be more immediate like it is on our nodes.
For reference, our remote nodes are using the Stellaris LM3S9B92 and I have a support question open to ensure that I am using the correct procedure to change bitrates on that end as well (http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/471/p/119876/429963.aspx).
Any feedback would be greatly appreciated!