Platform
Platform
# 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 -Wno-unused-parameter -Wno-missing-field-
initializers -Wno-pointer-arith
compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
compiler.c.cmd=arm-none-eabi-gcc
compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.warning_flags}
{build.float_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib
--param max-inline-insns-single=500 -MMD
compiler.c.elf.cmd=arm-none-eabi-gcc
compiler.c.elf.flags=-Ofast -Wl,--gc-sections -save-temps
compiler.S.cmd=arm-none-eabi-gcc
compiler.S.flags=-c -g -x assembler-with-cpp
compiler.cpp.cmd=arm-none-eabi-g++
compiler.cpp.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.warning_flags}
{build.float_flags} -std=gnu++11 -ffunction-sections -fdata-sections -fno-
threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-
exceptions -MMD
compiler.ar.cmd=arm-none-eabi-ar
compiler.ar.flags=rcs
compiler.objcopy.cmd=arm-none-eabi-objcopy
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-
flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
compiler.elf2bin.flags=-O binary
compiler.elf2bin.cmd=arm-none-eabi-objcopy
compiler.elf2hex.flags=-O ihex
compiler.elf2hex.cmd=arm-none-eabi-objcopy
compiler.ldflags=-mcpu={build.mcu} -mthumb {build.float_flags} -Wl,--cref -Wl,--
check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-
common -Wl,--warn-section-align --specs=nano.specs --specs=nosys.specs
compiler.size.cmd=arm-none-eabi-size
# this can be overriden in boards.txt
build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float
build.debug_flags=-DCFG_DEBUG=0
# usb flags
build.flags.usb= -DUSBCON -DUSE_TINYUSB -DUSB_VID={build.vid} -DUSB_PID={build.pid}
'-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
# Compile patterns
# ----------------
## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags}
-DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board}
-DARDUINO_ARCH_{build.arch} -DARDUINO_BSP_VERSION="{version}"
{compiler.c.extra_flags} {build.extra_flags} {build.flags.nrf} {includes}
"{source_file}" -o "{object_file}"
## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags}
-DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board}
-DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags}
{build.flags.nrf} {includes} "{source_file}" -o "{object_file}"
## Create archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags}
{compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
## Save bin
recipe.output.tmp_file_bin={build.project_name}.bin
recipe.output.save_file_bin={build.project_name}.save.bin
## Save hex
recipe.output.tmp_file_hex={build.project_name}.hex
recipe.output.save_file_hexu={build.project_name}.save.hex
## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A
"{build.path}/{build.project_name}.elf"
recipe.size.regex=\.text\s+([0-9]+).*
recipe.size.regex.data=(\.data|\.bss|\.stack)\s+([0-9]+).*
#***************************************************
# adafruit-nrfutil for uploading
# https://github.com/adafruit/Adafruit_nRF52_nrfutil
# pre-built binaries are provided for macos and windows
#***************************************************
tools.nrfutil.cmd=adafruit-nrfutil
tools.nrfutil.cmd.windows={runtime.platform.path}/tools/adafruit-
nrfutil/win32/adafruit-nrfutil.exe
tools.nrfutil.cmd.macosx={runtime.platform.path}/tools/adafruit-
nrfutil/macos/adafruit-nrfutil
tools.nrfutil.upload.params.verbose=--verbose
tools.nrfutil.upload.params.quiet=
tools.nrfutil.upload.pattern="{cmd}" {upload.verbose} dfu serial -pkg
"{build.path}/{build.project_name}.zip" -p {serial.port} -b 115200 --singlebank
#***************************************************
# Burning bootloader with either jlink or nrfutil
#***************************************************
# Bootloader version
tools.bootburn.bootloader.file={runtime.platform.path}/bootloader/{build.variant}/
{build.variant}_bootloader-0.3.0_{build.sd_name}_{build.sd_version}
tools.bootburn.bootloader.params.verbose=
tools.bootburn.bootloader.params.quiet=
tools.bootburn.bootloader.pattern={program.burn_pattern}