Skip to content

Commit a3fa5b8

Browse files
authored
Merge pull request #154 from pillo79/pr-static-compile
Update to 4.2.0-rc3
2 parents f27ece3 + 6f50e00 commit a3fa5b8

File tree

14 files changed

+333
-90
lines changed

14 files changed

+333
-90
lines changed

.github/workflows/package_core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- name: Initialize Zephyr environment
3131
run: |
32-
./extra/bootstrap.sh -o=--filter=tree:0
32+
yes | ./extra/bootstrap.sh -o=--filter=tree:0
3333
echo "CORE_TAG=$(git describe --always)" >> "$GITHUB_ENV"
3434
echo "CORE_ARTIFACT=ArduinoCore-zephyr-$(git describe --always)" >> "$GITHUB_ENV"
3535
echo "BOARD_VARIANTS=$(extra/get_board_details.sh | jq -cr 'sort_by(.variant)')" >> "$GITHUB_ENV"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ llext-edk/
66
cflags.txt
77
cxxflags.txt
88
includes.txt
9-
provides.ld
9+
syms-dynamic.ld
10+
syms-static.ld

boards.txt

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
menu.debug=Debug
2-
menu.mode=Mode
2+
menu.link_mode=Link mode
3+
4+
##########################################################################################
35

46
giga.name=Arduino Giga R1
57
giga.build.core=arduino
@@ -19,14 +21,12 @@ giga.build.variant=arduino_giga_r1_stm32h747xx_m7
1921
giga.build.mcu=cortex-m7
2022
giga.build.fpu=-mfpu=fpv5-d16
2123
giga.build.architecture=cortex-m7
22-
giga.compiler.zephyr.arch.define=-DCORE_CM7
2324

2425
giga.build.float-abi=-mfloat-abi=softfp
2526
giga.build.extra_flags=
2627
giga.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
2728
giga.build.architecture=cortex-m7
2829
giga.build.board=ARDUINO_GIGA
29-
giga.compiler.zephyr=
3030
giga.vid.0=0x2341
3131
giga.pid.0=0x0066
3232
giga.upload_port.0.vid=0x2341
@@ -85,14 +85,12 @@ nano33ble.build.variant=arduino_nano_33_ble_nrf52840_sense
8585
nano33ble.build.mcu=cortex-m4
8686
nano33ble.build.fpu=-mfpu=fpv4-sp-d16
8787
nano33ble.build.architecture=cortex-m4
88-
nano33ble.compiler.zephyr.arch.define=
8988

9089
nano33ble.build.float-abi=-mfloat-abi=hard
9190
nano33ble.build.extra_flags=
9291
nano33ble.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
9392
nano33ble.build.architecture=cortex-m4
9493
nano33ble.build.board=ARDUINO_NANO33BLE
95-
nano33ble.compiler.zephyr=
9694
nano33ble.vid.0=0x2341
9795
nano33ble.pid.0=0x035a
9896
nano33ble.upload_port.0.vid=0x2341
@@ -149,19 +147,16 @@ ek_ra8d1.build.variant=ek_ra8d1_r7fa8d1bhecbd
149147
ek_ra8d1.build.mcu=cortex-m85+nomve
150148
ek_ra8d1.build.fpu=-mfpu=fpv5-d16
151149
ek_ra8d1.build.architecture=cortex-m85+nomve
152-
ek_ra8d1.compiler.zephyr.arch.define=
153150

154151
ek_ra8d1.build.float-abi=-mfloat-abi=hard
155152
ek_ra8d1.build.extra_flags=
156153
ek_ra8d1.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
157154
ek_ra8d1.build.architecture=cortex-m85+nomve
158155
ek_ra8d1.build.board=EK_RA8D1
159-
ek_ra8d1.compiler.zephyr.arch.define=
160156

