Skip to content

Commit 025901d

Browse files
nixwardcarlescufi
authored andcommitted
samples: drivers: CAN: Update to build cleanly for MCP2515 driver
Add alternate conf file for MCP2515 so it builds without warning. Update documentation. Signed-off-by: Nick Ward <[email protected]>
1 parent cbaa75d commit 025901d

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

boards/shields/dfrobot_can_bus_v2_0/doc/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ Zephyr application. For example:
122122
:tool: all
123123
:board: nrf52_pca10040
124124
:shield: dfrobot_can_bus_v2_0
125-
:goals: build
125+
:conf: prj.mcp2515.conf
126+
:goals: build flash
126127

127128
.. _DFRobot Website:
128129
https://www.dfrobot.com/product-1444.html

samples/drivers/CAN/README.rst

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,35 @@ Building and Running
1717
In loopback mode, the board receives its own messages. This could be used for
1818
standalone testing.
1919

20-
The sample can be built and executed on boards supporting CAN.
2120
The LED output pin is defined in the board's devicetree.
2221

22+
The sample can be built and executed for boards with a SoC that have an
23+
integrated CAN controller or for boards with a SoC that has been augmented
24+
with a stand alone CAN controller.
25+
26+
Integrated CAN controller
27+
=========================
28+
29+
For the NXP TWR-KE18F board:
30+
31+
.. zephyr-app-commands::
32+
:zephyr-app: samples/drivers/CAN
33+
:board: twr_ke18f
34+
:goals: build flash
35+
36+
Stand alone CAN controller
37+
==========================
38+
39+
For the nRF52_PCA10040 board combined with the DFRobot CAN bus V2.0 shield that
40+
provides the MCP2515 CAN controller:
41+
42+
.. zephyr-app-commands::
43+
:zephyr-app: samples/drivers/CAN
44+
:board: nrf52_pca10040
45+
:shield: dfrobot_can_bus_v2_0
46+
:conf: prj.mcp2515.conf
47+
:goals: build flash
48+
2349
Sample output
2450
=============
2551

samples/drivers/CAN/prj.mcp2515.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Alternate conf file required for building the CAN sample for the
2+
# MCP2515 stand alone CAN controller
3+
4+
CONFIG_CAN=y
5+
CONFIG_CAN_INIT_PRIORITY=80
6+
CONFIG_CAN_MCP2515_MAX_FILTER=5
7+
8+
CONFIG_SHELL=y
9+
CONFIG_CAN_SHELL=y
10+
CONFIG_DEVICE_SHELL=y

0 commit comments

Comments
 (0)