Skip to content

Commit 522566e

Browse files
pillo79facchinm
authored andcommitted
core: use the new postbuild tool
- restore the debug menu on all boards - fix the spelling of 'extension' - convert to use the new option format for the postbuild tool
1 parent 91647a7 commit 522566e

File tree

3 files changed

+50
-41
lines changed

3 files changed

+50
-41
lines changed

Diff for: boards.txt

+37-30
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
menu.debug=Debug
12
menu.mode=Mode
23

34
giga.name=Arduino Giga R1
45
giga.build.core=arduino
56
giga.build.crossprefix=arm-zephyr-eabi-
67
giga.build.compiler_path={runtime.tools.arm-zephyr-eabi-0.16.8.path}/bin/
78

8-
giga.menu.mode.llext=llext
9-
giga.menu.mode.linked=linked
9+
giga.menu.debug.false=Standard
10+
giga.menu.debug.true=Debug
1011

11-
giga.menu.mode.false.post_build_arg=
12-
giga.menu.mode.true.post_build_arg=debug
12+
giga.menu.debug.false.postbuild_debug=
13+
giga.menu.debug.true.postbuild_debug=-debug
1314

1415
giga.build.variant=arduino_giga_r1_m7
1516
giga.build.mcu=cortex-m7
@@ -78,11 +79,11 @@ nano33ble.build.core=arduino
7879
nano33ble.build.crossprefix=arm-zephyr-eabi-
7980
nano33ble.build.compiler_path={runtime.tools.arm-zephyr-eabi-0.16.8.path}/bin/
8081

81-
nano33ble.menu.mode.false=Standard
82-
nano33ble.menu.mode.true=Debug
82+
nano33ble.menu.debug.false=Standard
83+
nano33ble.menu.debug.true=Debug
8384

84-
nano33ble.menu.mode.false.post_build_arg=
85-
nano33ble.menu.mode.true.post_build_arg=debug
85+
nano33ble.menu.debug.false.postbuild_debug=
86+
nano33ble.menu.debug.true.postbuild_debug=-debug
8687

8788
nano33ble.build.variant=arduino_nano_33_ble_sense
8889
nano33ble.build.mcu=cortex-m4
@@ -148,11 +149,11 @@ ek_ra8d1.build.core=arduino
148149
ek_ra8d1.build.crossprefix=arm-zephyr-eabi-
149150
ek_ra8d1.build.compiler_path={runtime.tools.arm-zephyr-eabi-0.16.8.path}/bin/
150151

151-
ek_ra8d1.menu.mode.false=Standard
152-
ek_ra8d1.menu.mode.true=Debug
152+
ek_ra8d1.menu.debug.false=Standard
153+
ek_ra8d1.menu.debug.true=Debug
153154

154-
ek_ra8d1.menu.mode.false.post_build_arg=
155-
ek_ra8d1.menu.mode.true.post_build_arg=debug
155+
ek_ra8d1.menu.debug.false.postbuild_debug=
156+
ek_ra8d1.menu.debug.true.postbuild_debug=-debug
156157

157158
ek_ra8d1.build.variant=ek_ra8d1
158159
ek_ra8d1.build.mcu=cortex-m85+nomve
@@ -214,11 +215,11 @@ frdm_mcxn947.build.core=arduino
214215
frdm_mcxn947.build.crossprefix=arm-zephyr-eabi-
215216
frdm_mcxn947.build.compiler_path={runtime.tools.arm-zephyr-eabi-0.16.8.path}/bin/
216217

217-
frdm_mcxn947.menu.mode.false=Standard
218-
frdm_mcxn947.menu.mode.true=Debug
218+
frdm_mcxn947.menu.debug.false=Standard
219+
frdm_mcxn947.menu.debug.true=Debug
219220

220-
frdm_mcxn947.menu.mode.false.post_build_arg=
221-
frdm_mcxn947.menu.mode.true.post_build_arg=debug
221+
frdm_mcxn947.menu.debug.false.postbuild_debug=
222+
frdm_mcxn947.menu.debug.true.postbuild_debug=-debug
222223

223224
frdm_mcxn947.build.variant=frdm_mcxn947_mcxn947_cpu0
224225
frdm_mcxn947.build.mcu=cortex-m33
@@ -274,11 +275,11 @@ portentah7.build.core=arduino
274275
portentah7.build.crossprefix=arm-zephyr-eabi-
275276
portentah7.build.compiler_path={runtime.tools.arm-zephyr-eabi-0.16.8.path}/bin/
276277

277-
portentah7.menu.mode.false=Standard
278-
portentah7.menu.mode.true=Debug
278+
portentah7.menu.debug.false=Standard
279+
portentah7.menu.debug.true=Debug
279280

280-
portentah7.menu.mode.false.post_build_arg=
281-
portentah7.menu.mode.true.post_build_arg=debug
281+
portentah7.menu.debug.false.postbuild_debug=
282+
portentah7.menu.debug.true.postbuild_debug=-debug
282283

