CrossCore XA
Revision: 1.0
Programmers Guide
Date: Jul 1, 10
3.1.3.
Error interrupt options
Error interrupts are disabled by default. Enabled them by giving module parameter errorirq=1
during module loading. By enabling error interrupts user can receive error frames. Bus off errors
will come through even if the error interrupts are not enabled.
# modprobe xilinx errorirq=1
Warning: Enabling error interrupts and sending frames when module is not connected to active
bus may cause CAN acknowledge errors to overload CPU. User caution required. It is
recommended to avoid sending, until one frame is received.
3.1.4.
Silent mode option
The Xilinx platform module implements a common listen-only mode for both CAN interfaces. In
this mode, CAN controller only listens to the CAN receive line without acknowledging the received
messages. Sending messages is also disabled. This mode is useful for bus loggers and also needed
for undisturbed bus communication under automatic baud rate detection.
Silent mode can be enabled or disabled for each CAN interface using module parameter silent with
xilinx_platform driver.
# modprobe xilinx_platform silent=0x3
Silent value is an interpret bitwise value for setting each CAN interface to listen-only mode or
normal mode. Lowest bit is for can0 and second bit is for can1. Bit value ‘1’ is for listen-only and ‘0’
is for normal operation mode. In example above, both interfaces are set to listen-only mode.
3.1.5.
Automatic baud rate detection
Automatic baud rate detection is implemented as a part of canapi library. Automatic baud rate
detection is started by calling:
CanHandle Handle = CanOpen("can1");
CanSetBaudrate(Handle, CCCAN_BAUDRATE_AUTO);
Because canapi is running on top of SocketCAN and using a socket API, there are three limitations
in calling automatic baud rate detection:
1.
CanSetBaudrate can be called only once with CCCAN_BAUDRATE_AUTO after driver
modules are loaded.
2.
Other access to CAN interface under detection is disturbed by detection (interface is
dropped during detection).
3.
Both silent mode and error interrupts must be enabled in drivers for successful baud rate
detection.
See CC CANAPI documentation[5] for more details.
Detection speed depends on actual baud rate as well as bus load. Once the baud rate has been
found the baud rate detection is disabled.
www.crosscontrol.com
10