161157
#ek_ra8d1.recipe.hooks.objcopy.postobjcopy.4.pattern=cp {build.variant.path}/flasher.jlink "{build.path}/flasher.jlink"
162158
#ek_ra8d1.recipe.hooks.objcopy.postobjcopy.5.pattern=sed -i 's|SKETCH|"{build.path}/{build.project_name}.llext.dfu.bin"|g' "{build.path}/flasher.jlink"
163159

164-
ek_ra8d1.compiler.zephyr=
165160
ek_ra8d1.vid.0=0x2341
166161
ek_ra8d1.pid.0=0x0077
167162
ek_ra8d1.upload_port.0.vid=0x2341
@@ -208,14 +203,11 @@ frdm_mcxn947.build.variant=frdm_mcxn947_mcxn947_cpu0
208203
frdm_mcxn947.build.mcu=cortex-m33
209204
frdm_mcxn947.build.fpu=-mfpu=fpv5-sp-d16
210205
frdm_mcxn947.build.architecture=cortex-m33
211-
frdm_mcxn947.compiler.zephyr.arch.define=
212206

213207
frdm_mcxn947.build.float-abi=-mfloat-abi=hard
214208
frdm_mcxn947.build.extra_flags=
215209
frdm_mcxn947.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
216210
frdm_mcxn947.build.board=FRDM_MCXN947
217-
frdm_mcxn947.compiler.zephyr.arch.define=
218-
frdm_mcxn947.compiler.zephyr=
219211
frdm_mcxn947.vid.0=0x1fc9
220212
frdm_mcxn947.pid.0=0x0143
221213
frdm_mcxn947.upload_port.0.vid=0x1fc9
@@ -262,14 +254,12 @@ portentah7.build.variant=arduino_portenta_h7_stm32h747xx_m7
262254
portentah7.build.mcu=cortex-m7
263255
portentah7.build.fpu=-mfpu=fpv5-d16
264256
portentah7.build.architecture=cortex-m7
265-
portentah7.compiler.zephyr.arch.define=-DCORE_CM7
266257

267258
portentah7.build.float-abi=-mfloat-abi=softfp
268259
portentah7.build.extra_flags=
269260
portentah7.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
270261
portentah7.build.architecture=cortex-m7
271262
portentah7.build.board=ARDUINO_PORTENTA_H7
272-
portentah7.compiler.zephyr=
273263
portentah7.vid.0=0x2341
274264
portentah7.pid.0=0x005b
275265
portentah7.upload_port.0.vid=0x2341
@@ -328,14 +318,11 @@ frdm_rw612.build.variant=frdm_rw612_rw612
328318
frdm_rw612.build.mcu=cortex-m33+nodsp
329319
frdm_rw612.build.fpu=-mfpu=fpv5-sp-d16
330320
frdm_rw612.build.architecture=cortex-m33+nodsp
331-
frdm_rw612.compiler.zephyr.arch.define=
332321

333322
frdm_rw612.build.float-abi=-mfloat-abi=hard
334323
frdm_rw612.build.extra_flags=
335324
frdm_rw612.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
336325
frdm_rw612.build.board=FRDM_RW612
337-
frdm_rw612.compiler.zephyr.arch.define=
338-
frdm_rw612.compiler.zephyr=
339326
frdm_rw612.vid.0=0x1fc9
340327
frdm_rw612.pid.0=0x0143
341328
frdm_rw612.upload_port.0.vid=0x1fc9
@@ -381,14 +368,12 @@ niclasense.build.variant=arduino_nicla_sense_me_nrf52832
381368
niclasense.build.mcu=cortex-m4
382369
niclasense.build.fpu=-mfpu=fpv4-sp-d16
383370
niclasense.build.architecture=cortex-m4
384-
niclasense.compiler.zephyr.arch.define=
385371

