-
Notifications
You must be signed in to change notification settings - Fork 73
Desmakers 4347 4350 development instuctions env setup #330
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
Merged
LinjingZhang
merged 7 commits into
master
from
DESMAKERS-4347-4350-development-instuctions-env-setup
Mar 20, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
781433e
docs/: Add Development Instuctions in Documentation.
LinjingZhang ef63255
.gitignore: Update .gitignore for doc temp file.
LinjingZhang a9407c4
tools/dev-setup.sh: Disable core-api link in 3.x.
LinjingZhang 3ad2711
tests/README.md: Delete because of new documentation.
LinjingZhang 0c90ea4
docs/development_instructions.rst: Minor fixes.
ederjc 2b96b22
tools/dev-setup.sh: Delete since not needed for 3.x.
LinjingZhang 0d49e1b
docs/development_instructions.rst: Update regarding review comments.
LinjingZhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,14 @@ | ||
# Contributing to XMC for Arduino | ||
First important point: **All Contributions** are welcomed :open_hands:. | ||
|
||
Please contribute and raise issues via the [github repository](https://github.com/Infineon/XMC-for-Arduino/tree/master) | ||
Please contribute and raise issues via the [github repository](https://github.com/Infineon/XMC-for-Arduino/tree/master). | ||
|
||
## Overview for Contributors | ||
|
||
- Start your contribution by creating a [fork](https://github.com/Infineon/XMC-for-Arduino/fork) of this repository | ||
- It's recommended to create a separate branch for your contribution in your fork | ||
- Once your contribution is ready & tested, please create a [Pull Request](https://github.com/Infineon/XMC-for-Arduino/compare) to the master branch | ||
- Once we merged your changes to the master branch, they are automatically included in the next release | ||
- Start your contribution by creating a [fork](https://github.com/Infineon/XMC-for-Arduino/fork) of this repository. | ||
- It's recommended to create a separate branch for your contribution in your fork. | ||
- Once your contribution is ready & tested, please create a [Pull Request](https://github.com/Infineon/XMC-for-Arduino/compare) to the master branch. We have some automated tests, so make sure you've browsed our [CODE CONVENTION](CODE_CONVENTION.md) and [development instructions](https://xmc-arduino.readthedocs.io/en/latest/development-instructions.html) | ||
- Once we merged your changes to the master branch, they are automatically included in the next release. | ||
|
||
## Install the BSP under development (on Windows) | ||
Clone the repository in Arduino folder: | ||
- Open Arduino and install any version of this project as described [here](https://xmc-arduino.readthedocs.io/en/latest/installation-instructions.html). | ||
- Open the installation location in your Arduino program folder, e.g. | ||
`C:\Users\<username>\AppData\Local\Arduino15\packages\Infineon\hardware\xmc` | ||
- Open git bash, type command: | ||
`git clone <your-xmc-for-arduino-fork> <version>` | ||
|
||
This allows quick testing of local changes during development. | ||
|
||
[!TIP] | ||
If you encounter strange behavior with Arduino IDE during development, try cleaning up the cache: | ||
* Windows: `C:\User\"username"\AppData\Roaming\arduino-ide` | ||
* Linux: `~/.config/arduino-ide` | ||
* macOS: `~/Library/Application Support/arduino-ide/` | ||
|
||
## Automated Build Checks | ||
|
||
Currently a Github workflow is used for automatic compilation checking and releasing. Workflows are defined [here](https://github.com/Infineon/XMC-for-Arduino/tree/master/.github/workflows). | ||
Before opening a Pull Request for your contribution, please add a git tag in the format `Vx.y.z` (e.g. V3.3.0) to trigger the release process in your fork and pass the compilation tests. | ||
|
||
## Creating and Maintaining Third Party Libraries | ||
### Basics | ||
The Arduino IDE allows for external libraries to be added to support specific devices and functions which are not part of the core setup. For details on creating libraries see the | ||
[Arduino library specifications](https://arduino.github.io/arduino-cli/library-specification/). If you add additional libraries to this project, make sure to [document them](https://xmc-arduino.readthedocs.io/en/latest/builtin-libraries.html) accordingly. | ||
|
||
### XMC-for-Arduino Configuration | ||
To ensure that a library specific to one architecture or board type is only compiled when a supporting board is set up, this specification includes a setting for *architecture* in the *library.properties* file. | ||
|
||
When creating or maintaining third party or external libraries for XMC-for-Arduino please use this setting: | ||
~~~ | ||
architecture=xmc | ||
~~~ | ||
|
||
If your library also supports other boards and architectures, add those in as well. | ||
|
||
## Validation test | ||
To test the XMC4arduino, we used unity to test some of the features of the arduino core & builtin library. | ||
|
||
Tests are located in tests/arduino-core-tests and included as submodule in this project. Run `git submodule update --init --recursive` to update them. If you are nor familiar with submodules, check out: https://git-scm.com/book/en/v2/Git-Tools-Submodules | ||
|
||
## Code checks (WIP) | ||
Refer to libraries\CAN\Makefile.codecheck | ||
* Regarding formatting, we currently use [pre-commit](https://pre-commit.com/) to automatically run clang-formatting to format all c/c++ code. Please install this python package, and follow the quick start (the pre-commit configuration file is already there). You should be able to format your code automatically on git commit! | ||
## Development | ||
Please check [development instructions](https://xmc-arduino.readthedocs.io/en/latest/development-instructions.html) section in our documentation for more information on how to set up your development enviroment and start developing XMC4Arduino! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
Development Instructions | ||
========================= | ||
|
||
.. | ||
TODOS: | ||
- Code conventions | ||
- Tools installation: | ||
- test | ||
- doc | ||
- code check | ||
- ... | ||
|
||
.. _env_dev_setup: | ||
|
||
Environment Setup | ||
------------------ | ||
|
||
#. Pre-conditions: | ||
|
||
* Install `Arduino IDE (2.0 or higher) <https://docs.arduino.cc/software/ide-v2/tutorials/getting-started/ide-v2-downloading-and-installing/>`_ | ||
* Or Install `Arduino CLI (1.0.0 or higher) <https://arduino.github.io/arduino-cli/latest/installation/>`_ | ||
* Python | ||
|
||
#. Create a ``<SKETCHBOOK>/hardware/arduino-git`` folder. Where ``<SKETCHBOOK>`` is the location of your Arduino sketchbook. The ``<SKETCHBOOK>`` default is OS-dependent: | ||
|
||
.. tabs:: | ||
|
||
.. group-tab:: Linux | ||
|
||
:: | ||
|
||
{HOME}/Arduino | ||
|
||
.. group-tab:: Windows | ||
|
||
:: | ||
|
||
{DOCUMENTS}/Arduino | ||
|
||
.. group-tab:: MacOS | ||
|
||
:: | ||
|
||
{HOME}/Documents/Arduino | ||
|
||
|
||
#. Clone this repo in ``<SKETCHBOOK>/hardware/arduino-git``: | ||
:: | ||
|
||
git clone https://github.com/Infineon/XMC-for-Arduino.git xmc | ||
|
||
This allows quick testing of local changes during development while keeping the released version. | ||
|
||
#. You can check if the correct version is installed by running: | ||
:: | ||
|
||
arduino-cli core list | ||
|
||
You should be able to see the ``arduino-git:xmc core``. | ||
|
||
#. Update all submodule included in this project: | ||
:: | ||
|
||
git submodule update --init --recursive | ||
|
||
If you are not familiar with git submodules, check out `Git-Tools-Submodules <https://git-scm.com/book/en/v2/Git-Tools-Submodules>`_ | ||
|
||
#. Start developing |:tools:|! | ||
|
||
|:bell:| | ||
If you encounter strange behavior with Arduino IDE during development, try cleaning up the Arduino IDE's cache: | ||
|
||
.. tabs:: | ||
|
||
.. group-tab:: Windows | ||
|
||
.. code-block:: text | ||
|
||
%AppData%\arduino-ide | ||
|
||
.. group-tab:: Linux | ||
|
||
:: | ||
|
||
~/.config/arduino-ide | ||
|
||
.. group-tab:: macOS | ||
|
||
:: | ||
|
||
~/Library/Application Support/arduino-ide/ | ||
|
||
Code Check and Tests | ||
---------------------- | ||
|
||
Pre-commit Hooks | ||
^^^^^^^^^^^^^^^^^^ | ||
For the C/C++ code format and commit message format, we add git hooks to check it automatically. | ||
|
||
For ease of use, we currently use `pre-commit <https://pre-commit.com/>`_ to automatically run clang-formatting to format all C/C++ code. | ||
Please install this Python package, and follow the quick start (the pre-commit configuration file is already there). You should be able to format your code automatically on git commit. | ||
|
||
We also have workflow to for auto-checking, so please refer to code convention before committing your code. | ||
|
||
Code Check | ||
^^^^^^^^^^^^ | ||
.. warning:: | ||
|
||
Code Checks are still a work in progress in this project. | ||
|
||
If you are developing a new built-in library, please refer to ``libraries\CAN\Makefile.codecheck`` using cppcheck for static code analysis to ensure code quality. | ||
|
||
Automated Build Checks | ||
^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Currently a GitHub Action workflow is used for automatic compilation checking. | ||
Workflows are defined `here <https://github.com/Infineon/XMC-for-Arduino/blob/master/.github/workflows/compile-platform-examples.yml>`_. | ||
|
||
Validation Test | ||
^^^^^^^^^^^^^^^^ | ||
To validate the XMC-for-Arduino, we utilize Unity for testing various features of the Arduino core and built-in libraries. | ||
|
||
Tests are located in ``tests/arduino-core-tests`` and included as submodule in this project. Run ``git submodule update --init --recursive`` to update them. | ||
|
||
If you need to run these tests locally, you'll also need to download `GNU Make <https://www.gnu.org/software/make/#download>`_ . | ||
|
||
Release | ||
--------- | ||
Add a git tag in the format `Vx.y.z` (e.g. V3.3.0) to trigger the release process. | ||
|
||
|
||
Creating and Maintaining Third Party Libraries | ||
------------------------------------------------ | ||
Basics | ||
^^^^^^^^ | ||
The Arduino IDE allows for external libraries to be added to support specific devices and functions which are not part of the core setup. For details on creating libraries see the | ||
`Arduino library specification <https://arduino.github.io/arduino-cli/library-specification/>`_. | ||
|
||
If you add additional libraries to this project, make sure to `document them <https://xmc-arduino.readthedocs.io/en/latest/builtin-libraries.html>`_ accordingly. | ||
|
||
XMC-for-Arduino Configuration | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
To ensure that a library specific to one architecture or board type is only compiled when a supporting board is set up, this specification includes a setting for *architecture* in the *library.properties* file. | ||
|
||
When creating or maintaining third party or external libraries for XMC-for-Arduino please use this setting: | ||
|
||
.. code-block:: text | ||
|
||
architecture=xmc | ||
|
||
If your library also supports other boards and architectures, add those in as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which Python package? 😄