Skip to content

Commit 7ec0597

Browse files
authored
Merge pull request #65 from chargebyte/everest/charge_control_c_for_release_2025.8.0
Charge Control C: factor our EVerest cross-compiling and fix upstream URLs
2 parents aa0116f + 91bab65 commit 7ec0597

File tree

6 files changed

+28
-157
lines changed

6 files changed

+28
-157
lines changed

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
sphinx==7.3.7
22
sphinx-copybutton
3+
sphinx-jinja2
34
linuxdoc

docs/source/conf.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,28 @@
1313
# -- General configuration ---------------------------------------------------
1414
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
1515

16-
extensions = ['linuxdoc.rstFlatTable', 'sphinx_copybutton']
16+
extensions = ['linuxdoc.rstFlatTable', 'sphinx_copybutton', 'sphinx_jinja2']
1717

18-
templates_path = ['_templates']
18+
templates_path = ['_templates', '../../includes/_templates']
1919
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
2020

2121
numfig = True
2222

23+
jinja2_contexts = {
24+
'target-info': {
25+
'PLATFORM_NAME': 'Charge Control C',
26+
'MACHINE': 'tarragon',
27+
'APT_CROSS_MACHINE_SPECIFIC': 'gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf',
28+
'MACHINE_FILE_SIGNATURE': 'ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=cf7fc6ab427435ba5e30254eb234e3dba5fad685, for GNU/Linux 3.2.0, stripped'
29+
},
30+
}
31+
2332
# -- Options for HTML output -------------------------------------------------
2433
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
2534