283284
portentah7.build.variant=arduino_portenta_h7
284285
portentah7.build.mcu=cortex-m7
@@ -346,11 +347,11 @@ frdm_rw612.build.core=arduino
346347
frdm_rw612.build.crossprefix=arm-zephyr-eabi-
347348
frdm_rw612.build.compiler_path={runtime.tools.arm-zephyr-eabi-0.16.8.path}/bin/
348349

349-
frdm_rw612.menu.mode.false=Standard
350-
frdm_rw612.menu.mode.true=Debug
350+
frdm_rw612.menu.debug.false=Standard
351+
frdm_rw612.menu.debug.true=Debug
351352

352-
frdm_rw612.menu.mode.false.post_build_arg=
353-
frdm_rw612.menu.mode.true.post_build_arg=debug
353+
frdm_rw612.menu.debug.false.postbuild_debug=
354+
frdm_rw612.menu.debug.true.postbuild_debug=-debug
354355

355356
frdm_rw612.build.variant=frdm_rw612
356357
frdm_rw612.build.mcu=cortex-m33+nodsp
@@ -405,11 +406,11 @@ niclasense.build.core=arduino
405406
niclasense.build.crossprefix=arm-zephyr-eabi-
406407
niclasense.build.compiler_path={runtime.tools.arm-zephyr-eabi-0.16.8.path}/bin/
407408

408-
niclasense.menu.mode.false=Standard
409-
niclasense.menu.mode.true=Debug
409+
niclasense.menu.debug.false=Standard
410+
niclasense.menu.debug.true=Debug
410411

411-
niclasense.menu.mode.false.post_build_arg=
412-
niclasense.menu.mode.true.post_build_arg=debug
412+
niclasense.menu.debug.false.postbuild_debug=
413+
niclasense.menu.debug.true.postbuild_debug=-debug
413414

414415
niclasense.build.variant=arduino_nicla_sense_me
415416
niclasense.build.mcu=cortex-m4
@@ -481,15 +482,21 @@ portentac33.build.core=arduino
481482
portentac33.build.crossprefix=arm-zephyr-eabi-
482483
portentac33.build.compiler_path={runtime.tools.arm-zephyr-eabi-0.16.8.path}/bin/
483484

485+
portentac33.menu.debug.false=Standard
486+
portentac33.menu.debug.true=Debug
487+
488+
portentac33.menu.debug.false.postbuild_debug=
489+
portentac33.menu.debug.true.postbuild_debug=-debug
490+
484491
portentac33.menu.mode.llext=llext
485492
portentac33.menu.mode.linked=linked
486493

487494
portentac33.menu.mode.linked.build.extra_extra_ldflags=-lc -lm -lgcc -L{build.variant.path} -Wl,--wrap=random -Wl,--wrap=calloc -Wl,--wrap=free -Wl,--wrap=malloc -Wl,--wrap=realloc
488495
portentac33.menu.mode.linked.build.llext_link_flags=
489496
portentac33.menu.mode.linked.build.suffix=_linked
490497
portentac33.menu.mode.linked.build.ldscript={runtime.platform.path}/variants/linked/linker_script.ld
491-
portentac33.menu.mode.linked.upload.externsion=bin.dfu
492-
portentac33.menu.mode.linked.post_build_arg=linked
498+
portentac33.menu.mode.linked.upload.extension=bin.dfu
499+
portentac33.menu.mode.linked.postbuild_mode=-linked
493500

494501
portentac33.build.variant=arduino_portenta_c33
495502
portentac33.build.mcu=cortex-m33

Diff for: extra/build.sh

+6-5
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ fi
3232

