Skip to content

Commit

Permalink
update board.txt and platform.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
strongwong committed Sep 15, 2023
1 parent a3e221b commit e658f16
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
6 changes: 3 additions & 3 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ BL618G0.build.ldscript=linker_script.ld
# BL618G0.build.extra_flags = -march=rv32imafcpzpsfoperand_xtheade -mabi=ilp32f -mtune=e907

# BL618G0.compiler.sdk.defines={build.variant.path}/defines.txt
BL618G0.compiler.sdk.ldflags={build.variant.path}/ldflags.txt
# BL618G0.compiler.sdk.ldflags={build.variant.path}/ldflags.txt
# BL618G0.compiler.sdk.cflags={build.variant.path}/cflags.txt
# BL618G0.compiler.sdk.cxxflags={build.variant.path}/cxxflags.txt
# BL618G0.compiler.sdk.includes={build.variant.path}/includes.txt
BL618G0.compiler.sdk.extra_ldflags=-lm -lc -lgcc
# BL618G0.compiler.sdk.extra_ldflags=-lm -lc -lgcc -lstdc++

# BL618G0.compiler.sdk.libapp="{build.variant.path}/libs/libapp.a"
# BL618G0.compiler.sdk.liblhal="{build.variant.path}/libs/liblhal.a"
Expand All @@ -31,7 +31,7 @@ BL618G0.compiler.sdk.extra_ldflags=-lm -lc -lgcc
# BL618G0.compiler.sdk.libdsp="{build.variant.path}/libs/libcsi_xt900p32f_dsp.a"
# BL618G0.compiler.sdk.libfreertos="{build.variant.path}/libs/libfreertos.a"

BL618G0.compiler.sdk.wholebin_conf_path={build.variant.path}\config
BL618G0.compiler.sdk.wholebin_conf_path={build.variant.path}/config

BL618G0.compiler.c.extra_flags=
BL618G0.compiler.cpp.extra_flags=
Expand Down
4 changes: 4 additions & 0 deletions cores/bl616/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

// Weak empty variant initialization function.
// May be redefined by variant files.

extern "C" {
__attribute__((weak)) void wifi_event_handler() { }
}
void initVariant() __attribute__((weak));
void initVariant() { }

Expand Down
18 changes: 10 additions & 8 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ 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 -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.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,--gc-sections
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 -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=c++11 -Wno-error=cpp -Wextra -nostdlib -fno-rtti -fno-exceptions
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
Expand All @@ -49,6 +49,8 @@ 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
Expand Down Expand Up @@ -98,8 +100,8 @@ recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compil
## 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
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} "@{compiler.sdk.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.sdk.extra_ldflags} {compiler.libraries.ldflags} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf"
## 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=
Expand All @@ -120,7 +122,7 @@ 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
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"
Expand All @@ -141,5 +143,5 @@ 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
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

0 comments on commit e658f16

Please sign in to comment.