7
31
Fork
You've already forked blackmagic
23

Compile error with 2.0.0 source file : section .data' will not fit in region rom' #2159

Open
opened 2025年11月03日 12:05:24 +01:00 by Ludovic37-center · 11 comments
Ludovic37-center commented 2025年11月03日 12:05:24 +01:00 (Migrated from github.com)
Copy link

Hi,
I followed the procedure to compile the latest firmware (https://black-magic.org/knowledge/compiling-windows.html).
When i try to build the firmware with these commands:

meson setup build --cross-file=cross-file/native.ini
cd build
ninja
ninja flash

I've got an error with ninja

[14/681] Linking target src/target/flashstub/rp_stub
Memory region Used Size Region Size %age Used
 sram: 260 B 4 KB 6.35%
[15/681] Linking target src/target/flashstub/efm32_stub
Memory region Used Size Region Size %age Used
 sram: 80 B 1 KB 7.81%
[16/681] Linking target src/target/flashstub/lmi_stub
Memory region Used Size Region Size %age Used
 sram: 48 B 1 KB 4.69%
[494/681] Compiling C object deps/libopencm3/lib/stm32/u5/libopencm3_stm32u5.a.p/rcc.c.o
../deps/libopencm3/lib/stm32/u5/rcc.c: In function 'rcc_clock_setup_hsi':
../deps/libopencm3/lib/stm32/u5/rcc.c:104:12: warning: this condition has identical branches [-Wduplicated-branches]
 104 | if (clock->ahb_frequency > rcc_ahb_frequency) {
 | ^
[503/681] Compiling C object deps/libopencm3/lib/stm32/u5/libopencm3_stm32u5.a.p/.._.._cm3_dwt.c.o
../deps/libopencm3/lib/cm3/dwt.c: In function 'dwt_read_cycle_counter':
../deps/libopencm3/lib/cm3/dwt.c:103:1: warning: control reaches end of non-void function [-Wreturn-type]
 103 | }
 | ^
[545/681] Linking target blackmagic_native_firmware.elf
FAILED: [code=1] blackmagic_native_firmware.elf
"arm-none-eabi-gcc" @blackmagic_native_firmware.elf.rsp
C:/msys64/home/xxxx.yyyy/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: blackmagic_native_firmware.elf section `.data' will not fit in region `rom'
C:/msys64/home/xxxx.yyyy/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: region `rom' overflowed by 132 bytes
Memory region Used Size Region Size %age Used
 rom: 131204 B 128 KB 100.10%
 ram: 7928 B 20 KB 38.71%
collect2.exe: error: ld returned 1 exit status
[562/681] Compiling C object blackmagic.exe.p/src_target_adiv5.c.obj
ninja: build stopped: subcommand failed.

Where did i go wrong ?

Hi, I followed the procedure to compile the latest firmware (https://black-magic.org/knowledge/compiling-windows.html). When i try to build the firmware with these commands: ``` meson setup build --cross-file=cross-file/native.ini cd build ninja ninja flash ``` I've got an error with ninja ``` [14/681] Linking target src/target/flashstub/rp_stub Memory region Used Size Region Size %age Used sram: 260 B 4 KB 6.35% [15/681] Linking target src/target/flashstub/efm32_stub Memory region Used Size Region Size %age Used sram: 80 B 1 KB 7.81% [16/681] Linking target src/target/flashstub/lmi_stub Memory region Used Size Region Size %age Used sram: 48 B 1 KB 4.69% [494/681] Compiling C object deps/libopencm3/lib/stm32/u5/libopencm3_stm32u5.a.p/rcc.c.o ../deps/libopencm3/lib/stm32/u5/rcc.c: In function 'rcc_clock_setup_hsi': ../deps/libopencm3/lib/stm32/u5/rcc.c:104:12: warning: this condition has identical branches [-Wduplicated-branches] 104 | if (clock->ahb_frequency > rcc_ahb_frequency) { | ^ [503/681] Compiling C object deps/libopencm3/lib/stm32/u5/libopencm3_stm32u5.a.p/.._.._cm3_dwt.c.o ../deps/libopencm3/lib/cm3/dwt.c: In function 'dwt_read_cycle_counter': ../deps/libopencm3/lib/cm3/dwt.c:103:1: warning: control reaches end of non-void function [-Wreturn-type] 103 | } | ^ [545/681] Linking target blackmagic_native_firmware.elf FAILED: [code=1] blackmagic_native_firmware.elf "arm-none-eabi-gcc" @blackmagic_native_firmware.elf.rsp C:/msys64/home/xxxx.yyyy/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: blackmagic_native_firmware.elf section `.data' will not fit in region `rom' C:/msys64/home/xxxx.yyyy/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: region `rom' overflowed by 132 bytes Memory region Used Size Region Size %age Used rom: 131204 B 128 KB 100.10% ram: 7928 B 20 KB 38.71% collect2.exe: error: ld returned 1 exit status [562/681] Compiling C object blackmagic.exe.p/src_target_adiv5.c.obj ninja: build stopped: subcommand failed. ``` Where did i go wrong ?
Ludovic37-center commented 2025年11月03日 13:32:09 +01:00 (Migrated from github.com)
Copy link

I try these commands

meson setup build --cross-file cross-file/native.ini -Dtargets=cortexm,stm -Drtt_support=false --reconfigure
meson compile -C build
It generates
blackmagic_native_firmware.bin, size 81ko
blackmagic_native_firmware.elf, size 852 ko

But not the same fimware size found here https://github.com/blackmagic-debug/blackmagic/releases

Is it normal not to have the same file sizes ?

I try these commands > meson setup build --cross-file cross-file/native.ini -Dtargets=cortexm,stm -Drtt_support=false --reconfigure > meson compile -C build It generates blackmagic_native_firmware.bin, size 81ko blackmagic_native_firmware.elf, size 852 ko But not the same fimware size found here https://github.com/blackmagic-debug/blackmagic/releases Is it normal not to have the same file sizes ?

So, part of this is down to you using a different compiler - the release builds were done with ARM GCC 12.2.Rel1, not 13.2.Rel1; The other part about this is that yes, the firmware is right at the limits of fitting, so any changes including a newer libopencm3 (which we note you have, which is curious because it should be locked to a specific commit hash on that release) can affect this.

From memory, you'll want to ensure that your deps/libopencm3 clone is checked out to commit 39149df5 or 43b39feb to match the version used in the release. This will still not make the file sizes match till you also use the same compiler version, but it at least gets the environment closer to the same.

So, part of this is down to you using a different compiler - the release builds were done with ARM GCC 12.2.Rel1, not 1**3**.2.Rel1; The other part about this is that yes, the firmware is right at the limits of fitting, so any changes including a newer libopencm3 (which we note you have, which is curious because it should be locked to a specific commit hash on that release) can affect this. From memory, you'll want to ensure that your `deps/libopencm3` clone is checked out to commit 39149df5 or 43b39feb to match the version used in the release. This will still not make the file sizes match till you also use the same compiler version, but it at least gets the environment closer to the same.
Ludovic37-center commented 2025年11月03日 15:07:55 +01:00 (Migrated from github.com)
Copy link

I follow the steps indicates in https://black-magic.org/knowledge/compiling-windows.html, It indicates to use ARM GNU Toolchain release 13.2.Rel1.
I will try ARM GCC 12.2.Rel1 and verify libopencm3 commit
I will go back to you tomorrow
Thanks for your help

I follow the steps indicates in https://black-magic.org/knowledge/compiling-windows.html, It indicates to use ARM GNU Toolchain release 13.2.Rel1. I will try ARM GCC 12.2.Rel1 and verify libopencm3 commit I will go back to you tomorrow Thanks for your help
Ludovic37-center commented 2025年11月03日 16:27:53 +01:00 (Migrated from github.com)
Copy link

I try with ARM GCC 12.2.Rel1 and it's the same problem
Where can i check deps/libopencm3 ? In C:\msys64\home\xxxx.yyyy\blackmagic\deps\libopencm3 ?

[画像:Image]
$ ninja
[13/681] Linking target src/target/flashstub/lmi_stub
Memory region Used Size Region Size %age Used
 sram: 48 B 1 KB 4.69%
[14/681] Linking target src/target/flashstub/rp_stub
Memory region Used Size Region Size %age Used
 sram: 260 B 4 KB 6.35%
[15/681] Linking target src/target/flashstub/efm32_stub
Memory region Used Size Region Size %age Used
 sram: 80 B 1 KB 7.81%
[492/681] Compiling C object deps/libopencm3/lib/stm32/u5/libopencm3_stm32u5.a.p/rcc.c.o
../deps/libopencm3/lib/stm32/u5/rcc.c: In function 'rcc_clock_setup_hsi':
../deps/libopencm3/lib/stm32/u5/rcc.c:104:12: warning: this condition has identical branches [-Wduplicated-branches]
 104 | if (clock->ahb_frequency > rcc_ahb_frequency) {
 | ^
[502/681] Compiling C object deps/libopencm3/lib/stm32/u5/libopencm3_stm32u5.a.p/.._.._cm3_dwt.c.o
../deps/libopencm3/lib/cm3/dwt.c: In function 'dwt_read_cycle_counter':
../deps/libopencm3/lib/cm3/dwt.c:103:1: warning: control reaches end of non-void function [-Wreturn-type]
 103 | }
 | ^
[544/681] Linking target blackmagic_native_firmware.elf
FAILED: [code=1] blackmagic_native_firmware.elf
"arm-none-eabi-gcc" @blackmagic_native_firmware.elf.rsp
c:/msys64/home/ludovic.rabotin/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: address 0x8020068 of blackmagic_native_firmware.elf section `.text' is not within region `rom'
c:/msys64/home/ludovic.rabotin/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: blackmagic_native_firmware.elf section `.data' will not fit in region `rom'
c:/msys64/home/ludovic.rabotin/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: address 0x8020068 of blackmagic_native_firmware.elf section `.text' is not within region `rom'
c:/msys64/home/ludovic.rabotin/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: region `rom' overflowed by 468 bytes
Memory region Used Size Region Size %age Used
 rom: 131540 B 128 KB 100.36%
 ram: 7928 B 20 KB 38.71%
collect2.exe: error: ld returned 1 exit status
[561/681] Compiling C object blackmagic.exe.p/src_target_adiv5.c.obj
ninja: build stopped: subcommand failed.
I try with ARM GCC 12.2.Rel1 and it's the same problem Where can i check deps/libopencm3 ? In C:\msys64\home\xxxx.yyyy\blackmagic\deps\libopencm3 ? <img width="1888" height="60" alt="Image" src="https://github.com/user-attachments/assets/89140683-ba0b-43e2-99ba-45463e3dad13" /> ``` $ ninja [13/681] Linking target src/target/flashstub/lmi_stub Memory region Used Size Region Size %age Used sram: 48 B 1 KB 4.69% [14/681] Linking target src/target/flashstub/rp_stub Memory region Used Size Region Size %age Used sram: 260 B 4 KB 6.35% [15/681] Linking target src/target/flashstub/efm32_stub Memory region Used Size Region Size %age Used sram: 80 B 1 KB 7.81% [492/681] Compiling C object deps/libopencm3/lib/stm32/u5/libopencm3_stm32u5.a.p/rcc.c.o ../deps/libopencm3/lib/stm32/u5/rcc.c: In function 'rcc_clock_setup_hsi': ../deps/libopencm3/lib/stm32/u5/rcc.c:104:12: warning: this condition has identical branches [-Wduplicated-branches] 104 | if (clock->ahb_frequency > rcc_ahb_frequency) { | ^ [502/681] Compiling C object deps/libopencm3/lib/stm32/u5/libopencm3_stm32u5.a.p/.._.._cm3_dwt.c.o ../deps/libopencm3/lib/cm3/dwt.c: In function 'dwt_read_cycle_counter': ../deps/libopencm3/lib/cm3/dwt.c:103:1: warning: control reaches end of non-void function [-Wreturn-type] 103 | } | ^ [544/681] Linking target blackmagic_native_firmware.elf FAILED: [code=1] blackmagic_native_firmware.elf "arm-none-eabi-gcc" @blackmagic_native_firmware.elf.rsp c:/msys64/home/ludovic.rabotin/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: address 0x8020068 of blackmagic_native_firmware.elf section `.text' is not within region `rom' c:/msys64/home/ludovic.rabotin/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: blackmagic_native_firmware.elf section `.data' will not fit in region `rom' c:/msys64/home/ludovic.rabotin/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: address 0x8020068 of blackmagic_native_firmware.elf section `.text' is not within region `rom' c:/msys64/home/ludovic.rabotin/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: region `rom' overflowed by 468 bytes Memory region Used Size Region Size %age Used rom: 131540 B 128 KB 100.36% ram: 7928 B 20 KB 38.71% collect2.exe: error: ld returned 1 exit status [561/681] Compiling C object blackmagic.exe.p/src_target_adiv5.c.obj ninja: build stopped: subcommand failed. ```

Yes, git fetch --all to expand the tree out so you can then switch to the relevant commit, then git switch --detach 39149df5 to switch to it.

Yes, `git fetch --all` to expand the tree out so you can then switch to the relevant commit, then `git switch --detach 39149df5` to switch to it.
Ludovic37-center commented 2025年11月03日 17:01:12 +01:00 (Migrated from github.com)
Copy link

Sorry, these commits doesn't exist in lib/opencm3

$ git switch --detach 39149df5
fatal: invalid reference: 39149df5
$ git switch --detach 43b39feb
fatal: invalid reference: 43b39feb

I try to search on github : https://github.com/search?q=39149df5&type=commits

Sorry, these commits doesn't exist in lib/opencm3 ``` $ git switch --detach 39149df5 fatal: invalid reference: 39149df5 $ git switch --detach 43b39feb fatal: invalid reference: 43b39feb ``` I try to search on github : https://github.com/search?q=39149df5&type=commits
[画像:Image]

They definitely do, which is why we asked you to fetch the remote in full first - see https://github.com/blackmagic-debug/libopencm3

<img width="935" height="844" alt="Image" src="https://github.com/user-attachments/assets/8fb231ad-6bf9-4077-9de4-a5ad73da1b69" /> They definitely do, which is why we asked you to fetch the remote in full first - see https://github.com/blackmagic-debug/libopencm3
Ludovic37-center commented 2025年11月04日 10:17:22 +01:00 (Migrated from github.com)
Copy link

Hi,
I surely make a mystake with git and libopencm3, i can fetch the remote in full now

ludovic.rabotin@Portable_LRA UCRT64 ~/blackmagic/deps/libopencm3
$ git switch --detach 43b39feb
M include/libopencm3/cm3/itm.h
M include/libopencm3/cm3/memorymap.h
M include/libopencm3/cm3/scb.h
M include/libopencm3/stm32/adc.h
M include/libopencm3/stm32/can.h
M include/libopencm3/stm32/common/adc_common_v1.h
M include/libopencm3/stm32/common/timer_common_all.h
M include/libopencm3/stm32/crs.h
M include/libopencm3/stm32/exti.h
M include/libopencm3/stm32/l4/pwr.h
M include/libopencm3/stm32/pwr.h
M include/libopencm3/stm32/u5/memorymap.h
M include/libopencm3/stm32/u5/rcc.h
M include/libopencm3/usb/dwc/otg_fs.h
M include/libopencm3/usb/dwc/otg_hs.h
M include/meson.build
M ld/devices.data
M lib/cm3/scb.c
M lib/lm4f/rcc.c
M lib/stm32/can.c
M lib/stm32/common/adc_common_v1.c
M lib/stm32/common/timer_common_all.c
M lib/stm32/f1/rcc.c
M lib/stm32/f3/rcc.c
M lib/stm32/g4/Makefile
M lib/stm32/l4/pwr.c
M lib/stm32/meson.build
M lib/stm32/u5/Makefile
M lib/usb/usb_dwc_common.c
HEAD is now at 43b39feb Merge branch 'master'

I build everything with "meson setup build --cross-file=cross-file/native.ini --wipe"
But same problem as yesterday

[12/649] Linking target src/target/flashstub/efm32_stub
Memory region Used Size Region Size %age Used
 sram: 80 B 1 KB 7.81%
[13/649] Linking target src/target/flashstub/lmi_stub
Memory region Used Size Region Size %age Used
 sram: 48 B 1 KB 4.69%
[14/649] Linking target src/target/flashstub/rp_stub
Memory region Used Size Region Size %age Used
 sram: 260 B 4 KB 6.35%
[513/649] Linking target blackmagic_native_firmware.elf
FAILED: [code=1] blackmagic_native_firmware.elf
"arm-none-eabi-gcc" @blackmagic_native_firmware.elf.rsp
c:/msys64/home/xxxx.yyyy/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: address 0x8020068 of blackmagic_native_firmware.elf section `.text' is not within region `rom'
c:/msys64/home/xxxx.yyyy/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: blackmagic_native_firmware.elf section `.data' will not fit in region `rom'
c:/msys64/home/xxxx.yyyy/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: address 0x8020068 of blackmagic_native_firmware.elf section `.text' is not within region `rom'
c:/msys64/home/xxxx.yyyy/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: region `rom' overflowed by 468 bytes
Memory region Used Size Region Size %age Used
 rom: 131540 B 128 KB 100.36%
 ram: 7928 B 20 KB 38.71%
collect2.exe: error: ld returned 1 exit status
[530/649] Compiling C object blackmagic.exe.p/src_target_adiv5.c.obj
ninja: build stopped: subcommand failed.

Thank you for your help,
but I'm not sure I can generate the native 2.0.0 firmware, equivalent to the one provided here (https://github.com/blackmagic-debug/blackmagic/releases).
I'll continue working on my own.

Hi, I surely make a mystake with git and libopencm3, i can fetch the remote in full now ``` ludovic.rabotin@Portable_LRA UCRT64 ~/blackmagic/deps/libopencm3 $ git switch --detach 43b39feb M include/libopencm3/cm3/itm.h M include/libopencm3/cm3/memorymap.h M include/libopencm3/cm3/scb.h M include/libopencm3/stm32/adc.h M include/libopencm3/stm32/can.h M include/libopencm3/stm32/common/adc_common_v1.h M include/libopencm3/stm32/common/timer_common_all.h M include/libopencm3/stm32/crs.h M include/libopencm3/stm32/exti.h M include/libopencm3/stm32/l4/pwr.h M include/libopencm3/stm32/pwr.h M include/libopencm3/stm32/u5/memorymap.h M include/libopencm3/stm32/u5/rcc.h M include/libopencm3/usb/dwc/otg_fs.h M include/libopencm3/usb/dwc/otg_hs.h M include/meson.build M ld/devices.data M lib/cm3/scb.c M lib/lm4f/rcc.c M lib/stm32/can.c M lib/stm32/common/adc_common_v1.c M lib/stm32/common/timer_common_all.c M lib/stm32/f1/rcc.c M lib/stm32/f3/rcc.c M lib/stm32/g4/Makefile M lib/stm32/l4/pwr.c M lib/stm32/meson.build M lib/stm32/u5/Makefile M lib/usb/usb_dwc_common.c HEAD is now at 43b39feb Merge branch 'master' ``` I build everything with "meson setup build --cross-file=cross-file/native.ini --wipe" But same problem as yesterday ``` [12/649] Linking target src/target/flashstub/efm32_stub Memory region Used Size Region Size %age Used sram: 80 B 1 KB 7.81% [13/649] Linking target src/target/flashstub/lmi_stub Memory region Used Size Region Size %age Used sram: 48 B 1 KB 4.69% [14/649] Linking target src/target/flashstub/rp_stub Memory region Used Size Region Size %age Used sram: 260 B 4 KB 6.35% [513/649] Linking target blackmagic_native_firmware.elf FAILED: [code=1] blackmagic_native_firmware.elf "arm-none-eabi-gcc" @blackmagic_native_firmware.elf.rsp c:/msys64/home/xxxx.yyyy/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: address 0x8020068 of blackmagic_native_firmware.elf section `.text' is not within region `rom' c:/msys64/home/xxxx.yyyy/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: blackmagic_native_firmware.elf section `.data' will not fit in region `rom' c:/msys64/home/xxxx.yyyy/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: address 0x8020068 of blackmagic_native_firmware.elf section `.text' is not within region `rom' c:/msys64/home/xxxx.yyyy/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: region `rom' overflowed by 468 bytes Memory region Used Size Region Size %age Used rom: 131540 B 128 KB 100.36% ram: 7928 B 20 KB 38.71% collect2.exe: error: ld returned 1 exit status [530/649] Compiling C object blackmagic.exe.p/src_target_adiv5.c.obj ninja: build stopped: subcommand failed. ``` Thank you for your help, but I'm not sure I can generate the native 2.0.0 firmware, equivalent to the one provided here (https://github.com/blackmagic-debug/blackmagic/releases). I'll continue working on my own.

One question we do have, given how that release build is done via the CI set up on this project, is why are you trying to reproduce the build? If this is for, eg, adding a target to the firmware, then you would be much better off on main, not the release.

We also note that you're running the 32-bit GCC which we have no idea how that differs from their 64-bit builds, and that may contribute a difference too. As noted, the firmware is running right up against the bounds of what is possible to fit into Flash on BMP, so the build is super sensitive to minute seeming differences than the way we run the builds in CI and locally (64-bit compiler, 12.2.Rel1 for that release, built by ARM and downloaded from their website, not any of the repacks that do things like replace newlib-nano, etc).

For the current main, we would suggest using ARM GCC 14.3.Rel1 as the GCC 14 optimiser does a better job than even the GCC 12 one did, and this is how CI is done for PRs now.

One question we do have, given how that release build is done via the CI set up on this project, is why are you trying to reproduce the build? If this is for, eg, adding a target to the firmware, then you would be much better off on `main`, not the release. We also note that you're running the 32-bit GCC which we have no idea how that differs from their 64-bit builds, and that may contribute a difference too. As noted, the firmware is running right up against the bounds of what is possible to fit into Flash on BMP, so the build is super sensitive to minute seeming differences than the way we run the builds in CI and locally (64-bit compiler, 12.2.Rel1 for that release, built by ARM and downloaded from their website, not any of the repacks that do things like replace newlib-nano, etc). For the current `main`, we would suggest using ARM GCC 14.3.Rel1 as the GCC 14 optimiser does a better job than even the GCC 12 one did, and this is how CI is done for PRs now.
Ludovic37-center commented 2025年11月04日 12:06:32 +01:00 (Migrated from github.com)
Copy link

You're right, it would have been easier to explain why I needed to generate firmware 2.0.0.
In my company, we try to use several Black Magic Probes to bulk program large numbers of devices in production.
Our project consists of creating a card equipped with several dozen STM32 F103 (BMP) chips, capable of flashing other cards equipped with STM32 microcontrollers.
The problem is being able to locate a probe that has had a flashing error.
I have several ideas for solving this problem, but if I cannot generate a firmware equivalent to 2.0.0, I cannot guarantee that the targets will be programmed correctly.
I'll try to follow your advice regarding 64-bit gcc and start over from the beginning. I must have made a mistake at some point.

You're right, it would have been easier to explain why I needed to generate firmware 2.0.0. In my company, we try to use several Black Magic Probes to bulk program large numbers of devices in production. Our project consists of creating a card equipped with several dozen STM32 F103 (BMP) chips, capable of flashing other cards equipped with STM32 microcontrollers. The problem is being able to locate a probe that has had a flashing error. I have several ideas for solving this problem, but if I cannot generate a firmware equivalent to 2.0.0, I cannot guarantee that the targets will be programmed correctly. I'll try to follow your advice regarding 64-bit gcc and start over from the beginning. I must have made a mistake at some point.
Ludovic37-center commented 2025年11月04日 16:48:25 +01:00 (Migrated from github.com)
Copy link

I try with "Stable Release v2.0.0" and it seems working
i can flash a BMP with bmputil-cli and this firmware

bmputil-cli.exe probe info indicates

Found: Black Magic Probe <invalid version>
 Serial: BEF49ABE
 Port: 0-1
I try with "Stable Release v2.0.0" and it seems working i can flash a BMP with bmputil-cli and this firmware bmputil-cli.exe probe info indicates ``` Found: Black Magic Probe <invalid version> Serial: BEF49ABE Port: 0-1 ```
Sign in to join this conversation.
No Branch/Tag specified
main
fix/pre-bmp-v3-cross-file-cleanup
feature/bmda-remote-comms
ALTracer/feature/aarch64-ident
feature/better-meson-optimisation-handling
feature/am335x-support
feature/esp32-c3-support
feature/cortex-ar-software-breakpoints
feature/unit-testing
feature/windows-usb-serial-interface-naming
fix/bmp-external-spi
ALTracer/feature/bluepillplus-platform
ALTracer/feature/at32f43x-unrdp
feature/const-correctness
ALTracer/feature/fault_handlers
ALTracer/feature/hazard3-ice40-support
fix/ci-cleanup
ALTracer/fix/gdb-10-12-thread
ALTracer/feature/blackpill-f4-adc
ALTracer/fix/cortex-desc-allocfail-report
ALTracer/feature/spi-perf
ALTracer/feature/calibrate_swd
ALTracer/feature/blank-check
feature/avr
v2.0
v1.9
v1.10
v1.8
v2.1.0-rc1
v2.0.0
v2.0.0-rc2
v2.0.0-rc1
v1.9.3
v1.10.2
v1.10.1
v1.10.0
v1.10.0-rc1
v1.10.0-rc0
v1.9.2
v1.8.3
v1.9.1
v1.9.0
v1.9.0-rc1
v1.9.0-rc0
v1.8.2
v1.8.1
v1.8.0
v1.7.1
v1.7
v1.6.2-rc1
1.6.2-rc0
v1.6.1
v1.6
v1.6-rc1
v1.6-rc0
production_01
production_00
Labels
Clear labels
BMD App
Black Magic Debug App (aka. PC hosted) (not firmware)
BMP Firmware
Black Magic Probe Firmware (not PC hosted software)
Bug
Confirmed bug
Build system
Build system
Can't reproduce
Maintainers can't reproduce this problem
CI
Continuous Integration System
Contribution wanted
User contributions welcome
Documentation
Project documentation
Draft
Work in progress draft
Duplicate
This issue or pull request already exists
Enhancement
General project improvement
Feedback wanted
Requires additional submitter feedback
Foreign Host Board
Non Native hardware to runing Black Magic firmware on
GDB
Issue/PR related to GDB
Good first issue
Good for newcommers
HwIssue Mitigation
Solving or mitigating a Hardware issue in Software
Information Needed
Maintainers need more information
NativeHardware
Official Black Magic Debug Hardware
New Host Board
New hardware to run Black Magic firmware on
New Target
New debug target
Off Topic
Something that does not involve the project in any way
Potential Bug
A potential, unconfirmed or very special circumstance bug
Regression
Bug caused by a regression
User Interest Needed
More user interest required before consideration
User Testing Needed
Looking for user testing reports
Won't fix
Outside of the project scope or works as intended
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
blackmagic-debug/blackmagic#2159
Reference in a new issue
blackmagic-debug/blackmagic
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?