-
Notifications
You must be signed in to change notification settings - Fork 4
/
platform.txt
executable file
·147 lines (113 loc) · 11.8 KB
/
platform.txt
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
############################################################
# BL616/8 RISC-V WiFi6 + BT/BLE + ZigBee Chip
############################################################
name=BL616/8 RISC-V WiFi6 + BLE + ZigBee Chip (BouffaloLab)
version=1.0.0
## Compiler global definitions
# Compile variables
# ------------------------
compiler.warning_flags=-w
compiler.warning_flags.none=-w
compiler.warning_flags.default=
compiler.warning_flags.more=-Wall
compiler.warning_flags.all=-Wall -Wextra
compiler.path={build.compiler_path}
compiler.define="-I{compiler.path}../riscv64-unknown-elf/include"
compiler.c.cmd=riscv64-unknown-elf-gcc
# "@{compiler.sdk.defines}" "@{compiler.sdk.cflags}"
compiler.c.flags=-c {compiler.warning_flags} -D__riscv -D__riscv_xlen=32 -g3 -fno-jump-tables -fno-common -nostdlib -fno-exceptions -fms-extensions -ffunction-sections -fdata-sections -fmessage-length=0 -Wall -Wchar-subscripts -Wformat -Wundef -Wuninitialized -Winit-self -Wignored-qualifiers -fstrict-volatile-bitfields -fshort-enums -MMD -Wno-error=unused-variable -Wno-error=format= -Wno-error=unused-function -Wno-error=implicit-function-declaration -Wno-error=deprecated-declarations -fstack-usage -save-temps=obj -O2 -fno-builtin -march=rv32imafcpzpsfoperand_xtheade -mabi=ilp32f -mtune=e907 -std=gnu99
compiler.c.elf.cmd=riscv64-unknown-elf-gcc
compiler.c.elf.flags= {compiler.warning_flags} -Wl,--cref -Wl,--gc-sections -nostartfiles -fno-use-cxa-atexit -nostdlib -fno-rtti -fno-exceptions -fms-extensions -ffunction-sections -fdata-sections -ufw_header -Wl,-wrap,snprintf -Wl,-wrap,sprintf -march=rv32imafcpzpsfoperand_xtheade -mabi=ilp32f -mtune=e907
# -nostartfiles
compiler.S.cmd=riscv64-unknown-elf-gcc
# compiler.S.cmd=riscv64-unknown-elf-as
compiler.S.flags=-c -x assembler-with-cpp
compiler.cpp.cmd=riscv64-unknown-elf-g++
# "@{compiler.sdk.defines}" "@{compiler.sdk.cxxflags}"
compiler.cpp.flags=-c {compiler.warning_flags} -D__riscv -D__riscv_xlen=32 -g3 -fno-jump-tables -fno-common -fno-use-cxa-atexit -fms-extensions -ffunction-sections -fdata-sections -fmessage-length=0 -Wall -Wchar-subscripts -Wformat -Wundef -Wuninitialized -Winit-self -Wignored-qualifiers -fstrict-volatile-bitfields -fshort-enums -MMD -Wno-error=unused-variable -Wno-error=format= -Wno-error=unused-function -Wno-error=implicit-function-declaration -Wno-error=deprecated-declarations -Wno-format -fstack-usage -save-temps=obj -O2 -fno-builtin -march=rv32imafcpzpsfoperand_xtheade -mabi=ilp32f -mtune=e907 -std=gnu++11 -Wno-error=cpp -Wextra -nostdlib -fno-rtti -fno-exceptions
# nostdlib
compiler.ar.cmd=riscv64-unknown-elf-ar
compiler.ar.flags=rcs
compiler.objcopy.cmd=riscv64-unknown-elf-objcopy
compiler.objcopy.eep.flags=-O ihex
compiler.objcopy.bin.flags = -O binary
compiler.elf2hex.cmd=riscv64-unknown-elf-objcopy
compiler.elf2hex.flags = -O ihex
compiler.elf2hex.bin.flags=-O binary
compiler.elf2hex.hex.flags=-O ihex -R .eeprom
compiler.ld.cmd = riscv64-unknown-elf-gcc
compiler.ldflags=
compiler.libraries.ldflags=
compiler.ld.libs=-lm -lgcc -lc
# -lstdc++
compiler.dump.cmd = riscv64-unknown-elf-objdump
compiler.dump.flags= --disassemble-all
compiler.size.cmd=riscv64-unknown-elf-size
# this can be overriden in boards.txt
build.flags=
build.extra_flags=
build.extra_ldflags=
compiler.sdk.path={runtime.platform.path}/tools/bouffalo_sdk
# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.S.extra_flags=
compiler.cpp.extra_flags=
compiler.ar.extra_flags=
compiler.objcopy.eep.extra_flags=
compiler.objcopy.bin.extra_flags=
compiler.elf2hex.extra_flags=
compiler.dump.extra_flags=
compiler.ld.extra_flags=
compiler.c.elf.libs=-lapp -llhal -llibc -lmm -lstd -lutils -lpka -lcsi_xt900p32f_dsp -lfreertos -lshell -lbl6_os_adapter -ldhcpd -llwip -lmbedtls -lrf -lrfparam -lwifi6
compiler.cpreprocessor.flags=-DARCH_RISCV -DBFLB_TIMESTAMP_TIMEZONE=8 -DBFLB_USE_HAL_DRIVER -DBFLB_USE_ROM_DRIVER -DBL616 -DBOUFFALO_SDK -DBOUFFALO_SDK_VER=\"cf71fcf5-dirty\" -DCONFIG_CLI_CMD_ENABLE -DCONFIG_COREDUMP -DCONFIG_FREERTOS -DCONFIG_IRQ_NUM=80 -DCONFIG_LIBC_FLOAT=1 -DCONFIG_LIBC_FLOAT_EX=1 -DCONFIG_LIBC_LONG_LONG=1 -DCONFIG_LOG_LEVEL=3 -DCONFIG_LWIP -DCONFIG_MAC_RXQ_DEPTH=12 -DCONFIG_MAC_TXQ_DEPTH=32 -DCONFIG_MBEDTLS -DCONFIG_MBEDTLS_AES_USE_HW -DCONFIG_MBEDTLS_ECC_USE_HW -DCONFIG_MBEDTLS_SHA1_USE_HW -DCONFIG_MBEDTLS_SHA256_USE_HW -DCONFIG_MBEDTLS_SHA512_USE_HW -DCONFIG_POSIX -DCONFIG_PSRAM -DCONFIG_SHELL -DCONFIG_STA_MAX=4 -DCONFIG_TLSF -DCONFIG_VIF_MAX=2 -DMBEDTLS_CONFIG_FILE=\"mbedtls_sample_config.h\" -DMBEDTLS_NET_C -DRFPARAM_BL616 -DWL_BL616=1 -DWL_BL618M=0 -DWL_WB03=0 -DconfigSTACK_ALLOCATION_FROM_SEPARATE_HEAP=1 -Ddefault_interrupt_handler=freertos_risc_v_trap_handler -DportasmHANDLE_INTERRUPT=interrupt_entry "-I{compiler.sdk.path}/bsp/board/bl616dk" "-I{compiler.sdk.path}/components/crypto/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/components/crypto/mbedtls/port" "-I{compiler.sdk.path}/components/crypto/mbedtls/port/hw_acc" "-I{compiler.sdk.path}/components/libc/newlib" "-I{compiler.sdk.path}/components/libc" "-I{compiler.sdk.path}/components/mm" "-I{compiler.sdk.path}/components/mm/tlsf" "-I{compiler.sdk.path}/components/net/lwip/lwip/src/include/lwip" "-I{compiler.sdk.path}/components/net/lwip/lwip/lwip-port" "-I{compiler.sdk.path}/components/net/lwip/lwip/src/include" "-I{compiler.sdk.path}/components/net/lwip/lwip/src/include/compat/posix" "-I{compiler.sdk.path}/components/net/lwip/lwip_apps/dhcpd" "-I{compiler.sdk.path}/components/os/freertos/include" "-I{compiler.sdk.path}/components/os/freertos/portable/GCC/RISC-V/common" "-I{compiler.sdk.path}/components/os/freertos/portable/GCC/RISC-V/common/chip_specific_extensions/RV32I_CLINT_no_extensions" "-I{compiler.sdk.path}/components/os/freertos/posix/include" "-I{compiler.sdk.path}/components/os/freertos/posix/include/FreeRTOS_POSIX" "-I{compiler.sdk.path}/components/shell" "-I{compiler.sdk.path}/components/utils/log" "-I{compiler.sdk.path}/components/utils/ring_buffer" "-I{compiler.sdk.path}/components/utils/bflb_block_pool" "-I{compiler.sdk.path}/components/utils/bflb_timestamp" "-I{compiler.sdk.path}/components/utils/getopt" "-I{compiler.sdk.path}/components/utils/coredump" "-I{compiler.sdk.path}/components/utils/cjson" "-I{compiler.sdk.path}/components/utils/math/include" "-I{compiler.sdk.path}/components/wireless/wifi6/inc" "-I{compiler.sdk.path}/components/wireless/wifi6/bl6_os_adapter/include" "-I{compiler.sdk.path}/drivers/lhal/include" "-I{compiler.sdk.path}/drivers/lhal/include/hardware" "-I{compiler.sdk.path}/drivers/lhal/include/compiler" "-I{compiler.sdk.path}/drivers/lhal/include/arch" "-I{compiler.sdk.path}/drivers/lhal/include/arch/risc-v/t-head" "-I{compiler.sdk.path}/drivers/lhal/include/arch/risc-v/t-head/Core/Include" "-I{compiler.sdk.path}/drivers/lhal/include/arch/risc-v/t-head/csi_dsp/include" "-I{compiler.sdk.path}/drivers/lhal/config/bl616" "-I{compiler.sdk.path}/drivers/lhal/src/flash" "-I{compiler.sdk.path}/drivers/soc/bl616/std/include" "-I{compiler.sdk.path}/drivers/soc/bl616/std/include/hardware" "-I{compiler.sdk.path}/drivers/soc/bl616/rf/inc" "-I{compiler.sdk.path}/drivers/rfparam/Inc"
## Compile patterns
# --------------------------------------------------------
## Compiler c files
## "@{compiler.sdk.includes}"
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DARDUINO={runtime.ide.version} -D{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {build.extra_ldflags} {compiler.define} {compiler.c.extra_flags} {includes} "-iprefix{build.core.path}" "{source_file}" -o "{object_file}"
## Compiler cpp files
## "@{compiler.sdk.includes}"
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -DARDUINO={runtime.ide.version} -D{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {build.extra_ldflags} {compiler.define} {compiler.cpp.extra_flags} {includes} "-iprefix{build.core.path}" "{source_file}" -o "{object_file}"
## Compiler S files
## "@{compiler.sdk.includes}"
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -DARDUINO={runtime.ide.version} -D{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {build.extra_ldflags} {compiler.define} {compiler.cpp.extra_flags} {includes} "-iprefix{build.core.path}" "{source_file}" -o "{object_file}"
## Compiler archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
## Preprocess linker script
recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.elf.cmd}" -E -P -x c {build.extra_ldflags} "{build.variant.path}/{build.ldscript}" -o "{build.path}/{build.ldscript}"
## Combine gc-section, archives, and objects {compiler.sdk.extra_ldflags} "@{compiler.sdk.ldflags}"
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {build.extra_flags} {build.extra_ldflags} "-T{build.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" "-L{build.variant.path}/libs" --specs=nosys.specs {compiler.ldflags} -Wl,--whole-archive {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--no-whole-archive -Wl,--start-group {compiler.ld.libs} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf"
## Create eeprom
recipe.objcopy.eep.pattern=
## Create output files
recipe.objcopy.bin.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.bin.flags} {compiler.objcopy.bin.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
# recipe.objcopy.dump.pattern="{compiler.path}{compiler.dump.cmd}" {compiler.dump.flags} {compiler.dump.extra_flags} "{build.path}/{build.project_name}.elf" > "{build.path}/{build.project_name}.asm"
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
## Save hex
recipe.output.tmp_file={build.project_name}.bin
recipe.output.save_file={build.project_name}.{build.variant}.bin
## General whole bin file
compiler.output.bflb_fw_post_proc.path={runtime.tools.bflb_fw_post_proc.path}
compiler.output.bflb_fw_post_proc.cmd=bflb_fw_post_proc
compiler.output.bflb_fw_post_proc.cmd.windows=bflb_fw_post_proc.exe
compiler.output.bflb_fw_post_proc.cmd.linux=bflb_fw_post_proc-ubuntu
compiler.output.bflb_fw_post_proc.cmd.macosx=bflb_fw_post_proc-macos
# compiler.output.bflb_fw_post_proc.preupload.params=
recipe.objcopy.wholebin.pattern="{compiler.output.bflb_fw_post_proc.path}/{compiler.output.bflb_fw_post_proc.cmd}" --chipname={build.core} --brdcfgdir={compiler.sdk.wholebin_conf_path} --imgfile={build.path}/{build.project_name}.bin
## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex.data=^(?:\.data|\.bss)\s+([0-9]+).*
recipe.size.regex=^(?:\.data|\.text|\.rodata)\S*?\s+([0-9]+).*
#--------------------------------------------------------
## BouffaloLab Flash tools
#--------------------------------------------------------
tools.bflb_flash_tools.path={runtime.tools.bflb_flash_tools.path}
tools.bflb_flash_tools.cmd=BLFlashCommand
tools.bflb_flash_tools.cmd.windows=BLFlashCommand.exe
tools.bflb_flash_tools.cmd.linux=BLFlashCommand-ubuntu
tools.bflb_flash_tools.cmd.macosx=BLFlashCommand-macos
tools.bflb_flash_tools.upload.params.verbose=
tools.bflb_flash_tools.upload.params.quiet=
tools.bflb_flash_tools.upload.protocol=uart
tools.bflb_flash_tools.upload.pattern="{path}/{cmd}" --interface={upload.protocol} --chipname=bl616 --port={serial.port} --baudrate={upload.speed} --firmware={build.path}/{build.project_name}.bin