386372
niclasense.build.float-abi=-mfloat-abi=hard
387373
niclasense.build.extra_flags=
388374
niclasense.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
389375
niclasense.build.architecture=cortex-m4
390376
niclasense.build.board=ARDUINO_NICLA_SENSE_ME
391-
niclasense.compiler.zephyr=
392377
niclasense.vid.0=0x2341
393378
niclasense.pid.0=0x0360
394379
niclasense.upload_port.0.vid=0x2341
@@ -440,19 +425,12 @@ portentac33.build.compiler_path={runtime.tools.arm-zephyr-eabi-0.16.8.path}/bin/
440425

441426
portentac33.menu.debug.false=Standard
442427
portentac33.menu.debug.true=Debug
428+
portentac33.menu.debug.true.build.zsk_args.debug=-debug
443429

444-
portentac33.menu.debug.false.postbuild_debug=
445-
portentac33.menu.debug.true.postbuild_debug=-debug
446-
447-
portentac33.menu.mode.llext=llext
448-
portentac33.menu.mode.linked=linked
449-
450-
portentac33.menu.mode.linked.build.extra_ldflags=-lc -lm -lgcc -L{build.variant.path} -Wl,--wrap=random -Wl,--wrap=calloc -Wl,--wrap=free -Wl,--wrap=malloc -Wl,--wrap=realloc
451-
portentac33.menu.mode.linked.build.llext_link_flags=
452-
portentac33.menu.mode.linked.build.suffix=_linked
453-
portentac33.menu.mode.linked.build.ldscript={runtime.platform.path}/variants/_linked/linker_script.ld
454-
portentac33.menu.mode.linked.upload.extension=bin-zsk.bin
455-
portentac33.menu.mode.linked.postbuild_mode=-prelinked
430+
portentac33.menu.link_mode.dynamic=Dynamic
431+
portentac33.menu.link_mode.static=Static
432+
portentac33.menu.link_mode.static.build.link_mode=static
433+
portentac33.menu.link_mode.static.upload.extension=bin-zsk.bin
456434

457435
portentac33.build.zephyr_target=arduino_portenta_c33
458436
portentac33.build.zephyr_args=
@@ -461,14 +439,11 @@ portentac33.build.variant=arduino_portenta_c33_r7fa6m5bh3cfc
461439
portentac33.build.mcu=cortex-m33
462440
portentac33.build.fpu=-mfpu=fpv5-sp-d16
463441
portentac33.build.architecture=cortex-m33
464-
portentac33.compiler.zephyr.arch.define=
465442

466443
portentac33.build.float-abi=-mfloat-abi=hard
467444
portentac33.build.extra_flags=
468445
portentac33.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
469446
portentac33.build.board=ARDUINO_PORTENTA_C33
470-
portentac33.compiler.zephyr.arch.define=
471-
portentac33.compiler.zephyr=
472447
portentac33.vid.0=0x2341
473448
portentac33.pid.0=0x0068
474449
portentac33.upload_port.0.vid=0x2341
@@ -517,14 +492,12 @@ opta.build.variant=arduino_opta_stm32h747xx_m7
517492
opta.build.mcu=cortex-m7
518493
opta.build.fpu=-mfpu=fpv5-d16
519494
opta.build.architecture=cortex-m7
520-
opta.compiler.zephyr.arch.define=-DCORE_CM7
521495

522496
opta.build.float-abi=-mfloat-abi=softfp
523497
opta.build.extra_flags=
524498
opta.build.postbuild.cmd="{tools.imgtool.path}/{tools.imgtool.cmd}" exit
525499
opta.build.architecture=cortex-m7
526500
opta.build.board=ARDUINO_OPTA
527-
opta.compiler.zephyr=
528501
opta.vid.0=0x2341
529502
opta.pid.0=0x0064
530503
opta.upload_port.0.vid=0x2341

extra/build.sh

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,17 @@ for ext in elf bin hex; do
9090
done
9191

