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

Feature: experimental meson buildsystem #1528

Merged
merged 67 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
7b9080e
make: add lib/stm32/f7 libopencm3 prebuild target
perigoso Nov 11, 2023
eaf9592
misc: add experimental meson buildsystem
perigoso Nov 11, 2023
eef6f37
misc: move libopencm3 submodule to deps
perigoso Nov 11, 2023
cb3dc85
deps: Add libopencm3 Meson subproject wrap
perigoso Nov 11, 2023
718781b
target/meson: add target selection funtionality
perigoso Nov 11, 2023
758b81c
platform/tm4c/meson: port tm4c platform to meson
perigoso Nov 11, 2023
510a11b
probe/launchpad-icdi/meson: port launchpad-icdi probe to meson
perigoso Nov 11, 2023
a1d675f
probe/stlink/meson: port stlink probe to meson
perigoso Nov 11, 2023
3f9b843
probe/meson: implement probe aliasing
perigoso Nov 11, 2023
213f1b7
probe/meson: add bluepill probe aliased to stlink
perigoso Nov 11, 2023
fe478ab
probe/swlink/meson: port swlink probe to meson
perigoso Nov 11, 2023
40c3482
platform/stm32/meson: port stm32f4 platform to meson
perigoso Nov 11, 2023
e6edccc
probe/hydrabus/meson: port hydrabus probe to meson
perigoso Nov 11, 2023
94794c1
probe/f4discovery/meson: port f4discovery probe to meson
perigoso Nov 11, 2023
5fac3fe
probe/96b_carbon/meson: port 96b_carbon probe to meson
perigoso Nov 11, 2023
fcd6808
platform/stm32/meson: port stm32f3 platform to meson
perigoso Nov 11, 2023
68c3646
probe/f3/meson: port f3 probe to meson
perigoso Nov 11, 2023
1e528ca
platform/stm32/meson: port stm32f0 platform to meson
perigoso Nov 11, 2023
c08d935
probe/f072/meson: port f072 probe to meson
perigoso Nov 11, 2023
e25ba7d
platform/stm32/meson: port stm32f7 platform to meson
perigoso Nov 11, 2023
7c50ab8
probe/stlinkv3: include opencm3 top level lib dir
perigoso Nov 11, 2023
76d2107
probe/stmlinkv3/meson: port stlinkv3 probe to meson
perigoso Nov 11, 2023
19e1df1
meson: add bootloader compilation targets
perigoso Nov 11, 2023
1a5efef
probe/native/meson: add bootloader target
perigoso Nov 11, 2023
89f9864
probe/96b_carbon/meson: add bootloader target
perigoso Nov 11, 2023
736a7e9
probe/f4discovery/meson: add bootloader target
perigoso Nov 11, 2023
b1fb61d
probe/hydrabus/meson: add bootloader target
perigoso Nov 11, 2023
892abbe
probe/stlink/meson: add bootloader target
perigoso Nov 11, 2023
3e7c220
probe/swlink/meson: add bootloader target
perigoso Nov 11, 2023
4d43a9a
platform/stm32/meson: add stm32f7 dfu platform
perigoso Nov 11, 2023
3936805
probe/stlinkv3/meson: add bootloader target
perigoso Nov 11, 2023
0653936
meson: add bmputil flash utility target
perigoso Nov 11, 2023
e79e6ca
probe/launchpad-icdi/meson: add serialno option
perigoso Nov 11, 2023
9a83d25
meson: add summary output
perigoso Nov 11, 2023
c85ac1f
meson: add extensive warnings
perigoso Nov 11, 2023
5678191
meson: default to werror false
perigoso Nov 11, 2023
d33d346
meson: use custom target default unique id available in v0.60.0
perigoso Nov 11, 2023
62b4c8a
meson: use filesystem module to manipulate target suffixes and refere…
perigoso Nov 11, 2023
5211e9b
meson: add advertise_noackmode option
perigoso Nov 11, 2023
0163c79
probe/blackpill-f4/meson: port blackpill-f4 based probes to meson
perigoso Nov 14, 2023
49e24dc
meson: add cross-files with default options for OOBE
perigoso Dec 13, 2023
b9b69c5
meson: Added handling for the extended warnings in native builds when…
dragonmux Nov 28, 2023
3775681
meson: Moved the base firmware build logic into a guard block for cro…
dragonmux Nov 28, 2023
aa58e2b
target/meson: Moved the core firmware targets dependency into a cross…
dragonmux Nov 28, 2023
05e62db
target/meson: Defined a targets dependency for the libblackmagicdebug…
dragonmux Nov 28, 2023
4c45e80
meson: Moved the core firmware dependency into a cross-build guard block
dragonmux Nov 28, 2023
01395e5
meson: add assertion for cross-compilation for firmware builds
perigoso Dec 14, 2023
269ebad
meson: Defined a core dependency for the libblackmagicdebug library t…
dragonmux Nov 28, 2023
f02889f
meson: Defined the libblackmagicdebug library target
dragonmux Nov 28, 2023
ba4acb1
github: Add inital workflow to test meson build
perigoso Nov 11, 2023
f4eedab
meson: Apply the 120 character line length to the options file to imp…
dragonmux Dec 20, 2023
2e7d3b8
target/meson: Slightly reorganised to put the targets selection valid…
dragonmux Dec 20, 2023
7f54b68
target/meson: Improved the summary output with a translation of the e…
dragonmux Dec 20, 2023
295acda
target/meson: OOBE experience improvement when using the non-target-s…
dragonmux Dec 20, 2023
e6f13e4
deps: Added a Meson subproject wrap for libusb
dragonmux Dec 20, 2023
685d3be
hosted/meson: Created a Meson build system for BMDA
dragonmux Dec 20, 2023
729b913
github: Updated the PR workflow for BMDA's inclusion in the Meson bui…
dragonmux Dec 20, 2023
a51049b
hosted: Removed a disused define for the CMSIS-DAP code
dragonmux Dec 20, 2023
8d02127
meson: Mark the build system no longer experimental
dragonmux Dec 21, 2023
1ae78b3
target: Fixed a bug when `-D_FILE_OFFSET_BITS=64` is given
dragonmux Dec 29, 2023
5296cf7
hosted/rtt_if: Fixed the Windows guard as it used the wrong identifier
dragonmux Dec 29, 2023
7969e60
adiv5: Fixed a bug where if a platform fails to define `PLATFORM_HAS_…
dragonmux Jan 4, 2024
51bdd6c
readme: write instructions for building with meson
perigoso Jan 10, 2024
dd4a718
github: make the pull request template point to meson build instructi…
perigoso Jan 10, 2024
e23becd
usingrtt: update instructions to reference meson instead of make
perigoso Jan 10, 2024
d24657e
platforms: update instructions to reference meson and its respective …
perigoso Jan 10, 2024
9d6955d
hosted/README: Performed a fairly thorough rewrite of the BMDA readme…
dragonmux Jan 11, 2024
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
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Information embedded in the description part of the commits doesn't count.

* [ ] I've read the [Code of Conduct](https://github.com/blackmagic-debug/blackmagic/blob/main/CODE_OF_CONDUCT.md)
* [ ] I've read the [guidelines for contributing](https://github.com/blackmagic-debug/blackmagic/blob/main/CONTRIBUTING.md) to this repository
* [ ] It builds for hardware native (`make PROBE_HOST=native`)
* [ ] It builds as BMDA (`make PROBE_HOST=hosted`)
* [ ] It builds for hardware native (see [Building the firmware](https://github.com/blackmagic-debug/blackmagic?tab=readme-ov-file#building-black-magic-debug-firmware))
* [ ] It builds as BMDA (see [Building the BMDA](https://github.com/blackmagic-debug/blackmagic?tab=readme-ov-file#building-black-magic-debug-app))
* [ ] I've tested it to the best of my ability
* [ ] My commit messages provide a useful short description of what the commits do

Expand Down
79 changes: 78 additions & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,85 @@ jobs:
- name: Build full BMDA
run: make PROBE_HOST=hosted HOSTED_BMP_ONLY=0

# This workflow tests the experimental Meson build system
build-linux-meson:
# Name the job more appropriately so we can tell which windows and which MinGW ABI is in use
name: 'build-linux (${{ matrix.os.name }}, ${{ matrix.probe }}'
# The type of runner that the job will run on
runs-on: ${{ matrix.os.id }}

# We define a matrix of GCCs and OSes to build against so we can cover a variety of
# suitable compilation environments and early discover issues. The `build-and-upload`
# workflow contains an extended set.
strategy:
matrix:
os:
- {id: ubuntu-20.04, name: focal}
arm-compiler:
- '12.2.Rel1'
probe:
- '96b_carbon'
- 'bluepill'
- 'f072'
- 'f3'
- 'f4discovery'
- 'hydrabus'
- 'launchpad-icdi'
- 'native'
- 'stlink'
- 'stlinkv3'
- 'swlink'
fail-fast: false

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Build a suitable runtime environment
- name: Runtime environment
shell: bash
env:
WORKSPACE: ${{ github.workspace }}
# The GITHUB_WORKSPACE step here fixes https://github.com/actions/runner/issues/2058 which is an ongoing issue.
run: |
echo "$GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV

# Setup and use a suitable ARM GCC for the firmware
- name: Setup ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: ${{ matrix.arm-compiler }}

# Install and setup a suitable Meson + Ninja
- name: Setup Meson + Ninja
run: |
sudo python3 -m pip install --upgrade pip setuptools wheel
sudo python3 -m pip install meson ninja
working-directory: ${{ runner.temp }}

# Install BMDA's deps (libftdi1, hidapi-hidraw)
- name: Install BMDA dependencies
run: sudo apt-get -y install libftdi1-dev libhidapi-dev

# Record the versions of all the tools used in the build
- name: Version tools
run: |
arm-none-eabi-gcc --version
meson --version
ninja --version

# Checkout the repository and branch to build under the default location
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

# Build the firmware for all platform variants (currently available)
- name: Build
run: |
meson setup build --cross-file cross-file/${{ matrix.probe }}.ini
meson compile -C build

size-diff:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
# Setup and use a suitable ARM GCC for the firmware
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[submodule "libopencm3"]
path = libopencm3
path = deps/libopencm3
url = https://github.com/blackmagic-debug/libopencm3
branch = main
ignore = dirty
24 changes: 11 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,22 @@ By participating in this project you agree to abide by its terms.

## Development and Testing

When developing this project, the following tools are necessary:
When developing this project some tools are necessary, take a look at the **Requirements** section of the
[README](README.md#requirements).

* Git
* One of either:
* GCC or Clang (Clang is not strictly officially supported)
* [`arm-none-eabi-gcc`](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads) (from ARM, self-built and distro-supplied is currently broken)
* GNU Make or compatible `make` tool
perigoso marked this conversation as resolved.
Show resolved Hide resolved
For instructions on how to build the project, please follow the **Building** section of the
[README](README.md#building).

Which of the compilers you pick depends on if you're going to work on the firwmare or Black Magic Debug App (BMDA) respectively.
If you wish to use the older [gnu-rm](https://developer.arm.com/downloads/-/gnu-rm) ARM toolchain, this is fine and works well.
## Reporting issues

## Common tasks
### Before reporting issues

These are to be run at the root of your clone of Black Magic Probe.
1. Check against the latest version (`main` branch).
2. If possible, and applicable, test against another target and/or debug probe.
3. Consider broken USB cables and connectors.
4. Try to reproduce with BMDA with at least output verbosity bit 1 (INFO) set (`blackmagic -v 1 ...`), as debug messages will be dumped to the starting console.

* Building the firmware: `make PROBE_HOST=native` (or whichever probe you want to build for)
* Building BMDA: `make PROBE_HOST=hosted`
* Build testing all platforms: `make all_platforms`
When reporting issues, be as specific as possible!

## Submitting a pull request

Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ endif

all:
ifndef NO_LIBOPENCM3
$(Q)if [ ! -f libopencm3/Makefile ]; then \
$(Q)if [ ! -f deps/libopencm3/Makefile ]; then \
echo "Initialising git submodules..." ;\
git submodule init ;\
git submodule update ;\
git submodule update --init ;\
fi
$(Q)$(MAKE) $(MFLAGS) -C libopencm3 lib/stm32/f1 lib/stm32/f4 lib/lm4f
$(Q)$(MAKE) $(MFLAGS) -C deps/libopencm3 lib/stm32/f1 lib/stm32/f4 lib/stm32/f7 lib/lm4f
endif
$(Q)$(MAKE) $(MFLAGS) -C src

Expand All @@ -26,7 +25,7 @@ all_platforms:

clean:
ifndef NO_LIBOPENCM3
$(Q)$(MAKE) $(MFLAGS) -C libopencm3 $@
$(Q)$(MAKE) $(MFLAGS) -C deps/libopencm3 $@
endif
$(Q)$(MAKE) $(MFLAGS) -C src $@

Expand Down
Loading