3333
# Generate the provides.ld file for linked builds
3434
echo "Exporting provides.ld"
35-
arm-none-eabi-readelf --wide -s build/zephyr/zephyr.elf | c++filt | grep FUNC | awk -F' ' '{print "PROVIDE("$8" = 0x"$2");"}' > variants/$variant/provides.ld
36-
arm-none-eabi-readelf --wide -s build/zephyr/zephyr.elf | c++filt | grep kheap_llext_heap | awk -F' ' '{print "PROVIDE("$8" = 0x"$2");"}' >> variants/$variant/provides.ld
37-
arm-none-eabi-readelf --wide -s build/zephyr/zephyr.elf | c++filt | grep kheap_llext_heap | awk -F' ' '{print "PROVIDE(kheap_llext_heap_size = "$3");"}' >> variants/$variant/provides.ld
38-
arm-none-eabi-readelf --wide -s build/zephyr/zephyr.elf | c++filt | grep kheap__system_heap | awk -F' ' '{print "PROVIDE("$8" = 0x"$2");"}' >> variants/$variant/provides.ld
39-
arm-none-eabi-readelf --wide -s build/zephyr/zephyr.elf | c++filt | grep kheap__system_heap | awk -F' ' '{print "PROVIDE(kheap__system_heap_size = "$3");"}' >> variants/$variant/provides.ld
35+
READELF=${ZEPHYR_SDK_INSTALL_DIR}/arm-zephyr-eabi/bin/arm-zephyr-eabi-readelf
36+
$READELF --wide -s build/zephyr/zephyr.elf | c++filt | grep FUNC | awk -F' ' '{print "PROVIDE("$8" = 0x"$2");"}' > variants/$variant/provides.ld
37+
$READELF --wide -s build/zephyr/zephyr.elf | c++filt | grep kheap_llext_heap | awk -F' ' '{print "PROVIDE("$8" = 0x"$2");"}' >> variants/$variant/provides.ld
38+
$READELF --wide -s build/zephyr/zephyr.elf | c++filt | grep kheap_llext_heap | awk -F' ' '{print "PROVIDE(kheap_llext_heap_size = "$3");"}' >> variants/$variant/provides.ld
39+
$READELF --wide -s build/zephyr/zephyr.elf | c++filt | grep kheap__system_heap | awk -F' ' '{print "PROVIDE("$8" = 0x"$2");"}' >> variants/$variant/provides.ld
40+
$READELF --wide -s build/zephyr/zephyr.elf | c++filt | grep kheap__system_heap | awk -F' ' '{print "PROVIDE(kheap__system_heap_size = "$3");"}' >> variants/$variant/provides.ld
4041
cat build/zephyr/zephyr.map | grep __device_dts_ord | grep -v rodata | grep -v llext_const_symbol | awk -F' ' '{print "PROVIDE("$2" = "$1");"}' >> variants/$variant/provides.ld
4142
TEXT_START=`cat loader/boards/$variant.overlay | grep user_sketch: | cut -f2 -d"@" | cut -f1 -d"{"`
4243
echo "PROVIDE(_sketch_start = 0x$TEXT_START);" >> variants/$variant/provides.ld

Diff for: platform.txt

+7-6
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ build.ldscript={runtime.platform.path}/variants/llext/linker_script.ld
4545
build.llext_link_flags=-r -e main
4646
build.extra_extra_ldflags=
4747
build.suffix=
48-
upload.externsion=llext.dfu
49-
post_build_arg=
48+
upload.extension=llext.dfu
49+
postbuild_debug=
50+
postbuild_mode=
5051

5152
# These can be overridden in platform.local.txt
5253
compiler.c.extra_flags=
@@ -101,8 +102,8 @@ recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf
101102

102103
## Mangle the file
103104
recipe.hooks.objcopy.postobjcopy.1.pattern="{compiler.path}{build.crossprefix}strip" --strip-debug {build.path}/{build.project_name}.elf -o{build.path}/{build.project_name}.llext
104-
recipe.hooks.objcopy.postobjcopy.2.pattern={runtime.tools.zephyr-post-build-tool.path}/post_build {build.path}/{build.project_name}.llext {post_build_arg}
105-
recipe.hooks.objcopy.postobjcopy.3.pattern={runtime.tools.zephyr-post-build-tool.path}/post_build {build.path}/{build.project_name}.bin {post_build_arg}
105+
recipe.hooks.objcopy.postobjcopy.2.pattern={runtime.tools.zephyr-post-build-tool.path}/post_build {postbuild_debug} {postbuild_mode} {build.path}/{build.project_name}.llext
106+
recipe.hooks.objcopy.postobjcopy.3.pattern={runtime.tools.zephyr-post-build-tool.path}/post_build {postbuild_debug} {postbuild_mode} {build.path}/{build.project_name}.bin
106107

107108
## Compute size
108109
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
@@ -156,7 +157,7 @@ tools.bossac.cmd.windows=bossac.exe
156157

157158
tools.bossac.upload.params.verbose=-d
158159
tools.bossac.upload.params.quiet=
159-
tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U -i -e -w "{build.path}/{build.project_name}.{upload.externsion}" --offset {upload.address} -R
160+
tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U -i -e -w "{build.path}/{build.project_name}.{upload.extension}" --offset {upload.address} -R
160161

161162
tools.bossac.bootloader.params.verbose=-d
162163
tools.bossac.bootloader.params.quiet=
@@ -194,7 +195,7 @@ tools.dfu-util.path={runtime.tools.dfu-util.path}
194195
tools.dfu-util.cmd=dfu-util
195196
tools.dfu-util.upload.params.verbose=-d
196197
tools.dfu-util.upload.params.quiet=
197-
tools.dfu-util.upload.pattern="{path}/{cmd}" --device ,{upload.vid}:{upload.pid} -D "{build.path}/{build.project_name}.{upload.externsion}" -a{upload.interface} {upload.dfuse}
198+
tools.dfu-util.upload.pattern="{path}/{cmd}" --device ,{upload.vid}:{upload.pid} -D "{build.path}/{build.project_name}.{upload.extension}" -a{upload.interface} {upload.dfuse}
198199

199200
tools.dfu-util.bootloader.params.verbose=-d
200201
tools.dfu-util.bootloader.params.quiet=

0 commit comments

Comments
 (0)