Skip to content

Commit c782a5b

Browse files
authored
Merge develop into main (#880)
In anticipation of v0257 release
2 parents 7839c6c + fbb36f8 commit c782a5b

File tree

800 files changed

+198867
-47850
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

800 files changed

+198867
-47850
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ tmp/
4242
*.axf
4343
*.S19
4444
*.bin
45+
*.hex
4546
*.dep
4647
*.FLM
4748

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
[![DAPLink](/docs/images/daplink-website-logo-link.png)](https://armmbed.github.io/DAPLink/)
21

3-
# Warning: Development frozen on `main` branch
2+
[![DAPLink](/docs/images/daplink-website-logo-link.png)](https://daplink.io/)
43

5-
All development and pull requests should now happen on [`develop`](https://github.com/ARMmbed/DAPLink/tree/develop) branch where we are preparing the next version.
6-
7-
**Note:** The `main` branch requires an Arm Compiler 5 or Keil MDK license to build. See the
8-
[`develop`](https://github.com/ARMmbed/DAPLink/tree/develop) branch for gcc and Arm
9-
Compiler 6 support. As soon as testing is complete, gcc will become the default compiler and AC5 support will be
10-
dropped.
4+
[![Linux Build (develop)](https://github.com/ARMmbed/DAPLink/actions/workflows/linux.yml/badge.svg?branch=develop)](https://github.com/ARMmbed/DAPLink/actions/workflows/linux.yml)
115

126
----
137

@@ -25,12 +19,18 @@ For more detailed usability information [see the users guide.](docs/USERS-GUIDE.
2519

2620
## Compatibility
2721
There are many ARM microcontroller-based Hardware Interface Circuits (HICs) that DAPLink interface firmware runs on. These can be found as standalone boards (debugger) or as part of a development kit. Some branded circuits that are known to be IO compatible are:
28-
* [NXP OpenSDA based on K20, K22 and KL26](http://www.nxp.com/products/software-and-tools/run-time-software/kinetis-software-and-tools/ides-for-kinetis-mcus/opensda-serial-and-debug-adapter:OPENSDA)
22+
23+
* [Maxim Integrated MAX32625PICO based on MAX32625](https://www.maximintegrated.com/en/products/microcontrollers/MAX32625PICO.html)
24+
* Nuvoton Nu-Link2-Me based on M48SSIDAE
2925
* [NXP LPC-Link2 based on LPC11U35 or LPC4322](https://www.nxp.com/support/developer-resources/hardware-development-tools/lpcxpresso-boards:LPCXPRESSO-BOARDS)
26+
* [NXP MCU-LINK on LPC55xx](https://www.nxp.com/design/microcontrollers-developer-resources/mcu-link-debug-probe:MCU-LINK)
27+
* [NXP OpenSDA based on K20, K22, KL26Z and KL27Z](http://www.nxp.com/products/software-and-tools/run-time-software/kinetis-software-and-tools/ides-for-kinetis-mcus/opensda-serial-and-debug-adapter:OPENSDA)
3028
* [Segger J-Link OB based on Atmel SAM3U](https://www.segger.com/products/debug-probes/j-link/models/j-link-ob/)
29+
* [STMicroelectronics ST-LINK/V2 (on NUCLEO boards) based on STM32F103CB](https://www.st.com/en/evaluation-tools/stm32-nucleo-boards.html)
30+
3131

3232
## Releases
33-
There are many board builds (board = HIC + target combination) created from this repository. Quarterly releases will contain new features and bugfixes. Standalone bugfixes are released once reported, verified and fixed. Both quarterly and bugfix releases will result in the build number being incremented. Many development kits and products ship with DAPLink interface firmware or are capable of running DAPLink firmware. **[The current release builds and instructions for updating DAPLink interface firmware is hosted on the DAPLink release site.](https://armmbed.github.io/DAPLink/)** Release notes and previous release builds can be found under GitHub releases.
33+
There are many board builds (board = HIC + target combination) created from this repository. Quarterly releases will contain new features and bugfixes. Standalone bugfixes are released once reported, verified and fixed. Both quarterly and bugfix releases will result in the build number being incremented. Many development kits and products ship with DAPLink interface firmware or are capable of running DAPLink firmware. **[The current release builds and instructions for updating DAPLink interface firmware is hosted on the DAPLink release site.](https://daplink.io/)** Release notes and previous release builds can be found under GitHub releases.
3434

3535
## Contribute
3636

docs/DEVELOPERS-GUIDE.md

Lines changed: 66 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# DAPLink Developers Guide
22

33
## Setup
4-
DAPLink sources can be compiled using Keil MDK-ARM or mbed cli tool with arm compiler, which could be run both on Linux and Windows. See [here](AUTOMATED_TESTS.md) for test instructions on both OS and Mac.
4+
5+
DAPLink sources are compiled using `progen` (from [project-generator](https://github.com/project-generator/project_generator)) which can be run on Linux, MacOS and Windows.
56

67
Install the necessary tools listed below. Skip any step where a compatible tool already exists.
78

8-
* Install [Python 2, 2.7.11 or above](https://www.python.org/downloads/) . Add to PATH.
9+
* Install [Python 3](https://www.python.org/downloads/) . Add to PATH.
910
* Install [Git](https://git-scm.com/downloads) . Add to PATH.
10-
* Install [Keil MDK-ARM](https://www.keil.com/download/product/), preferably version 5. Set environment variable "UV4" to
11-
the absolute path of the UV4 executable if you don't install to the default location. Note that "UV4" is what's used for
12-
both MDK versions 4 and 5. This step can be skipped if you plan to use mbed cli, but you still need Arm Compiler 5, and
13-
MDK is required to debug.
11+
* Install a compiler:
12+
* [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) . This compiler will be identified as `gcc_arm`.
13+
* [Arm Compiler 6](https://developer.arm.com/tools-and-software/embedded/arm-compiler) . This compiler will be identified as `armclang`. Only supported on Linux and Windows.
14+
* [Keil MDK](https://developer.arm.com/tools-and-software/embedded/keil-mdk) or [Arm Compiler 5](https://developer.arm.com/tools-and-software/embedded/arm-compiler/downloads/legacy-compilers#arm-compiler-5). This compiler will be identified as `armcc`. Only supported on Linux and Windows.
15+
* Install `make` (tested with [GNU Make](https://www.gnu.org/software/make)). [CMake](https://cmake.org) can alternatively be used in conjunction with different implementations of `make` as well as [ninja](https://ninja-build.org).
1416
* Install virtualenv in your global Python installation eg: `pip install virtualenv`.
1517

16-
1718
**Step 1.** Initial setup.
1819

1920
Get the sources and create a virtual environment
@@ -25,101 +26,83 @@ $ pip install virtualenv
2526
$ virtualenv venv
2627
```
2728

28-
**Step 2.** One-time mbed-cli setup.
29-
30-
This step is only required once if you are planning to use the mbed-cli build method.
31-
32-
First run step 3 below to activate the virtual environment. Then execute these commands.
33-
```
34-
$ mbed deploy
35-
$ mbed config root .
36-
$ mbed config ARM_PATH <FULL_PATH_TO_ARMCC_FOLDER>
37-
```
38-
39-
4029
## Activate virtual environment
41-
**Step 3.** Activate the virtual environment and update requirements. This is necessary when you open a new shell. **This should be done every time you pull new changes**
30+
**Step 2.** Activate the virtual environment and update requirements. This is necessary when you open a new shell. **This should be done every time you pull new changes**
4231

4332
```
4433
$ venv/Scripts/activate (For Linux)
4534
$ venv/Scripts/activate.bat (For Windows)
46-
$ pip install -r requirements.txt
35+
(venv) $ pip install -r requirements.txt
4736
```
4837

49-
5038
## Build
5139
**This should be done every time you pull new changes**
5240

53-
There are two ways to build DAPLink. You can generate Keil MDK project files and build within MDK. MDK is also used to debug DAPLink running on the interface chip. Or, you can use the `mbedcli_compile.py` script to build projects from the command line without requiring MDK.
41+
There are two ways to build DAPLink. You can use the `progen` command-line tool from project-generator or the `tools/progen_compile.py` wrapper tool.
5442

43+
**Step 3.1.** Using `progen_compile.py`
5544

56-
**Step 4.1.** For MDK progen compilation.
57-
58-
This command generates MDK project files under the `projectfiles/uvision` directory.
5945
```
60-
$ progen generate -t uvision
46+
(venv) $ python tools/progen_compile.py [-t <tool>] [--clean] [-v] [--parallel] [<project> [<project> ...]]
6147
```
6248

63-
To only generate one specific project, use a command like this:
64-
```
65-
progen generate -f projects.yaml -p stm32f103xb_stm32f746zg_if -t uvision
66-
```
67-
These options to `progen` set the parameters:
68-
- `-f` for the input projects file
69-
- `-p` for the project name
70-
- `-t` to specify the IDE name
49+
* `-t <tool>`: choose the toolchain to build. The default is `make_gcc_arm`. Other options tested are `make_gcc_arm`, `make_armclang`, `make_armcc`, `cmake_gcc_arm`, `cmake_armclang`, `cmake_armcc`.
50+
* `--clean`: will clear existing compilation products and force recompilation of all files.
51+
* `-v`: will make compilation process more verbose (typically listing all commands with their arguments)
52+
* `--parallel`: enable parallel compilation within a project (projects are compiled sequentially).
53+
* `<project>`: target project to compile (e.g. `stm32f103xb_bl`, `lpc11u35_if`), if none is specified all (140 to 150) projects will be compiled.
7154

55+
**Step 3.2.** Using `progen` with `make`
7256

73-
**Step 4.2.** For mbed-cli project compilation
57+
The following command combines generation and compilation:
7458

75-
This command will build all projects:
7659
```
77-
$ tools/mbedcli_compile.py
60+
(venv) $ progen generate -t make_gcc_arm -p <project> -b
7861
```
7962

80-
To build only a subset of projects, add the project name(s) to the end of the command line. Valid project names are listed
81-
in the usage text shown with `--help`. The first time you build after each pull you should add `--clean` to perform a
82-
complete re-build.
63+
Alternatively one can separate those task:
64+
```
65+
(venv) $ progen generate -t make_gcc_arm -p <project>
66+
(venv) $ make -C projectfiles/make_gcc_arm/<project> [<target>] [VERBOSE=1]
67+
```
68+
Where:
69+
* `<project>`: target project to compile (e.g. `stm32f103xb_bl`, `lpc11u35_if`).
70+
* `<target>`: build target, can be `all`, `clean` or `help`.
71+
* `VERBOSE=1`: display additional compilation information.
8372

84-
## Contribute
85-
We would love to have your changes! Pull requests should be made once a changeset is [rebased onto Master](https://www.atlassian.com/git/tutorials/merging-vs-rebasing/workflow-walkthrough). See the [contributing guide](../CONTRIBUTING.md) for detailed requirements and guidelines for contributions.
73+
**Step 3.3.** Using `progen` with `cmake`
8674

87-
## Mbed-cli compile environment
75+
The following command combines generation and compilation:
8876

89-
### Features
90-
- Support both Python 2.x and 3.x versions.
91-
- Can compile a list of projects or the all of the projects.
92-
- Can generate the release directory with one command.
77+
```
78+
(venv) $ progen generate -t cmake_gcc_arm -o generator=<generator> -p <project> -b
79+
```
80+
* `<generator>`: use `CMake` generators among the following options:
81+
* `make` (`Unix Makefiles`)
82+
* `mingw-make` (`MinGW Makefiles`)
83+
* `msys-make` (`MSYS Makefiles`, untested)
84+
* `ninja` (`Ninja`)
85+
* `nmake` (`NMake Makefiles`)
86+
* `<project>`: target project to compile (e.g. `stm32f103xb_bl`, `lpc11u35_if`).
9387

94-
### Prerequisite
95-
mbed-cli is included in `requirements.txt`, so it will be installed automatically when configuring
96-
your development environment using the steps described above.
88+
**Step 3.4.** Using `progen` for MDK compilation.
9789

98-
### `tools/mbedcli_compile.py` script
99-
Arguments
90+
This command generates MDK project files under the `projectfiles/uvision` directory.
91+
```
92+
$ progen generate -t uvision
10093
```
101-
positional arguments:
102-
projects Selectively compile only the firmware specified
103-
otherwise all projects
10494

105-
optional arguments:
106-
-h, --help show this help message and exit
107-
--release Create a release with the yaml version file
108-
--build-folder BUILD_FOLDER
109-
Release directory to grab files from
110-
--release-folder RELEASE_FOLDER
111-
Directory to create and place files in
112-
--toolchain TOOLCHAIN
113-
Toolchain directory if present
114-
--clean Rebuild or delete build folder before compile
115-
-v Pass verbosity level to mbed compile -vv for more
95+
To only generate one specific project, use a command like this:
96+
```
97+
progen generate -f projects.yaml -p stm32f103xb_stm32f746zg_if -t uvision
11698
```
117-
Valid projects are listed on help.
99+
These options to `progen` set the parameters:
100+
- `-f` for the input projects file
101+
- `-p` for the project name
102+
- `-t` to specify the IDE name
118103

119-
Generate files needed by mbed-cli
120-
* `custom_profile.json` lists toolchain profile or compile flags parsed from the yaml files
121-
* `custom_targets.json` contains platform information for specific hics.
122-
* `.mbedignore` filters all files not needed for the project.
104+
## Contribute
105+
We would love to have your changes! Pull requests should be made once a changeset is [rebased onto main](https://www.atlassian.com/git/tutorials/merging-vs-rebasing/workflow-walkthrough). See the [contributing guide](../CONTRIBUTING.md) for detailed requirements and guidelines for contributions.
123106

124107
## Port
125108
There are three defined ways in which DAPLink can be extended. These are adding target support, adding board support and adding HIC support. Details on porting each of these can be found below.
@@ -128,15 +111,24 @@ There are three defined ways in which DAPLink can be extended. These are adding
128111
* [Adding a new board](PORT_BOARD.md)
129112
* [Adding a new HIC](PORT_HIC.md)
130113

131-
132114
## Test
133115
DAPLink has an extensive set of automated tests written in Python. They are used for regression testing, but you can use them to validate your DAPLink port. Details are [here](AUTOMATED_TESTS.md)
134116

135117
An option to search for the daplink firmware build in uvision and mbedcli build folders.
136-
`python test/run_test.py --project-tool mbedcli ...` or `python test/run_test.py --project-tool uvision ...`.
118+
`python test/run_test.py --project-tool make_gcc_arm ...` or `python test/run_test.py --project-tool uvision ...`.
137119

138120
## Release
139121

122+
### Release using `progen_compile.py`
123+
124+
* Create a tag with the correct release version and push it to github
125+
* Clean the repo you will be building from by running 'git clean -xdf' followed by 'git reset --hard'
126+
* Run the `progen_compile.py` command with the following parameters (see above for the `-t` flag):
127+
```
128+
(venv) $ python tools/progen_compile.py [-t <tool>] --clean -v --parallel --release
129+
```
130+
* All release deliverables will be created and stored in `firmware_<version>` (where `<version>` is the DAPLink version). Save this wherever your builds are stored.
131+
140132
### Release using uvision
141133

142134
DAPLink contains scripts to automate most of the steps of building a release. In addition to building the release, these scripts also save relevant build information such as git SHA and python tool versions so the same build can be reproduced. The recommended steps for creating a release are below.
@@ -150,20 +142,6 @@ Note: A previous build can be reproduced by using the ``build_requirements.txt``
150142
To do this add the additional argument ``build_requirements.txt`` when calling ``build_release_uvision.bat`` in step 2.
151143
This will install and build with the exact version of the python packages used to create that build.
152144

153-
### Release using mbedcli
154-
155-
If the project list is not specify, all interface and booloader projects will be compiled. If `--release_version` is given, a folder (`firmware` on default or specified by `--release_folder`, to be concatenated with the version number), will be generated with the bin, update.yml and zip file containing the bins for release
156-
```
157-
$ venv/Scripts/activate
158-
$ pip install -r requirements3.txt
159-
$ tools/mbedcli_compile.py --release_version 0250 --release_folder firmware
160-
```
161-
162-
There is an intermediate step in uvision environment in creating a release directory. This step is not needed in mbedcli environment but to make this equivalent directory invoke
163-
`copy_release_files.py --project-tool mbedcli`
164-
To make a release directory from the step above.
165-
`package_release_files.py SRC_DIR DEST_DIR VERSION_NUMBER --toolchain ARM`
166-
167145
## MDK
168146
If you want to use the MDK (uVision) IDE to work with the DAPLink code, you must launch it in the right environment. The project will fail to build otherwise. To launch uVision properly, use ``tools/launch_uvision.bat``
169147

0 commit comments

Comments
 (0)