Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions boards/shields/canis_canpico/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2025 Steve Boylan
# SPDX-License-Identifier: Apache-2.0

config SHIELD_CANIS_CANPICO
def_bool $(shields_list_contains,canis_canpico)
44 changes: 44 additions & 0 deletions boards/shields/canis_canpico/canis_canpico.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2025 Steve Boylan
*
* SPDX-License-Identifier: Apache-2.0
*/

&pico_spi {
status = "okay";
cs-gpios = <&pico_header 6 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&spi1_canpico>;
pinctrl-names = "default";

mcp251xfd_canis_canpico: can@0 {
compatible = "microchip,mcp251xfd";
spi-max-frequency = <1000000>;
int-gpios = <&pico_header 5 GPIO_ACTIVE_LOW>;
status = "okay";
reg = <0x0>;
osc-freq = <16000000>;

can-transceiver {
max-bitrate = <1000000>;
};
};
};

&pinctrl {
spi1_canpico: spi1_canpico {
group1 {
pinmux = <SPI1_SCK_P10>, <SPI1_TX_P11>;
};

group2 {
pinmux = <SPI1_RX_P8>;
input-enable;
};
};
};

/ {
chosen {
zephyr,canbus = &mcp251xfd_canis_canpico;
};
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
165 changes: 165 additions & 0 deletions boards/shields/canis_canpico/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
.. _canis_canpico:

Canis Labs CANPico Shield
#########################

Overview
********

The Canis Labs CANPico shield supports the Microchip MCP2517FD or MCP2518FD
stand-alone CAN controller and Microchip MCP2562FD high-speed CAN FD
transceiver. The CANPico is a carrier board in a ‘sock’ format for a
Raspberry Pi Pico family.

.. figure:: canis_canpico.webp
:align: center
:alt: Canis_Labs_CANPico_SHIELD

Hardware
********

- MCP2517/2518FD

- External CAN FD Controller with Serial Peripheral Interface (SPI)
- Arbitration Bit Rate up to 1 Mbps
- Data Bit Rate up to 8 Mbps
- CAN FD Controller modes: CAN 2.0B Mode or Mixed CAN 2.0B and CAN FD Mode
- Conforms to ISO 11898-1:2015

- MCP2562FD

- Optimized for CAN FD (Flexible Data rate) at 2, 5 and 8 Mbps Operation
- Maximum Propagation Delay: 120 ns
- Implements ISO-11898-2 and ISO-11898-5 Standard Physical Layer Requirements
- Very Low Standby Current (5 µA, typical)
- VIO Supply Pin to Interface Directly to CAN Controllers and Microcontrollers with 1.8V to 5.5V I/O

- Connectivity

- Jumper header to enable a 120W CAN bus termination resistor
- Jumper header to enable the CAN TX line to the transceiver
- Screw terminal connector to CAN bus
- CAN controller interrupt and Start-of-Frame inputs to GPIO pins
- Direct access via GPIO pins to the CAN transceiver Tx and Rx pins
- Test instrument header (for an oscilloscope or logic analyzer)

+-------+-----------------------+---------------------------+
| Name | Function | Usage |
+=======+=======================+===========================+
| GP0 | None | |
+-------+-----------------------+---------------------------+
| GP1 | None | |
+-------+-----------------------+---------------------------+
| GP2 | TRIG | Programmable trigger |
+-------+-----------------------+---------------------------+
| GP3 | STBY | Transceiver standby |
+-------+-----------------------+---------------------------+
| GP4 | SOF | Clock/SOF |
+-------+-----------------------+---------------------------+
| GP5 | IRQ | Transceiver interrupt |
+-------+-----------------------+---------------------------+
| GP6 | None | SPI CS |
+-------+-----------------------+---------------------------+
| GP7 | None | |
+-------+-----------------------+---------------------------+
| GP8 | SPI1_Rx | SPI Rx |
+-------+-----------------------+---------------------------+
| GP9 | None | |
+-------+-----------------------+---------------------------+
| GP10 | SPI1_SCK | SPI clock |
+-------+-----------------------+---------------------------+
| GP11 | SPI1_Tx | SPI Tx |
+-------+-----------------------+---------------------------+
| GP12 | None | |
+-------+-----------------------+---------------------------+
| GP13 | None | |
+-------+-----------------------+---------------------------+
| GP14 | None | |
+-------+-----------------------+---------------------------+
| GP15 | None | |
+-------+-----------------------+---------------------------+
| GP16 | None | |
+-------+-----------------------+---------------------------+
| GP17 | None | |
+-------+-----------------------+---------------------------+
| GP18 | None | |
+-------+-----------------------+---------------------------+
| GP19 | None | |
+-------+-----------------------+---------------------------+
| GP20 | None | |
+-------+-----------------------+---------------------------+
| GP21 | Rx | CAN Rx data |
+-------+-----------------------+---------------------------+
| GP22 | Tx | CAN Tx data |
+-------+-----------------------+---------------------------+
| GP23 | None | |
+-------+-----------------------+---------------------------+
| GP24 | None | |
+-------+-----------------------+---------------------------+
| GP25 | None | |
+-------+-----------------------+---------------------------+
| GP26 | None | |
+-------+-----------------------+---------------------------+
| GP27 | None | |
+-------+-----------------------+---------------------------+
| GP28 | None | |
+-------+-----------------------+---------------------------+

- Test header

- TRIG: Programmable trigger output
- Tx: Logic-level CAN Tx data
- Rx: Logic-level CAN Rx data
- H: Raw CAN-Hi signal
- L: Raw CAN-Low signal

- Power Supply

- 3.3V ~ 5V

- Components

- Tx Enable jumper
- 120 ohm terminator jumper

For more information about the Canis Labs CANPico shield:

- `Canis Labs Website`_
- `CANPico CAN Bus Shield`_
- `MCP2517FD Datasheet`_
- `MCP2518FD Datasheet`_
- `MCP2562FD Datasheet`_

Programming
***********

Set ``--shield canis-canpico`` when you invoke ``west build`` or ``cmake``
in your Zephyr application. For example:

.. zephyr-app-commands::
:zephyr-app: samples/drivers/can/counter
:tool: all
:board: rpi_pico
:shield: canpico
:goals: build flash

.. _Canis Labs Website:
https://canislabs.com/

.. _CANPico CAN Bus Shield:
https://canislabs.com/canpico/

.. _MCP2517FD:
https://www.microchip.com/en-us/product/MCP2518FD

.. _MCP2517FD Datasheet:
https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/MCP2517FD-External-CAN-FD-Controller-with-SPI-Interface-20005688B.pdf

.. _MCP2518FD:
https://www.microchip.com/en-us/product/MCP2518FD

.. _MCP2518FD Datasheet:
https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/External-CAN-FD-Controller-with-SPI-Interface-DS20006027B.pdf

.. _MCP2562FD Datasheet:
https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/20005284A.pdf
6 changes: 6 additions & 0 deletions boards/shields/canis_canpico/shield.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
shields:
- name: canis_canpico
full_name: Canis Labs CANPico
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
full_name: Canis Labs CANPico
full_name: CANPico

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That change is not consistent with other shields. A selection:

./sparkfun_sara_r4/shield.yml:  full_name: Sparkfun Sara R4
./waveshare_epaper/shield.yml:    full_name: WAVESHARE e-Paper GDEH029A1
./st_b_cams_omv_mb1683/shield.yml:  full_name: ST B-CAMS-OMV MB1683 Camera Shield
./adafruit_vcnl4040/shield.yml:  full_name: Adafruit VCNL4040 Proximity and Lux Sensor Shield
./rk043fn02h_ct/shield.yml:  full_name: RK043FN02H-CT 4.3" LCD Panel
./mikroe_eth3_click/shield.yml:  full_name: ETH3 Click
./lmp90100_evb/shield.yml:  full_name: LMP90100 Sensor AFE Evaluation Board
./nrf7002ek/shield.yml:    full_name: nRF7002 Evaluation Kit Shield
./npm6001_ek/shield.yml:  full_name: nPM6001 EK
./x_nucleo_iks02a1/shield.yml:    full_name: X-NUCLEO-IKS02A1 (Standard / Mode 1)
./arduino_modulino_thermo/shield.yml:  full_name: Arduino Modulino Thermo

Do you insist on this change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ThreeEights
If i need to fight or insist for every request change I think you can agree that this will quickly become exhausting.

Most shields (and boards for that matter) do not have vendor in their name. When they do, it's typically because that's the official / most prominent product name one would find on vendor website, or e.g. in the top results in their favourite search engine.
See e.g. https://www.adafruit.com/product/4161?srsltid=AfmBOooXOsEAM1UFkhs34iq4Nq9wEXZHGZqhDfg3-VhPQAMyL8Xm6Pwm, https://www.sparkfun.com/sparkfun-micromod-asset-tracker-carrier-board.html. Sometiemes it's also to help disambiguate synonyms.

In the case of CANPico, I think you can safely get rid of it but I certainly don't want to spend another 10 minutes justifying my choice or "insisting" for you to agree to apply it :|

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I also took the liberty to make that comment because I knew you were coming back to this PR anyway. Not sure I understand the rationale of not applying the change while you were there fixing the image file name but oh well :|
Thanks for the PR anyway, this is really cool to see so many new shields added in this release :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kartben - Please have pity on us poor mortals who don't live and breathe Zephyr. I'm not trying to create problems or extra work for anyone here. Try to understand how frustrating this week has been for me: First was the problem with the image. After I corrected it, I was asked to replace it. Alas, I'd not heard of the webp format; asking around our team, two people had heard of it but not used it. Now I've learned that it's the cat's pajamas, the bee's knees, and seems to be the preferred format for Zephyr in the future.

Then came the request to reorganize the files to focus only on the CANPico. I had originally followed the time-honored practice of copying the existing structure for the mcp2815 shields, assuming it would be nice to accommodate other products based on the newer chips. But, of course, pointing that out did not change the opinions of the reviewers.

Now this latest request, which appears to me to be incorrect. I failed to follow your explanation in this case; the two specific examples you mention seem to contradict your explanation:

sparkfun_carrier_asset_tracker/shield.yml:  full_name: SparkFun MicroMod Asset Tracker Shield
adafruit_vcnl4040/shield.yml:  full_name: Adafruit VCNL4040 Proximity and Lux Sensor Shield

I don't want to waste any more of your time, but please let me know if the current full_name might possibly be acceptable, or can you enlighten me further so my future pull requests will meet the high standards expected for contributions to Zephyr?

And thank you for investing so much effort on this one little piece of this grand edifice!

Steve

vendor: canis
supported_features:
- can
1 change: 1 addition & 0 deletions dts/bindings/vendor-prefixes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Device tree binding vendor prefix registry. Keep this list in

Check warning on line 1 in dts/bindings/vendor-prefixes.txt

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

Copyright missing

dts/bindings/vendor-prefixes.txt:1 File has no SPDX-FileCopyrightText header, consider adding one.

Check warning on line 1 in dts/bindings/vendor-prefixes.txt

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

License missing

dts/bindings/vendor-prefixes.txt:1 File has no SPDX-License-Identifier header, consider adding one.
# alphabetical order.
#
# This isn't an exhaustive list, but you should add new prefixes to it
Expand Down Expand Up @@ -122,6 +122,7 @@
calxeda Calxeda
canaan Canaan, Inc.
caninos Caninos Loucos Program
canis Canis Automotive Labs
capella Capella Microsystems, Inc
cascoda Cascoda, Ltd.
catalyst Catalyst Semiconductor, Inc.
Expand Down
Loading