Repository navigation
Expand file tree
/
Copy pathlaze-project.yml
More file actions
1948 lines (1731 loc) · 47.3 KB
/
Copy pathlaze-project.yml
File metadata and controls
1948 lines (1731 loc) · 47.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
laze_required_version: 0.1.37
contexts:
# base context that all other contexts inherit from
- name: default
env:
bindir: "${build-dir}/bin/${builder}/${app}"
CARGO:
- ${CARGO_WRAPPER}
- cargo
tasks:
info-modules:
help: List modules selected in this configuration
build: false
cmd:
- echo ${modules} | tr ' ' '\n' | sort
# base context for all Ariel OS applications
- name: ariel-os
parent: default
selects:
- executor-default
- ?critical-section
- ?hw/device-identity
- ?lto
- ?semihosting
# Selecting default toolchain here. try xtensa, stable, nightly.
- ?xtensa
- ?stable
- ?nightly
env:
RUSTFLAGS:
- ${RUSTFLAGS_CONTEXTS}
SCRIPTS: ${relroot}/scripts
CARGO_ARGS:
- --config ${relroot}/${root}/ariel-os-cargo.toml
# While laze allows "export:" in rules and tasks to export laze
# variables to a rule's recipe shell environment, this would require
# those to be listed for *all* rules and tasks where they are needed.
# So until laze allows "global shell exporting of variables",
# "CARGO_ENV" is used for that.
CARGO_ENV:
- >-
OPENOCD_ARGS="${OPENOCD_ARGS}"
SCRIPTS=${SCRIPTS}
CONFIG_BOARD=${builder}
CARGO_BUILD_TARGET=${RUSTC_TARGET}
${CARGO_TARGET_PREFIX}_RUNNER=${CARGO_RUNNER}
${CARGO_TARGET_PREFIX}_RUSTFLAGS="${RUSTFLAGS}"
CARGO_TARGET_DIR=${relroot}/${build-dir}/bin/${builder}/cargo
CONFIG_EXECUTOR_STACKSIZE=${CONFIG_EXECUTOR_STACKSIZE}
CONFIG_ISR_STACKSIZE=${CONFIG_ISR_STACKSIZE}
PROFILE: release
PROFILE_DIR: $(if("${PROFILE}"=="dev", "debug", "${PROFILE}"))
QEMU_SYSTEM_ARM: >-
qemu-system-arm
-machine ${QEMU_MACHINE}
-nographic
-serial mon:stdio
-semihosting-config enable=on,target=native
-kernel
PROBE_RS_PROTOCOL: swd
CARGO_PRESHELL: []
# Stack size config
executor_stacksize_required_default: "8192"
isr_stacksize_required_default: "2048"
executor_stacksize_required:
# These defines the defaults. Other modules can append their needs,
# the maximum value will be chosen.
# Note: make sure to append to the list, not set single value!
- ${executor_stacksize_required_default}
isr_stacksize_required:
- ${isr_stacksize_required_default}
CONFIG_EXECUTOR_STACKSIZE: $(max (0, ${executor_stacksize_required}))
CONFIG_ISR_STACKSIZE: $(max (0, ${isr_stacksize_required}))
var_options:
# this turns ${FEATURES} from a list to "--features=feature1,feature2"
FEATURES:
start: --features=
joiner: ","
LOG:
joiner: ","
CARGO_PRESHELL:
# List of extra commands to be executed by the shell that runs cargo before cargo is run.
#
# This is typically used to source additional shell scripts that set up extra environment.
suffix: " && "
RUSTFLAGS_CONTEXTS:
from: contexts
prefix: --cfg context=\"
suffix: \"
# this prefixes `--protocol=` to `PROBE_RS_PROTOCOL`
PROBE_RS_PROTOCOL:
start: --protocol=
# Executor / ISR stacksize and heapsize helpers
executor_stacksize_required:
joiner: ", "
isr_stacksize_required:
joiner: ", "
heapsize_required:
joiner: " + "
rules:
- name: LINK
description: CARGO ${out}
pool: console
always: true
cmd: >-
test "${SKIP_CARGO_BUILD}" = "1" && exit 0;
cd ${relpath} && ${CARGO_PRESHELL} ${CARGO_ENV} ${CARGO} ${CARGO_TOOLCHAIN} ${CARGO_ARGS} build --profile=${PROFILE} ${FEATURES}
&& cp ${relroot}/${build-dir}/bin/${builder}/cargo/${RUSTC_TARGET}/${PROFILE_DIR}/${app} ${relroot}/${out}
${POST_LINK}
- name: GIT_DOWNLOAD
cmd: "D=$$(dirname ${out}); rm -rf $$D && git clone ${url} $$D -n && git -C $$D reset --hard ${commit} && touch ${out}"
tasks:
exec:
build: false
cmd:
- ${CARGO_PRESHELL} ${CARGO_ENV} $@
cargo:
workdir: ${relpath}
cmd:
- ${CARGO_PRESHELL} ${CARGO_ENV} ${CARGO} ${CARGO_TOOLCHAIN} ${CARGO_ARGS} $@
build: false
run:
build: false
workdir: ${appdir}
cmd:
- ${CARGO_PRESHELL} ${CARGO_ENV} ${CARGO} ${CARGO_TOOLCHAIN} ${CARGO_ARGS} run --profile=${PROFILE} ${FEATURES} $@
clippy:
build: false
workdir: ${appdir}
cmd:
- ${CARGO_PRESHELL} ${CARGO_ENV} ${CARGO} ${CARGO_TOOLCHAIN} ${CARGO_ARGS} clippy ${FEATURES} $@
expand:
build: false
workdir: ${appdir}
cmd:
- ${CARGO_PRESHELL} ${CARGO_ENV} ${CARGO} ${CARGO_TOOLCHAIN} ${CARGO_ARGS} expand ${FEATURES} $@
debug:
workdir: ${appdir}
cmd:
- ${CARGO_PRESHELL} ${CARGO_ENV} ${CARGO} ${CARGO_TOOLCHAIN} ${CARGO_ARGS} run --profile=${PROFILE} ${FEATURES} $@
build: false
ignore_ctrl_c: true
gdb:
cmd:
- arm-none-eabi-gdb -ex "target extended-remote localhost:1337" ${out} $@
build: false
ignore_ctrl_c: true
bloat:
workdir: ${appdir}
cmd:
- ${CARGO_PRESHELL} ${CARGO_ENV} ${CARGO} ${CARGO_TOOLCHAIN} ${CARGO_ARGS} bloat --profile=${PROFILE} ${FEATURES} $@
build: false
tree:
workdir: ${appdir}
cmd:
- ${CARGO_PRESHELL} ${CARGO_ENV} ${CARGO} ${CARGO_TOOLCHAIN} ${CARGO_ARGS} tree ${FEATURES} $@
build: false
size:
cmd:
- llvm-size ${out} $@
objdump:
cmd:
- rust-objdump -S ${out} $@
info-boards:
build: false
cmd:
- echo ${builder}
vscode-config:
help: Generate a VSCode configuration for selected board (select a board with -b)
build: false
# The --config arg in CARGO_ARGS is pointing to a file relative to the appdir, it makes more sense to generate the config in the appdir
workdir: ${appdir}
export:
- FEATURES
- CARGO_TARGET_PREFIX
- CARGO_ARGS
- CARGO_ENV
cmd: # We have to obfuscate the variables to avoid cargo interpreting them since we're running a rust script
- _CARGO_TOOLCHAIN='${CARGO_TOOLCHAIN}' _RUSTFLAGS="${RUSTFLAGS}" ${relroot}/${root}/scripts/vscode.rs
- name: nrf
help: Nordic MCU support (based on embassy-nrf)
parent: ariel-os
selects:
- ?probe-rs
provides:
- has_device_identity
- has_swi
- sw/benchmark
- name: nrf51
parent: nrf
selects:
- cortex-m0
provides:
- has_hwrng
- name: nrf51822-xxaa
parent: nrf51
selects:
- ram-tiny
env:
PROBE_RS_CHIP: nrf51822_xxAA
- name: bbc-microbit-base
# this is a context, not a builder, to be used as parent by "bbc-microbit" and
# "bbc-microbit-qemu"
parent: nrf51
selects:
- "bbc-microbit disabled due to missing nrf51 support in embassy"
env:
OPENOCD_ARGS:
- "-f board/nordic_nrf52_dk.cfg"
- name: nrf52
parent: nrf
provides:
- has_hwrng
- has_storage_support
env:
CARGO_RUNNER:
- ${SCRIPTS}/debug-openocd.sh
OPENOCD_ARGS:
- "-f board/nordic_nrf52_dk.cfg"
- name: nrf52832
parent: nrf52
selects:
- cortex-m4f
provides:
- has_nrf_ble
env:
PROBE_RS_CHIP: nrf52832_xxAA
- name: nrf52833
parent: nrf52
selects:
- cortex-m4f
provides:
- has_nrf_ble
env:
PROBE_RS_CHIP: nrf52833_xxAA
- name: nrf52840
parent: nrf52
selects:
- cortex-m4f
provides:
- has_nrf_ble
env:
PROBE_RS_CHIP: nrf52840_xxAA
- name: nrf53
parent: nrf
- name: nrf5340
parent: nrf53
selects:
- cortex-m33f
provides:
- has_storage_support
env:
PROBE_RS_CHIP: nrf5340_xxAA
- name: nrf5340-net
parent: nrf53
selects:
- cortex-m33
provides:
- has_hwrng
- has_nrf_ble
# Currently hard-faults.
# - has_storage_support
disables:
# USB peripheral available only on app core
- usb
env:
PROBE_RS_CHIP: nrf5340_xxAA
help: nRF5340 Network Core support
- name: nrf91
parent: nrf
selects:
- cortex-m33f
- name: nrf9160
parent: nrf91
provides:
- has_storage_support
env:
PROBE_RS_CHIP: nRF9160_xxAA
- name: nrf9151
parent: nrf91
provides:
- has_storage_support
env:
# FIXME: probe-rs does not support the nRF9151_xxAA yet, because there is
# no CMSIS-Pack available
PROBE_RS_CHIP: nRF9160_xxAA
- name: rp
help: Raspberry Pi Pico (2) MCU support (based on embassy-rp)
parent: ariel-os
provides:
- has_hwrng
- has_swi
- sw/benchmark
- name: rp2040
parent: rp
selects:
# This module must stay before `cortex-m0-plus` to keep correct linker settings order.
- rp-link-arg
- cortex-m0-plus
- ?probe-rs
provides:
- has_multi_core_support
- has_storage_support
env:
PROBE_RS_CHIP: RP2040
CARGO_RUNNER:
- ${SCRIPTS}/debug-openocd.sh
OPENOCD_ARGS:
- "-f interface/cmsis-dap.cfg -f target/rp2040.cfg"
tasks:
debug-rs:
cmd:
- probe-rs debug --chip ${PROBE_RS_CHIP} --exe ${out} $@
- name: rp235xa
parent: rp
selects:
- cortex-m33f
- ?probe-rs
provides:
- has_multi_core_support
- has_storage_support
env:
PROBE_RS_CHIP: RP235x
CARGO_RUNNER:
- ${SCRIPTS}/debug-openocd.sh
OPENOCD_ARGS:
- "-f interface/cmsis-dap.cfg -f target/rp2040.cfg"
tasks:
flash:
cmd:
- picotool load -u -v -x -t elf ${out} $@
- name: esp
parent: ariel-os
selects:
- ?debug-console
- ?esp-println
provides:
- has_executor_single_thread_support
- has_hwrng
env:
RUSTFLAGS:
# linkall first
- -Clink-arg=-Tlinkall.x
# this might be needed for backtraces. it is needed for probe-rs.
- -C force-frame-pointers
- name: esp32
parent: esp
selects:
- xtensa
env:
RUSTC_TARGET: xtensa-esp32-none-elf
CARGO_TARGET_PREFIX: CARGO_TARGET_XTENSA_ESP32_NONE_ELF
CC: xtensa-esp32-elf-gcc
- name: esp-wroom-32
parent: esp32
- name: esp32-c3-mini-1
parent: esp32c3
- name: esp32c3
parent: esp
selects:
- riscv
provides:
- sw/benchmark
provides_unique: [c-function-abort]
env:
RUSTC_TARGET: riscv32imc-unknown-none-elf
PROBE_RS_CHIP: esp32c3
PROBE_RS_PROTOCOL: jtag
CARGO_TARGET_PREFIX: CARGO_TARGET_RISCV32IMC_UNKNOWN_NONE_ELF
- name: esp-c3-01m
parent: esp32c3
- name: esp32c6
parent: esp
selects:
- riscv
provides:
- sw/benchmark
provides_unique: [c-function-abort]
env:
RUSTC_TARGET: riscv32imac-unknown-none-elf
PROBE_RS_CHIP: esp32c6
PROBE_RS_PROTOCOL: jtag
CARGO_TARGET_PREFIX: CARGO_TARGET_RISCV32IMAC_UNKNOWN_NONE_ELF
- name: esp32-c6-wroom-1
parent: esp32c6
- name: esp32s3
parent: esp
selects:
- xtensa
provides:
- has_multi_core_support
- sw/benchmark
provides_unique: [c-function-abort]
env:
RUSTC_TARGET: xtensa-esp32s3-none-elf
PROBE_RS_CHIP: esp32s3
PROBE_RS_PROTOCOL: jtag
CARGO_TARGET_PREFIX: CARGO_TARGET_XTENSA_ESP32S3_NONE_ELF
CC: xtensa-esp32s3-elf-gcc
- name: esp32-s3-wroom-1
parent: esp32s3
- name: stm32
help: STM32 support (based on embassy-stm32)
parent: ariel-os
selects:
- ?probe-rs
provides:
- has_device_identity
- sw/benchmark
env:
OPENOCD_ARGS: foo
tasks:
flash-dfu:
cmd:
- llvm-objcopy -O binary ${out} ${out}.bin
- 'dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D ${out}.bin || echo "... Note: dfu-util sometimes fails despite the upload being correct."'
- name: stm32c031c6
parent: stm32
selects:
- cortex-m0-plus
disables:
# TODO: embedded-test currently hard-codes 16k for its thread
- embedded-test
env:
isr_stacksize_required_default: "1024"
executor_stacksize_required_default: "3072"
PROBE_RS_CHIP: STM32C031C6
- name: stm32f042k6
parent: stm32
selects:
- cortex-m0
- single-core
- ram-tiny
disables:
- semihosting
env:
isr_stacksize_required_default: "512"
executor_stacksize_required_default: "512"
PROBE_RS_CHIP: STM32F042K6
- name: stm32f401re
parent: stm32
selects:
- cortex-m4f
env:
PROBE_RS_CHIP: STM32F401RE
RUSTFLAGS:
- --cfg capability=\"async-flash-driver\"
- name: stm32f411re
parent: stm32
selects:
- cortex-m4f
env:
PROBE_RS_CHIP: STM32F411RE
- name: stm32f767zi
parent: stm32
selects:
- cortex-m7f
provides:
- has_hwrng
env:
PROBE_RS_CHIP: STM32F767ZITx
RUSTFLAGS:
- --cfg capability=\"hw/stm32-rng\"
- name: stm32h755zi
parent: stm32
selects:
# TODO: also has a cortex-m4f
- cortex-m7f
provides:
- has_hwrng
- has_storage_support
env:
PROBE_RS_CHIP: STM32H755ZI
RUSTFLAGS:
- --cfg capability=\"hw/stm32-dual-core\"
- --cfg capability=\"hw/stm32-hash-rng\"
- --cfg capability=\"hw/stm32-usb-synopsis\"
- name: stm32l475vg
parent: stm32
selects:
- cortex-m4f
provides:
- has_hwrng
- has_storage_support
env:
PROBE_RS_CHIP: STM32L475VG
RUSTFLAGS:
- --cfg capability=\"hw/stm32-rng\"
- --cfg capability=\"hw/stm32-usb-synopsis\" # Needs an external 32.768 kHz crystal to have a stable clock
- name: stm32u083mc
parent: stm32
selects:
- cortex-m0-plus
disables:
# TODO: not enough RAM for HTTP examples
- network
provides:
- has_hwrng
- has_storage_support
env:
PROBE_RS_CHIP: STM32U083MC
RUSTFLAGS:
- --cfg capability=\"hw/stm32-rng-cryp\"
- --cfg capability=\"hw/stm32-usb-drd-fs\"
- name: stm32u585ai
parent: stm32
selects:
- cortex-m33f
provides:
- has_hwrng
- has_storage_support
env:
PROBE_RS_CHIP: STM32U585AI
RUSTFLAGS:
- --cfg capability=\"hw/stm32-rng\"
- --cfg capability=\"hw/stm32-usb-synopsis\"
- name: stm32wb55rg
parent: stm32
selects:
- cortex-m4f
provides:
- has_hwrng
- has_storage_support
env:
PROBE_RS_CHIP: STM32WB55RG
RUSTFLAGS:
- --cfg capability=\"hw/stm32-rng\"
- --cfg capability=\"hw/stm32-usb-lp\"
- name: stm32wba55cg
parent: stm32
selects:
- cortex-m33f
provides:
- has_hwrng
env:
PROBE_RS_CHIP: STM32WBA55CG
RUSTFLAGS:
- --cfg capability=\"hw/stm32-rng\"
- name: stm32wle5jc
parent: stm32
selects:
- cortex-m4
provides:
- has_hwrng
- has_storage_support
env:
PROBE_RS_CHIP: STM32WLE5JC
RUSTFLAGS:
- --cfg capability=\"hw/stm32-rng\"
modules:
- name: thumbv6m-none-eabi
env:
global:
RUSTC_TARGET: thumbv6m-none-eabi
CARGO_TARGET_PREFIX: CARGO_TARGET_THUMBV6M_NONE_EABI
RUSTFLAGS:
- --cfg armv6m
- name: thumbv7m-none-eabi
env:
global:
RUSTC_TARGET: thumbv7m-none-eabi
CARGO_TARGET_PREFIX: CARGO_TARGET_THUMBV7M_NONE_EABI
RUSTFLAGS:
- --cfg armv7m
- name: thumbv7em-none-eabi
env:
global:
RUSTC_TARGET: thumbv7em-none-eabi
CARGO_TARGET_PREFIX: CARGO_TARGET_THUMBV7EM_NONE_EABI
RUSTFLAGS:
- --cfg armv7m
- name: thumbv7em-none-eabihf
env:
global:
RUSTC_TARGET: thumbv7em-none-eabihf
CARGO_TARGET_PREFIX: CARGO_TARGET_THUMBV7EM_NONE_EABIHF
RUSTFLAGS:
- --cfg armv7m
- --cfg armv7m_eabihf
- name: thumbv8m.main-none-eabi
env:
global:
RUSTC_TARGET: thumbv8m.main-none-eabi
CARGO_TARGET_PREFIX: CARGO_TARGET_THUMBV8M_MAIN_NONE_EABI
RUSTFLAGS:
- --cfg armv8m
- name: thumbv8m.main-none-eabihf
env:
global:
RUSTC_TARGET: thumbv8m.main-none-eabihf
CARGO_TARGET_PREFIX: CARGO_TARGET_THUMBV8M_MAIN_NONE_EABIHF
RUSTFLAGS:
- --cfg armv8m
- --cfg armv8m_eabihf
- name: cortex-m
env:
global:
OBJCOPY: arm-none-eabi-objcopy
RUSTFLAGS:
- -Clink-arg=${LINK_ARG_PREFIX}--nmagic
- -Clink-arg=${LINK_ARG_PREFIX}--no-eh-frame-hdr
- -Clink-arg=-Tlinkme.x
- -Clink-arg=-Tlink.x
- -Clink-arg=-Teheap.x
- -Clink-arg=-Tdevice.x
- -Clink-arg=-Tisr_stack.x
- --cfg context=\"cortex-m\"
- name: cortex-m0
selects:
- cortex-m
- thumbv6m-none-eabi
env:
global:
RUSTFLAGS:
- --cfg context=\"cortex-m0\"
- name: cortex-m0-plus
selects:
- cortex-m
- thumbv6m-none-eabi
env:
global:
RUSTFLAGS:
- --cfg context=\"cortex-m0-plus\"
- name: cortex-m4
selects:
- cortex-m
- thumbv7em-none-eabi
env:
global:
RUSTFLAGS:
- --cfg context=\"cortex-m4\"
- name: cortex-m4f
selects:
- cortex-m
- thumbv7em-none-eabihf
env:
global:
RUSTFLAGS:
- --cfg context=\"cortex-m4f\"
- name: cortex-m7f
selects:
- cortex-m
- thumbv7em-none-eabihf
env:
global:
RUSTFLAGS:
- --cfg context=\"cortex-m7f\"
- name: cortex-m33
selects:
- cortex-m
- thumbv8m.main-none-eabi
env:
global:
RUSTFLAGS:
- --cfg context=\"cortex-m33\"
- name: cortex-m33f
selects:
- cortex-m
- thumbv8m.main-none-eabihf
env:
global:
RUSTFLAGS:
- --cfg context=\"cortex-m33f\"
- name: xtensa
context:
- esp32
- esp32s3
provides_unique:
- cargo-toolchain
- nightly
conflicts:
# no xtensa in stable Rust
# this is implicit by `provides_unique: cargo-toolchain`, adding here for
# clarity
- stable
env:
global:
# xtensa needs a bit more isr stack.
isr_stacksize_required_default: "32768"
CARGO_TOOLCHAIN: +esp
RUSTFLAGS:
- --cfg context=\"xtensa\"
- --cfg nightly
- -Clink-arg=-Tisr_stack.x
CFLAGS:
- -mlongcalls
CARGO_ARGS:
- -Zbuild-std=core,alloc
CARGO_PRESHELL:
# ~/export-esp.sh is the common location, but espup install can
# override it with its --export-file argument, which is done in CI;
# the environment variable is used by espup and exported by its action.
#
# Note that one \ escapes for YAML, the reaming \ escapes for laze,
# and the second $ escapes for laze's internal ninja, resulting in
# the shell to see just ${ESPUP_...
- . $\\${ESPUP_EXPORT_FILE:-~/export-esp.sh}
- name: riscv
env:
global:
# riscv needs a bit more isr stack.
isr_stacksize_required_default: "4096"
RUSTFLAGS:
- --cfg context=\"riscv\"
- -Clink-arg=-Tisr_stack.x
- -Clink-arg=-Tlinkme-region-alias.x
- -Clink-arg=-Tlinkme.x
- name: rp-link-arg
help: helper module that ensures link-rp.x is added behind cortex-m ld scripts
env:
global:
RUSTFLAGS:
- "-Clink-arg=-Tlink-rp.x"
## System functionality modules
- name: alloc
help: Enables a heap, a global allocator and the `alloc` crate.
context: ariel-os
env:
global:
# *Append* to this array to increase the heapsize. The sum of all entries will
# be used. By default, all unused memory is used for the heap, and the sum
# is used to check if the amount of heap is actually available.
# On esp, it always allocates the sum of `heapsize_required`, but at least 2KiB.
heapsize_required:
- "0"
CARGO_ENV:
- CONFIG_HEAPSIZE=$(${heapsize_required})
FEATURES:
- ariel-os/alloc
- name: c-compiler
help: Configures a C compiler (which is used by build crates such as `cc`).
# This may later also check for whether a C compiler is present on the
# selected platform in the first place.
env:
global:
# It's fine if either is not set -- that is how the ARM platforms work,
# the `cc` crate figures out a good compiler. On ESP, things are not so
# solid, and the context contributes variables.
CARGO_ENV:
- CC="${CC}"
- CFLAGS="${CFLAGS}"
- name: debug-console
context: ariel-os
selects:
- ?debug-logging-facade-default
- ?panic-printing
env:
global:
FEATURES:
- ariel-os/debug-console
- name: emit-stack-sizes
conflicts:
- stable
env:
global:
RUSTFLAGS:
- -Clink-arg=-Tkeep-stack-sizes.x
- -Z emit-stack-sizes
- name: ram-tiny
help: This module marks boards with very little RAM (currently, <=16KiB)
conflicts:
# disabling alloc until we have a usable use case
- alloc
# embedded-test currently hard-codes a 16KiB stack for its thread
- embedded-test
# disabling as the default stack sizes are too small for log (defmt works)
- log
# disabling until we do have a driver/stack combo that works
- network
env:
global:
isr_stacksize_required_default: "512"
executor_stacksize_required_default: "512"
- name: stable
help: build with stable Rust
provides_unique:
- cargo-toolchain
env:
global:
# Using the empty string here, as specifying "+stable" would make rustup
# choose the *latest* stable instead of the currently configured version.
CARGO_TOOLCHAIN: ""
RUSTFLAGS:
- --cfg stable
- name: nightly
help: build with nightly Rust
provides_unique:
- cargo-toolchain
env:
global:
# this pins our nightly version
CARGO_TOOLCHAIN: +nightly-2025-02-25
RUSTFLAGS:
- --cfg nightly
# This module should be hard-selected when an application *requires* debug
# logging.
- name: debug-logging-facade-default
selects:
- ?defmt
- ?log
- debug-logging-facade
- name: defmt
help: Use the `defmt` crate as the debug logging facade
provides_unique:
- debug-logging-facade
env:
global:
FEATURES:
- ariel-os/defmt
RUSTFLAGS:
- -Clink-arg=-Tdefmt.x
ESPFLASH_LOG_FORMAT: "--log-format defmt"
CARGO_ENV:
- DEFMT_LOG=info,${LOG}
- name: log
help: Use the `log` crate as the debug logging facade
provides_unique:
- debug-logging-facade
env:
global:
FEATURES:
- ariel-os/log
CARGO_ENV:
- DEBUG_LOG_LEVEL=${LOG}
- name: panic-printing
context: ariel-os
env:
global:
FEATURES:
- ariel-os/panic-printing
- name: lto
context: ariel-os
env:
global:
RUSTFLAGS:
- -Cembed-bitcode=yes
- -Clto=fat
- -Ccodegen-units=1
- name: inline225
context: ariel-os
env:
global:
RUSTFLAGS:
- -Cllvm-args=-inline-threshold -Cllvm-args=225
- name: build_std
context: ariel-os
conflicts:
- stable
env:
global:
CARGO_ARGS:
- -Zbuild-std
- name: no_overflow_checks
context: ariel-os
env:
global:
RUSTFLAGS:
- -Coverflow-checks=off
- name: opt_speed
context: ariel-os
env:
global:
RUSTFLAGS:
- -Copt-level=3
# note: this overrides CFLAGS_OPT in ariel-os context
CFLAGS_OPT: -O3
- name: opt_size
context: ariel-os
env:
global:
RUSTFLAGS:
- -Copt-level=z
# note: this overrides CFLAGS_OPT in ariel-os context
CFLAGS_OPT: -Oz
- name: thread_info
# enable thread names & stack info
context: ariel-os
env:
global:
FEATURES:
- ariel-os/thread_info
- name: cross-language-lto
help: Enable cross-language LTO
# This requires rustc's llvm and clang's llvm version to match.
context: ariel-os
selects:
- lto
- linker-clang
env:
global:
RUSTFLAGS:
- "-Clinker-plugin-lto"
- name: linker-clang
help: Use clang/lld to link
context: ariel-os
env:
global:
RUSTFLAGS:
- "-Clinker=clang"
- "-Clink-arg=-fuse-ld=lld"