Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 07d2272

Browse files
authored
Merge branch 'main' into pass-baudrate-in-manchester-mode
2 parents 970964b + f04ccfd commit 07d2272

127 files changed

Lines changed: 5754 additions & 738 deletions

File tree

Some content is hidden

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

.github/workflows/build-and-upload.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
1515
cancel-in-progress: true
1616

17+
permissions:
18+
contents: read
19+
actions: write
20+
1721
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1822
jobs:
1923
# This workflow contains a job for each supported OS in the form `build-<os>`
@@ -98,6 +102,12 @@ jobs:
98102
meson setup build --cross-file cross-file/${{ matrix.probe }}.ini
99103
meson compile -C build
100104
mkdir src/artefacts
105+
case "${{ matrix.probe }}" in
106+
native-*)
107+
mv build/blackmagic_native_firmware.elf build/blackmagic_${{ matrix.probe }}_firmware.elf
108+
mv build/blackmagic_native_firmware.bin build/blackmagic_${{ matrix.probe }}_firmware.bin
109+
;;
110+
esac
101111
mv build/blackmagic_*_firmware.{elf,bin} src/artefacts
102112
103113
# Package up the artefacts and upload them

.github/workflows/build-pr.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
1515
cancel-in-progress: true
1616

17+
permissions:
18+
contents: read
19+
pull-requests: read
20+
1721
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1822
jobs:
1923
# This workflow contains a job for each supported OS in the form `build-<os>`
@@ -29,9 +33,9 @@ jobs:
2933
strategy:
3034
matrix:
3135
os:
32-
- {id: ubuntu-22.04, name: jammy}
36+
- {id: ubuntu-24.04, name: noble}
3337
arm-compiler:
34-
- '12.2.Rel1'
38+
- '14.2.Rel1'
3539
probe:
3640
- '96b_carbon'
3741
- 'blackpill-f401cc'
@@ -74,13 +78,15 @@ jobs:
7478
# Install and setup a suitable Meson + Ninja
7579
- name: Setup Meson + Ninja
7680
run: |
77-
sudo python3 -m pip install --upgrade pip setuptools wheel
81+
sudo apt install -y python3-pip python3-setuptools python3-wheel
7882
sudo python3 -m pip install meson ninja
7983
working-directory: ${{ runner.temp }}
8084

8185
# Install BMDA's deps (libftdi1, hidapi-hidraw)
8286
- name: Install BMDA dependencies
83-
run: sudo apt-get -y install libftdi1-dev libhidapi-dev libudev-dev
87+
run: |
88+
sudo apt update
89+
sudo apt-get -y install libftdi1-dev libhidapi-dev libudev-dev
8490
8591
# Record the versions of all the tools used in the build
8692
- name: Version tools
@@ -119,7 +125,7 @@ jobs:
119125
strategy:
120126
matrix:
121127
os:
122-
- windows-2022
128+
- windows-2025
123129
fail-fast: false
124130

125131
# Steps represent a sequence of tasks that will be executed as part of the job
@@ -178,7 +184,7 @@ jobs:
178184
strategy:
179185
matrix:
180186
os:
181-
- windows-2022
187+
- windows-2025
182188
sys:
183189
- {abi: mingw64, env: x86_64, compiler: gcc}
184190
- {abi: ucrt64, env: ucrt-x86_64, compiler: gcc}
@@ -265,6 +271,7 @@ jobs:
265271
os:
266272
- macos-13
267273
- macos-14
274+
- macos-15
268275
- macos-latest
269276
fail-fast: false
270277

@@ -319,13 +326,14 @@ jobs:
319326
strategy:
320327
matrix:
321328
os:
322-
- macos-13
323329
- macos-14
330+
- macos-15
324331
compiler:
325332
- gcc@11
326333
- gcc@12
327334
- gcc@13
328-
- gcc@14 # Don't use 'gcc', the symlink is versioned -- see below
335+
- gcc@14
336+
- gcc@15 # Don't use 'gcc', the symlink is versioned -- see below
329337
fail-fast: false
330338

331339
# Steps represent a sequence of tasks that will be executed as part of the job
@@ -378,7 +386,7 @@ jobs:
378386
meson compile -C build
379387
380388
size-diff:
381-
runs-on: ubuntu-22.04
389+
runs-on: ubuntu-24.04
382390

383391
steps:
384392
# Build a suitable runtime environment
@@ -394,12 +402,12 @@ jobs:
394402
- name: Setup ARM GCC
395403
uses: carlosperate/arm-none-eabi-gcc-action@v1
396404
with:
397-
release: '12.2.Rel1'
405+
release: '14.2.Rel1'
398406

399407
# Install and setup a suitable Meson + Ninja
400408
- name: Setup Meson + Ninja
401409
run: |
402-
sudo python3 -m pip install --upgrade pip setuptools wheel
410+
sudo apt install -y python3-pip python3-setuptools python3-wheel
403411
sudo python3 -m pip install meson ninja
404412
working-directory: ${{ runner.temp }}
405413

.github/workflows/lint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99

1010
workflow_dispatch:
1111

12+
permissions:
13+
contents: read
14+
pull-requests: read
15+
1216
jobs:
1317
pre-commit:
1418
runs-on: ubuntu-latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ scripts/swolisten
2929

3030
/deps/*
3131
!/deps/*.wrap
32+
33+
/.cache/

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
exclude: '^upgrade/|^scripts/' # don't run hooks on scripts/ and upgrade/
22

33
repos:
4-
- repo: https://github.com/ssciwr/clang-format-hook
5-
rev: v16.0.2
4+
- repo: https://github.com/pre-commit/mirrors-clang-format
5+
rev: v18.1.8
66
hooks:
77
- id: clang-format
88
# entries here override, not extend, upstream's configuration

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
all:
2-
@echo "Makefile build system is depricated."
2+
@echo "Makefile build system is deprecated."
33
@echo ""
44
@echo "Please use Meson build system instead."
55
@echo ""

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,15 @@ You should now see the resulting binaries in `build`, in this case:
227227

228228
These are the binary files you will use to flash to your probe.
229229

230+
#### Building the bootloader
231+
232+
If your probe hardware does not already have a bootloader on it, after building firmware as described above
233+
you can build the appropriate bootloader with the following command:
234+
235+
```sh
236+
meson compile -C build boot-bin
237+
```
238+
230239
##### region `rom' overflowed
231240

232241
It may happen, while working with non default configurations or the project's latest version from Git,

SECURITY.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
| Version | Supported |
66
|---------|--------------------|
7+
| 2.0.x | :white_check_mark: |
8+
| 1.10.x | :white_check_mark: |
79
| 1.9.x | :white_check_mark: |
8-
| 1.8.x | :white_check_mark: |
10+
| 1.8.x | :x: |
911
|<= 1.7.x | :x: |
1012

1113
Any older version not listed in the above table is also not supported

cross-file/stlink.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ endian = 'little'
1919

2020
[project options]
2121
probe = 'stlink'
22-
targets = 'cortexm,lpc,nrf,nxp,renesas,sam,stm,ti'
22+
targets = 'cortexm,lpc,nrf,nxp,sam,stm,ti'
2323
rtt_support = false
2424
stlink_swim_nrst_as_uart = false
2525
bmd_bootloader = false

meson.build

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# This file is part of the Black Magic Debug project.
22
#
3-
# Copyright (C) 2023 1BitSquared <info@1bitsquared.com>
3+
# Copyright (C) 2023-2025 1BitSquared <info@1bitsquared.com>
44
# Written by Rafael Silva <perigoso@riseup.net>
5+
# Modified by Rachel Mant <git@dragonmux.network>
56
#
67
# Redistribution and use in source and binary forms, with or without
78
# modification, are permitted provided that the following conditions are met:
@@ -31,7 +32,7 @@
3132
project(
3233
'Black Magic Debug',
3334
'c',
34-
version: '1.10.0',
35+
version: '2.0.0',
3536
license: 'GPL-3.0-or-later OR BSD-3-Clause OR MIT',
3637
# license_files: ['COPYING', 'COPYING-BSD', 'COPYING-MIT'], # Only available in meson 1.1.0
3738
default_options: [
@@ -112,6 +113,7 @@ extended_warnings = [
112113
'-w24703', # Potentially uninitialized local pointer variable 'name' used
113114
'-Wmissing-attributes',
114115
'-Wmissing-braces',
116+
'-Wnewline-eof',
115117
'-Wno-char-subscripts',
116118
'-Wnull-dereference',
117119
# '-Wpacked',
@@ -126,6 +128,7 @@ extended_warnings = [
126128
# '-Wstack-protector',
127129
'-Wstrict-aliasing',
128130
'-Wstrict-overflow=3',
131+
'-Wstrict-prototypes',
129132
'-Wstring-compare',
130133
'-Wstringop-overflow',
131134
'-Wunknown-pragmas', # MSVC's C4081 and it's a level 1 warning
@@ -258,17 +261,31 @@ If you did not touch the build system this is not your fault, please report it
258261
## Utility targets
259262
## _______________
260263

261-
# Black Magic Probe Firmware Manager
262-
bmputil = find_program('bmputil', required: false)
264+
# Black Magic Probe companion utility
265+
bmputil = find_program('bmputil-cli', required: false)
263266
if bmputil.found()
264267
message('Adding target for firmware update')
265268

266269
# Firmware update target
267270
run_target(
268271
'flash',
269-
command: [bmputil, 'flash', bmf_elf.full_path()],
272+
command: [bmputil, 'probe', 'update', bmf_elf.full_path()],
270273
depends: bmf_elf,
271274
)
275+
# If we couldn't find the utility, look for the older pre-v1.0 version of it
276+
else
277+
# Black Magic Probe Firmware Manager
278+
bmputil = find_program('bmputil', required: false)
279+
if bmputil.found()
280+
message('Adding target for firmware update')
281+
282+
# Firmware update target
283+
run_target(
284+
'flash',
285+
command: [bmputil, 'flash', bmf_elf.full_path()],
286+
depends: bmf_elf,
287+
)
288+
endif
272289
endif
273290
endif
274291

0 commit comments

Comments
 (0)