9292
# Generate the provides.ld file for linked builds
93-
echo "Exporting provides.ld"
94-
READELF=${ZEPHYR_SDK_INSTALL_DIR}/arm-zephyr-eabi/bin/arm-zephyr-eabi-readelf
95-
GDB=${ZEPHYR_SDK_INSTALL_DIR}/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb
96-
$READELF --wide -s ${BUILD_DIR}/zephyr/zephyr.elf | grep FUNC | awk -F' ' '{print "PROVIDE("$8" = 0x"$2");"}' > ${VARIANT_DIR}/provides.ld
97-
$READELF --wide -s ${BUILD_DIR}/zephyr/zephyr.elf | grep kheap_llext_heap | awk -F' ' '{print "PROVIDE("$8" = 0x"$2");"}' >> ${VARIANT_DIR}/provides.ld
98-
$READELF --wide -s ${BUILD_DIR}/zephyr/zephyr.elf | grep kheap_llext_heap | awk -F' ' '{print "PROVIDE(kheap_llext_heap_size = "$3");"}' >> ${VARIANT_DIR}/provides.ld
99-
$READELF --wide -s ${BUILD_DIR}/zephyr/zephyr.elf | grep kheap__system_heap | awk -F' ' '{print "PROVIDE("$8" = 0x"$2");"}' >> ${VARIANT_DIR}/provides.ld
100-
$READELF --wide -s ${BUILD_DIR}/zephyr/zephyr.elf | grep kheap__system_heap | awk -F' ' '{print "PROVIDE(kheap__system_heap_size = "$3");"}' >> ${VARIANT_DIR}/provides.ld
101-
cat ${BUILD_DIR}/zephyr/zephyr.map | grep __device_dts_ord | grep -v rodata | grep -v llext_const_symbol | awk -F' ' '{print "PROVIDE("$2" = "$1");"}' >> ${VARIANT_DIR}/provides.ld
102-
#TEXT_START=`cat variants/$variant/$variant.overlay | grep user_sketch: | cut -f2 -d"@" | cut -f1 -d"{"`
103-
TEXT_START=`$GDB --quiet -ex "p/x sketch_base_addr" ${BUILD_DIR}/zephyr/zephyr.elf -ex "exit" | grep "= 0x" | cut -f 2 -d"="`
104-
echo "PROVIDE(_sketch_start = $TEXT_START);" >> ${VARIANT_DIR}/provides.ld
105-
106-
sed -i 's/PROVIDE(malloc =/PROVIDE(__wrap_malloc =/g' ${VARIANT_DIR}/provides.ld
107-
sed -i 's/PROVIDE(free =/PROVIDE(__wrap_free =/g' ${VARIANT_DIR}/provides.ld
108-
sed -i 's/PROVIDE(realloc =/PROVIDE(__wrap_realloc =/g' ${VARIANT_DIR}/provides.ld
109-
sed -i 's/PROVIDE(calloc =/PROVIDE(__wrap_calloc =/g' ${VARIANT_DIR}/provides.ld
110-
sed -i 's/PROVIDE(random =/PROVIDE(__wrap_random =/g' ${VARIANT_DIR}/provides.ld
93+
echo "Generating exported symbol scripts"
94+
extra/gen_provides.py "${BUILD_DIR}/zephyr/zephyr.elf" -L > ${VARIANT_DIR}/syms-dynamic.ld
95+
extra/gen_provides.py "${BUILD_DIR}/zephyr/zephyr.elf" -LF \
96+
"+kheap_llext_heap" \
97+
"+kheap__system_heap" \
98+
"*sketch_base_addr=_sketch_start" \
99+
"*sketch_max_size=_sketch_max_size" \
100+
"malloc=__wrap_malloc" \
101+
"free=__wrap_free" \
102+
"realloc=__wrap_realloc" \
103+
"calloc=__wrap_calloc" \
104+
"random=__wrap_random" > ${VARIANT_DIR}/syms-static.ld
111105

112106
cmake -P extra/gen_arduino_files.cmake $variant

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy