![Phytec phyBoard Wega AM335x Application Manual Download Page 81](http://html1.mh-extra.com/html/phytec/phyboard-wega-am335x/phyboard-wega-am335x_application-manual_1554191081.webp)
Accessing the phyBOARD-Wega Interfaces
©
PHYTEC Messtechnik GmbH 2014 L-792e_1
65
An adapter cable is included in the phyBOARD-Wega AM335x Kit to facilitate the use of the
CAN interface. The following figure shows the signal mapping of the adapter.
Pin 6:
GND
Pin 2:
X_CANL
Pin 7:
X_CANH
Pin 3:
GND
Pin 5:
Shield
Figure 10:
CAN Connector Signal Mapping
Depending on the muxing options a second CAN interface (CAN0) is available on expansion
port X69 (
section 4.6.4
). CAN0 (TX and RX) can be used instead of UART0 (RX and TX) or
MMC2 (DAT1 and DAT2).
3.2.6.1
Software Implementation
Unfortunately, CAN was not designed with the ISO/OSI layer model in mind, so most CAN
APIs available throughout the industry do not support a clean separation between the
different logical protocol layers, as for example known from Ethernet.
CAN is supported by drivers using the proposed Linux standard CAN framework ”Socket-
CAN”, which extends the BSD socket API concept towards CAN bus.
Because of that, using this framework, the CAN interfaces can be programmed with the BSD
socket API and the Socket-CAN interface behaves like an ordinary Linux network device,
with some additional features special to CAN. Thus for example you can use
ifconfig
–a
to see if the interface is up or down, but the given MAC and IP addresses are arbitrary and
obsolete.
The configuration is done with the
systemd
configuration file
/lib/systemd/system/can0.service.
For a persistent change of the default bitrates change
the configuration in
meta-yogurt/recipes-core/systemd/systemd/can0.service
instead and
rebuild the root filesystem.
1
2
3
4
7
6
5
8
9