2635
html_title = project
2736
html_theme = 'classic'
28-
html_static_path = ['_static']
37+
html_static_path = ['_static', '../../includes/_static']
2938
html_logo = '_static/cb_logo.png'
3039
html_css_files = [
3140
'css/cb_theme.css',

docs/source/development.rst

Lines changed: 4 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,152 +1,12 @@
11
.. _development.rst:
22

3-
.. include:: ../../includes/development.inc
3+
.. include:: ../../includes/development_intro.inc
44

5-
.. _cross_compiling:
5+
.. _development_cross_compiling_everest_modules:
66

7-
Cross-compilation of EVerest modules
8-
====================================
9-
10-
Cross-compilation is the fastest and most convenient way to test your own modules directly on the target system during development.
11-
The cross-compiled project can then either be transferred directly via FTP to the charge controller or
12-
integrated into a firmware image and installed on the target using the `rauc` command.
13-
14-
The following steps describe how to cross-compile a module for the Tarragon platform.
15-
16-
#. On an Ubuntu or Debian-based Linux distribution, install the cross-compilers for Tarragon:
17-
18-
.. code-block:: console
19-
20-
sudo apt install build-essential libc6-armhf-cross libc6-dev-armhf-cross binutils-arm-linux-gnueabihf gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
21-
22-
#. Download chargebyte's `digital certificate <https://chargebyte.com/controllers-and-modules/evse-controllers/charge-control-c#downloads>`_
23-
and use it to extract the root filesystem from the firmware image:
24-
25-
.. code-block:: console
26-
27-
rauc extract --keyring=<chargebyte_certificate>.crt <shipped_firmware>.image bundle-staging
28-
29-
.. note::
30-
Alternatively, if the above command does not work, you can use the following command:
31-
32-
.. code-block:: console
33-
34-
unsquashfs -d bundle-staging <shipped_firmware>.image
35-
36-
However, this will not verify the signature of the firmware image.
37-
38-
#. Mount the extracted ext4 root filesystem image as a loop device:
39-
40-
.. code-block:: console
41-
42-
sudo mkdir -p /mnt/rootfs
43-
sudo mount bundle-staging/core-image-minimal-tarragon.ext4 /mnt/rootfs
44-
45-
#. Create a new directory in your `everest-workspace` directory (in parallel to the `everest-core` directory) and
46-
create a new file named :code:`toolchain.cmake`:
47-
48-
.. code-block:: console
49-
50-
cd everest-workspace
51-
mkdir toolchain
52-
cd toolchain
53-
touch toolchain.cmake
54-
cd ..
55-
56-
#. The resulting directory structure should look like this:
57-
58-
.. code-block:: console
59-
60-
everest-workspace/
61-
|── {MyEVerestModule}
62-
├── everest-core
63-
└── toolchain
64-
└── toolchain.cmake
65-
66-
#. Save the following content in the :code:`toolchain.cmake` file:
67-
68-
.. literalinclude:: ../../includes/_static/files/toolchain.cmake
69-
70-
#. Create a new :code:`build_tarragon` directory in the EVerest project directory (e.g. within your own EVerest
71-
module project directory or :code:`everest-core` if you want to build the everest-core modules):
72-
73-
.. code-block:: console
74-
75-
cd {MyEVerestModule}
76-
mkdir build_tarragon
77-
cd build_tarragon
78-
79-
#. Run the following command inside the `build_tarragon` directory to configure the build:
80-
81-
.. code-block:: console
82-
83-
cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchain/toolchain.cmake -DCMAKE_SYSROOT=/mnt/rootfs ..
84-
85-
#. When this completes successfully, start cross-compiling using :code:`make`:
86-
87-
.. code-block:: console
88-
89-
make install -j$(nproc)
90-
91-
#. If the build was successful, a dist directory will be created with the cross-compiled binaries and
92-
the manifest files of the modules. Please check if the following directory structure was created:
93-
94-
.. code-block:: console
95-
96-
dist/
97-
└── libexec
98-
└── everest
99-
└── modules
100-
└── {MyEVerestModule}
101-
├── {MyEVerestModule} (binary)
102-
└── manifest.yaml (manifest file)
103-
104-
#. Verify that the resulting binaries were compiled for the Tarragon target platform:
105-
106-
.. code-block:: console
107-
108-
file dist/libexec/everest/modules/{MyEVerestModule}/{MyEVerestModule}
109-
110-
The output should be something like:
111-
112-
.. code-block:: console
113-
114-
dist/libexec/everest/modules/{MyEVerestModule}/{MyEVerestModule}: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV),
115-
dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=9f287c2dbdcacd9ecde770df4820de9218deb439, for GNU/Linux 3.2.0, stripped
116-
117-
The resulting binary and manifest can be found in the :code:`dist/libexec/everest/modules/{MyEVerestModule}`
118-
directory. If you want to test the module on the target system, you can copy the module directory using
119-
:code:`scp` or :code:`rsync`:
120-
121-
.. code-block:: console
122-
123-
scp -r dist/libexec/everest/modules/{MyEVerestModule} root@<ip_address>:/usr/libexec/everest/modules/
124-
125-
To include the new module in a firmware image, copy the module directory into the mounted root filesystem:
126-
127-
.. code-block:: console
128-
129-
sudo cp -av dist/libexec/everest/modules/{MyEVerestModule} /mnt/rootfs/usr/libexec/everest/modules/
130-
131-
#. Unmount the loop device:
132-
133-
.. code-block:: console
134-
135-
sudo umount /mnt/rootfs
136-
137-
#. Ensure that the modified filesystem is in a clean state:
138-
139-
.. code-block:: console
140-
141-
fsck.ext4 -f bundle-staging/core-image-minimal-tarragon.ext4
142-
143-
Follow the steps under the section :ref:`firmware_customization` to install your PKI certificate, repackage
144-
the modified root filesystem into a firmware update image, and test the new firmware.
145-
146-
.. _creating_fw_images:
7+
.. jinja:: target-info
8+
:file: ../../includes/_templates/development_cross_compiling_everest_modules.rst.j2
1479

14810
.. include:: ../../includes/development_creating_fw_images.inc
14911

150-
.. _debugging_and_logging:
151-
15212
.. include:: ../../includes/development_debugging_and_logging.inc

