Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: use intersphinx for linking to Zephyr documentation #79

Merged
Merged
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
22 changes: 7 additions & 15 deletions doc/building.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
..
Copyright (c) 2024 Henrik Brix Andersen <[email protected]>
Copyright (c) 2024-2025 Henrik Brix Andersen <[email protected]>
SPDX-License-Identifier: CC-BY-4.0

:hide-toc:
Expand All @@ -8,7 +8,7 @@ Building and Running
====================

Building the CANnectivity firmware requires a proper Zephyr development environment. Follow the
official `Zephyr Getting Started Guide`_ to establish one.
official Zephyr :external+zephyr:ref:`Getting Started Guide <getting_started>` to establish one.

Once a proper Zephyr development environment is established, inialize the workspace folder (here
``my-workspace``). This will clone the CANnectivity firmware repository and download the necessary
Expand Down Expand Up @@ -44,11 +44,12 @@ After building, the firmware can be flashed to the board by running the ``west f
USB Device Firmware Upgrade (DFU) Mode
--------------------------------------

CANnectivity supports USB Device Firmware Upgrade (`DFU`_) via the `MCUboot`_ bootloader. This is
intended for use with boards without an on-board programmer.
CANnectivity supports USB :external+zephyr:ref:`Device Firmware Upgrade <dfu>` (DFU) via the
`MCUboot`_ bootloader. This is intended for use with boards without an on-board programmer.

To build CANnectivity with MCUboot integration for USB DFU use `sysbuild`_ with the
``sysbuild-dfu.conf`` configuration file when building for your board (here ``frdm_k64f``):
To build CANnectivity with MCUboot integration for USB DFU use :external+zephyr:ref:`sysbuild
<sysbuild>` with the ``sysbuild-dfu.conf`` configuration file when building for your board (here
``frdm_k64f``):

.. code-block:: console

Expand All @@ -71,17 +72,8 @@ Once in DFU mode, the CANnectivity firmware can be updated using

dfu-util -a 1 -D build/app/zephyr/zephyr.signed.bin.dfu

.. _Zephyr Getting Started Guide:
https://docs.zephyrproject.org/latest/getting_started/index.html

.. _DFU:
https://docs.zephyrproject.org/latest/services/device_mgmt/dfu.html

.. _MCUboot:
https://www.trustedfirmware.org/projects/mcuboot/

.. _sysbuild:
https://docs.zephyrproject.org/latest/build/sysbuild/index.html

.. _dfu-util:
https://dfu-util.sourceforge.net/
5 changes: 4 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024 Henrik Brix Andersen <[email protected]>
# Copyright (c) 2024-2025 Henrik Brix Andersen <[email protected]>
# SPDX-License-Identifier: Apache-2.0
#
# Configuration file for the Sphinx documentation builder
Expand All @@ -14,10 +14,13 @@
extensions = [
'sphinx_copybutton',
'sphinx.ext.githubpages',
'sphinx.ext.intersphinx',
]

exclude_patterns = ['build', 'Thumbs.db', '.DS_Store']

intersphinx_mapping = {'zephyr': ('https://docs.zephyrproject.org/latest/', None)}

html_baseurl = 'https://cannectivity.org/'
html_title = 'CANnectivity USB to CAN adapter firmware'
html_logo = 'static/CANnectivity.png'
Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
..
Copyright (c) 2024 Henrik Brix Andersen <[email protected]>
Copyright (c) 2024-2025 Henrik Brix Andersen <[email protected]>
SPDX-License-Identifier: CC-BY-4.0

:hide-toc:
Expand Down
10 changes: 4 additions & 6 deletions doc/module.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
..
Copyright (c) 2024 Henrik Brix Andersen <[email protected]>
Copyright (c) 2024-2025 Henrik Brix Andersen <[email protected]>
SPDX-License-Identifier: CC-BY-4.0

:hide-toc:

Zephyr Module
=============

The CANnectivity firmware repository is a `Zephyr module`_ which allows for reuse of its components
(i.e. the ``gs_usb`` protocol implementation) outside of the CANnectivity firmware application.
The CANnectivity firmware repository is a :external+zephyr:ref:`Zephyr module <modules>` which
allows for reuse of its components (i.e. the ``gs_usb`` protocol implementation) outside of the
CANnectivity firmware application.

To pull in CANnectivity as a Zephyr module, either add it as a West project in the ``west.yaml``
file or pull it in by adding a submanifest (e.g. ``zephyr/submanifests/cannectivity.yaml``) file
Expand All @@ -22,6 +23,3 @@ with the following content and run ``west update``:
url: https://github.com/CANnectivity/cannectivity.git
revision: main
path: custom/cannectivity # adjust the path as needed

.. _Zephyr module:
https://docs.zephyrproject.org/latest/develop/modules.html
25 changes: 9 additions & 16 deletions doc/porting.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
..
Copyright (c) 2024 Henrik Brix Andersen <[email protected]>
Copyright (c) 2024-2025 Henrik Brix Andersen <[email protected]>
SPDX-License-Identifier: CC-BY-4.0

:hide-toc:
Expand All @@ -14,27 +14,20 @@ Since the CANnectivity firmware is based on the Zephyr RTOS, it requires Zephyr
board it is to run on. The board configuration must support both an USB device driver and at least
one CAN controller.

Check the list of `supported boards`_ in the Zephyr documentation to see if your board is already
supported. If not, have a look at the instructions in the `board porting guide`_.
Check the list of :external+zephyr:ref:`supported boards <boards>` in the Zephyr documentation to
see if your board is already supported. If not, have a look at the instructions in the Zephyr
:external+zephyr:ref:`Board Porting Guide <board_porting_guide>`.

Board Configuration
-------------------

By default, CANnectivity relies on the `devicetree`_ ``zephyr,canbus`` chosen node property for
specifying the CAN controller to use. If a devicetree alias for ``led0`` is present, it is used as
status LED. This means that virtually any Zephyr board configuration supporting USB device, a CAN
controller, and an optional user LED will work without any further configuration.
By default, CANnectivity relies on the :external+zephyr:ref:`devicetree <devicetree>`
``zephyr,canbus`` chosen node property for specifying the CAN controller to use. If a devicetree
alias for ``led0`` is present, it is used as status LED. This means that virtually any Zephyr board
configuration supporting USB device, a CAN controller, and an optional user LED will work without
any further configuration.

Advanced board configuration (e.g. multiple CAN controllers, multiple LEDs, hardware timestamp
counter) is also supported via devicetree overlays. Check the description for the ``cannectivity``
devicetree binding ``app/dts/bindings/cannectivity.yaml`` and the example devicetree overlays under
``app/boards/``.

.. _supported boards:
https://docs.zephyrproject.org/latest/boards/index.html

.. _board porting guide:
https://docs.zephyrproject.org/latest/hardware/porting/board_porting.html

.. _devicetree:
https://docs.zephyrproject.org/latest/build/dts/index.html