docs/source/everest_charging_stack.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ phase-count switching in general:
147147
The EnergyManager module has also additional configuration options to allow fine-tuning of the behavior, but
148148
all ship with reasonable default values and thus are not explained in detail here.
149149
A description of all these parameters can be found in the
150-
`EnergyManager manifest <https://github.com/EVerest/everest-core/blob/main/modules/EnergyManager/manifest.yaml>`_.
150+
`EnergyManager manifest <https://github.com/EVerest/everest-core/blob/main/modules/EnergyManagement/EnergyManager/manifest.yaml>`_.
151151

152152
And also the 'EvseManager' module allows fine-tuning the switching process with two configuration parameters:
153153

@@ -159,7 +159,7 @@ And also the 'EvseManager' module allows fine-tuning the switching process with
159159
of 'X1' should work with all cars and thus it's recommended to leave it on this default value.
160160

161161
The full description of all these parameters can be found in the
162-
`EvseManager manifest <https://github.com/EVerest/everest-core/blob/main/modules/EvseManager/manifest.yaml>`_.
162+
`EvseManager manifest <https://github.com/EVerest/everest-core/blob/main/modules/EVSE/EvseManager/manifest.yaml>`_.
163163

164164
.. note::
165165
Phase count switching is only possible in basic charging mode.

docs/source/troubleshooting.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ USB adapter, e.g. `Peak System <https://www.peak-system.com/>`_.
3434
I want to control EVerest via CAN, how can I achieve this?
3535
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3636

37-
Currently there is no such EVerest module available, you will need to implement it on your own. But
38-
at least there is a `module <https://github.com/EVerest/everest-core/tree/main/modules/DPM1000>`_
39-
and a `library <https://github.com/EVerest/everest-core/tree/main/lib/staging/can_dpm1000>`_,
40-
which uses the CAN interface.
37+
Currently there is no such EVerest module available, you will need to implement it on your own.
38+
39+
But at least there is are `DC power supply modules <https://github.com/EVerest/everest-core/tree/main/modules/HardwareDrivers/PowerSupplies>`_
40+
and a `library <https://github.com/EVerest/everest-core/tree/main/lib/everest/can_dpm1000>`_,
41+
which uses the CAN interface. This might help as a starting point.
4142

4243

4344
Is it possible to upgrade the firmware from proprietary stack to EVerest and vice versa?
@@ -74,7 +75,7 @@ How do I set up OCPP 2.0.1 on Charge Control C with EVerest?
7475
To support OCPP 2.0.1, the EVerest OCPP201 module must be integrated into the EVerest configuration.
7576
This module uses the `libocpp library <https://github.com/EVerest/libocpp>`_ to implement the OCPP 2.0.1
7677
protocol.
77-
The `OCPP201 module documentation <https://github.com/EVerest/everest-core/blob/main/modules/OCPP201/doc.rst>`_
78+
The `OCPP201 module documentation <https://github.com/EVerest/everest-core/blob/main/modules/EVSE/OCPP201/doc.rst>`_
7879
already contains some information about the module parameters, the provided and required interfaces,
7980
and the initial creation of the OCPP 2.0.1 database.
8081

@@ -95,8 +96,8 @@ The most important points are summarised here:
9596
5. The OCPP 2.0.1 device model initialization is done automatically by the OCPP201 module after the
9697
first start of EVerest. The database is stored the `DeviceModelDatabasePath`.
9798
6. The component config files are stored in the `DeviceModelConfigPath`. Component config files are
98-
used to initialize or update the device model database. To update a component config file, just the
99-
place a `component config file <https://github.com/EVerest/libocpp/tree/v0.16.2/config/v201/component_config>`_
99+
used to initialize or update the device model database. To update a component config file, just
100+
place a `component config file <https://github.com/EVerest/libocpp/tree/main/config/v2/component_config>`_
100101
in the same directory structure in the DeviceModelConfigPath and change the values accordingly.
101102
Important keys of the component config files are:
102103

0 commit comments

Comments
 (0)