|
| 1 | +# Arduino Zephyr llext Core and platform. |
| 2 | +# |
| 3 | +# For more info: |
| 4 | +# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification |
| 5 | + |
| 6 | +name=Arduino Zephyr Boards (llext) |
| 7 | +version=9.9.9 |
| 8 | + |
| 9 | +# Compile variables |
| 10 | +# ------------------------ |
| 11 | + |
| 12 | +compiler.warning_flags=-w |
| 13 | +compiler.warning_flags.none=-w |
| 14 | +compiler.warning_flags.default= |
| 15 | +compiler.warning_flags.more=-Wall |
| 16 | +compiler.warning_flags.all=-Wall -Wextra |
| 17 | + |
| 18 | +compiler.path={build.compiler_path} |
| 19 | +compiler.c.cmd={build.crossprefix}gcc |
| 20 | +compiler.c.flags=-g -c {compiler.warning_flags} {compiler.zephyr.defines} {compiler.zephyr.cflags} {compiler.zephyr.arch.define} -MMD -mcpu={build.mcu} {build.float-abi} {build.fpu} |
| 21 | +compiler.c.elf.cmd={build.crossprefix}g++ |
| 22 | +compiler.c.elf.flags=-r -Wl,--gc-sections -e main |
| 23 | +compiler.S.cmd={build.crossprefix}g++ |
| 24 | +compiler.S.flags=-c -x assembler-with-cpp -mcpu={build.mcu} {build.fpu} |
| 25 | +compiler.cpp.cmd={build.crossprefix}g++ |
| 26 | +compiler.cpp.flags=-g -Os -c {compiler.warning_flags} {compiler.zephyr.defines} {compiler.zephyr.cxxflags} {compiler.zephyr.arch.define} -MMD -mcpu={build.mcu} {build.float-abi} {build.fpu} |
| 27 | +compiler.ar.cmd={build.crossprefix}ar |
| 28 | +compiler.ar.flags=rcs |
| 29 | +compiler.objcopy.cmd= |
| 30 | +compiler.objcopy.eep.flags= |
| 31 | +compiler.elf2hex.bin.flags=-O binary |
| 32 | +compiler.elf2hex.hex.flags=-O ihex -R .eeprom |
| 33 | +compiler.elf2hex.cmd={build.crossprefix}objcopy |
| 34 | +compiler.ldflags= |
| 35 | +compiler.libraries.ldflags= |
| 36 | +compiler.size.cmd={build.crossprefix}size |
| 37 | +compiler.define=-DARDUINO= |
| 38 | + |
| 39 | +# this can be overriden in boards.txt |
| 40 | +build.extra_flags= |
| 41 | +build.extra_ldflags= |
| 42 | +compiler.zephyr= |
| 43 | +build.ldscript={runtime.platform.path}/variants/llext/linker_script.ld |
| 44 | + |
| 45 | +# These can be overridden in platform.local.txt |
| 46 | +compiler.c.extra_flags= |
| 47 | +compiler.c.elf.extra_flags= |
| 48 | +compiler.S.extra_flags= |
| 49 | +compiler.cpp.extra_flags= |
| 50 | +compiler.ar.extra_flags= |
| 51 | +compiler.objcopy.eep.extra_flags= |
| 52 | +compiler.elf2hex.extra_flags= |
| 53 | + |
| 54 | +# {build.library_discovery_phase} is set to 1 by the builder during library discovery. |
| 55 | +# (this is available since arduino-builder>=1.5.5, keeping the default here for backward compatiblity) |
| 56 | +build.library_discovery_phase=0 |
| 57 | +build.library_discovery_phase_flag=-DARDUINO_LIBRARY_DISCOVERY_PHASE={build.library_discovery_phase} |
| 58 | + |
| 59 | +# USB Flags |
| 60 | +# --------- |
| 61 | +build.usb_flags= |
| 62 | + |
| 63 | +# Default usb manufacturer will be replaced at compile time using |
| 64 | +# numeric vendor ID if available or by board's specific value. |
| 65 | +#build.usb_manufacturer="Unknown" |
| 66 | + |
| 67 | +build.zip.pattern={recipe.size.pattern} |
| 68 | + |
| 69 | +# Linux compile patterns |
| 70 | +# ----------------------- |
| 71 | + |
| 72 | +## Compile c files |
| 73 | +recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_ARCH_ZEPHYR {build.library_discovery_phase_flag} {build.extra_flags} {build.extra_ldflags} {compiler.c.extra_flags} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" {includes} "-iprefix{build.variant.path}" "@{compiler.zephyr.includes}" -o "{object_file}" "{source_file}" |
| 74 | + |
| 75 | +## Compile c++ files |
| 76 | +recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_ARCH_ZEPHYR {build.library_discovery_phase_flag} {includes} {build.extra_flags} {build.extra_ldflags} {compiler.cpp.extra_flags} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" "-iprefix{build.variant.path}" "@{compiler.zephyr.includes}" "{source_file}" -o "{object_file}" |
| 77 | + |
| 78 | +## Compile asm files |
| 79 | +recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_ARCH_ZEPHYR {includes} {build.extra_flags} {build.extra_ldflags} {compiler.cpp.extra_flags} "-I{build.core.path}/api/deprecated" "-I{build.core.path}/api/deprecated-avr-comp" "-iprefix{build.variant.path}" "@{compiler.zephyr.includes}" "{source_file}" -o "{object_file}" |
| 80 | + |
| 81 | +## Create archives |
| 82 | +recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" |
| 83 | + |
| 84 | +## Combine gc-sections, archives, and objects |
| 85 | +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {build.extra_flags} {build.extra_ldflags} {compiler.zephyr.ldflags} "-T{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" {compiler.zephyr} {compiler.zephyr.extra_ldflags} {compiler.libraries.ldflags} |
| 86 | +#recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {build.extra_flags} {build.extra_ldflags} {compiler.zephyr.ldflags} "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" {compiler.zephyr} {compiler.zephyr.extra_ldflags} {compiler.libraries.ldflags} |
| 87 | + |
| 88 | +## Create eeprom |
| 89 | +recipe.objcopy.eep.pattern= |
| 90 | + |
| 91 | +## Create output (bin file) |
| 92 | +recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.bin.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin" |
| 93 | + |
| 94 | +## Create output (hex file) |
| 95 | +recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex" |
| 96 | + |
| 97 | +## Mangle the file |
| 98 | +recipe.hooks.objcopy.postobjcopy.1.pattern="{compiler.path}{build.crossprefix}strip" --strip-debug {build.path}/{build.project_name}.elf -o{build.path}/{build.project_name}.llext |
| 99 | +recipe.hooks.objcopy.postobjcopy.2.pattern={runtime.tools.zephyr-post-build-tool.path}/post_build {build.path}/{build.project_name}.llext {post_build_arg} |
| 100 | + |
| 101 | +## Compute size |
| 102 | +recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" |
| 103 | +recipe.size.regex.data=^(?:\.data|\.bss)\s+([0-9]+).* |
| 104 | +recipe.size.regex=^(?:\.data|\.text|\.rodata)\S*?\s+([0-9]+).* |
| 105 | + |
| 106 | +## Save hex |
| 107 | +recipe.output.tmp_file={build.project_name}.llext |
| 108 | +recipe.output.save_file={build.project_name}.{build.variant}.llext |
| 109 | + |
| 110 | + |
| 111 | +# Required discoveries and monitors |
| 112 | +# --------------------------------- |
| 113 | +pluggable_discovery.required.0=builtin:serial-discovery |
| 114 | +pluggable_discovery.required.1=builtin:mdns-discovery |
| 115 | +pluggable_monitor.required.serial=builtin:serial-monitor |
| 116 | + |
| 117 | + |
| 118 | +# Uploader tools |
| 119 | +# -------------- |
| 120 | + |
| 121 | +# |
| 122 | +# OpenOCD |
| 123 | +# |
| 124 | +tools.openocd.path={runtime.tools.openocd-0.11.0-arduino2.path} |
| 125 | +tools.openocd.cmd=bin/openocd |
| 126 | +tools.openocd.cmd.windows=bin/openocd.exe |
| 127 | + |
| 128 | +tools.openocd.upload.params.verbose=-d2 |
| 129 | +tools.openocd.upload.params.quiet=-d0 |
| 130 | +tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" {bootloader.programmer} {upload.transport} {bootloader.config} -c "telnet_port disabled; init; reset init; halt; adapter speed 10000; program {{build.path}/{build.project_name}.elf}; reset run; shutdown" |
| 131 | + |
| 132 | +tools.openocd.program.params.verbose=-d2 |
| 133 | +tools.openocd.program.params.quiet=-d0 |
| 134 | +tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" {bootloader.programmer} {upload.transport} {bootloader.config} -c "telnet_port disabled; init; reset init; halt; adapter speed 10000; program {{build.path}/{build.project_name}.elf}; reset run; shutdown" |
| 135 | + |
| 136 | +tools.openocd.erase.params.verbose=-d2 |
| 137 | +tools.openocd.erase.params.quiet=-d0 |
| 138 | +tools.openocd.erase.pattern= |
| 139 | + |
| 140 | +tools.openocd.bootloader.params.verbose=-d2 |
| 141 | +tools.openocd.bootloader.params.quiet=-d0 |
| 142 | +tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" {bootloader.programmer} {upload.transport} {bootloader.config} -c "telnet_port disabled; init; reset init; halt; adapter speed 10000; {bootloader.extra_action.preflash}; program {{runtime.platform.path}/bootloaders/{bootloader.file}}; reset run; shutdown" |
| 143 | + |
| 144 | +# |
| 145 | +# BOSSA |
| 146 | +# |
| 147 | +tools.bossac.path={runtime.tools.bossac-1.9.1-arduino2.path} |
| 148 | +tools.bossac.cmd=bossac |
| 149 | +tools.bossac.cmd.windows=bossac.exe |
| 150 | + |
| 151 | +tools.bossac.upload.params.verbose=-d |
| 152 | +tools.bossac.upload.params.quiet= |
| 153 | +tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U -i -e -w "{build.path}/{build.project_name}.llext.dfu" --offset {upload.address} -R |
| 154 | + |
| 155 | +tools.bossac.bootloader.params.verbose=-d |
| 156 | +tools.bossac.bootloader.params.quiet= |
| 157 | +tools.bossac.bootloader.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U -i -e -w "{runtime.platform.path}/firmwares/{bootloader.file}" --offset {bootloader.address} -R |
| 158 | + |
| 159 | +tools.bossac.erase.params.verbose= |
| 160 | +tools.bossac.erase.params.quiet= |
| 161 | +tools.bossac.erase.pattern= |
| 162 | + |
| 163 | +# |
| 164 | +# STM32FLASH |
| 165 | +# |
| 166 | +tools.stm32flash.cmd=stm32flash |
| 167 | +tools.stm32flash.path={runtime.platform.path}/tools/windows |
| 168 | +tools.stm32flash.path.macosx={runtime.platform.path}/tools/macosx |
| 169 | +tools.stm32flash.path.linux={runtime.platform.path}/tools/linux |
| 170 | +tools.stm32flash.upload.params.verbose=-v |
| 171 | +tools.stm32flash.upload.params.quiet= |
| 172 | +tools.stm32flash.upload.pattern="{path}/{cmd}" {serial.port} -e 1024 -b 2400 -w "{build.path}/{build.project_name}.bin" |
| 173 | +tools.stm32flash.program.params.verbose=-v |
| 174 | +tools.stm32flash.program.params.quiet= |
| 175 | +tools.stm32flash.program.pattern="{path}/{cmd}" {serial.port} -e 1024 -b 2400 -w "{build.path}/{build.project_name}.bin" |
| 176 | +tools.stm32flash.erase.params.verbose=-v |
| 177 | +tools.stm32flash.erase.params.quiet= |
| 178 | +tools.stm32flash.erase.pattern="{path}/{cmd}" {serial.port} -e 1024 -b 2400 |
| 179 | + |
| 180 | +# |
| 181 | +# DFU_UTIL |
| 182 | +# |
| 183 | +tools.dfu-util.path={runtime.tools.dfu-util.path} |
| 184 | +tools.dfu-util.cmd=dfu-util |
| 185 | +tools.dfu-util.upload.params.verbose=-d |
| 186 | +tools.dfu-util.upload.params.quiet= |
| 187 | +tools.dfu-util.upload.pattern="{path}/{cmd}" --device ,{upload.vid}:{upload.pid} -D "{build.path}/{build.project_name}.llext.dfu" -a{upload.interface} --dfuse-address={upload.address}:leave |
| 188 | + |
| 189 | +tools.dfu-util.bootloader.params.verbose=-d |
| 190 | +tools.dfu-util.bootloader.params.quiet= |
| 191 | +tools.dfu-util.bootloader.pattern="{path}/{cmd}" --device ,{bootloader.vid}:{bootloader.pid} -D "{runtime.platform.path}/firmwares/{bootloader.file}" -a{bootloader.interface} --dfuse-address={bootloader.address}:leave |
| 192 | + |
| 193 | +tools.dfu-util.erase.params.verbose= |
| 194 | +tools.dfu-util.erase.params.quiet= |
| 195 | +tools.dfu-util.erase.pattern= |
| 196 | + |
| 197 | +# |
| 198 | +# PICOTOOL |
| 199 | +# |
| 200 | +tools.picotool.path={runtime.tools.rp2040tools.path} |
| 201 | +tools.picotool.cmd=rp2040load |
| 202 | +tools.picotool.upload.params.verbose=-v |
| 203 | +tools.picotool.upload.params.quiet= |
| 204 | +tools.picotool.upload.pattern="{path}/{cmd}" {upload.verbose} -D "{build.path}/{build.project_name}.elf" |
| 205 | + |
| 206 | +# |
| 207 | +# IMGTOOL |
| 208 | +# |
| 209 | + |
| 210 | +tools.imgtool.path={runtime.tools.imgtool.path} |
| 211 | +tools.imgtool.cmd=imgtool |
| 212 | +tools.imgtool.flags=sign --key "{build.keys.keychain}/{build.keys.sign_key}" --encrypt "{build.keys.keychain}/{build.keys.encrypt_key}" "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.bin" --align {build.alignment} --max-align {build.alignment} --version {build.version} --header-size {build.header_size} --pad-header --slot-size {build.slot_size} |
| 213 | + |
| 214 | +# |
| 215 | +# ADB WRAPPER |
| 216 | +# |
| 217 | + |
| 218 | +tools.adb.path={runtime.tools.adb.path} |
| 219 | +tools.adb.cmd=adb |
| 220 | +tools.adb.upload.params.verbose=-v |
| 221 | +tools.adb.upload.params.quiet= |
| 222 | +tools.adb.upload.pattern="{path}/{cmd}" push "{build.path}/{build.project_name}.elf" "/tmp/arduino/m4-user-sketch.elf" |
| 223 | + |
| 224 | +# |
| 225 | +# PYOCD WRAPPER |
| 226 | +# |
| 227 | + |
| 228 | +# TODO: at the moment, install pyocd manually (with provided script) |
| 229 | +#tools.pyocd.path={runtime.tools.pyocd.path} |
| 230 | +tools.pyocd.path= |
| 231 | +tools.pyocd.cmd=pyocd |
| 232 | +tools.pyocd.upload.params.verbose= |
| 233 | +tools.pyocd.upload.params.quiet= |
| 234 | +tools.pyocd.upload.pattern="{cmd}" load --target {upload.target} {build.path}/{build.project_name}.llext.dfu.bin@{upload.address} |
| 235 | + |
| 236 | +tools.pyocd.bootloader.params.verbose= |
| 237 | +tools.pyocd.bootloader.params.quiet= |
| 238 | +tools.pyocd.bootloader.pattern="{cmd}" load --target {bootloader.target} "{runtime.platform.path}/firmwares/{bootloader.file}" |
| 239 | + |
| 240 | +tools.pyocd.erase.params.verbose= |
| 241 | +tools.pyocd.erase.params.quiet= |
| 242 | +tools.pyocd.erase.pattern= |
| 243 | + |
| 244 | + |
| 245 | +# |
| 246 | +# JLinkExe WRAPPER |
| 247 | +# |
| 248 | + |
| 249 | +tools.jlink.path={runtime.tools.jlink.path} |
| 250 | +tools.jlink.cmd.linux=JLinkExe |
| 251 | +tools.jlink.cmd.windows=JLink.exe |
| 252 | +tools.jlink.cmd.darwin=JLinkExe |
| 253 | +tools.jlink.upload.params.verbose=-v |
| 254 | +tools.jlink.upload.params.quiet= |
| 255 | +tools.jlink.upload.pattern="{path}/{cmd}" -CommanderScript "{build.path}/flasher.jlink" |
| 256 | + |
| 257 | + |
| 258 | +# |
| 259 | +# Debugger |
| 260 | +# |
| 261 | + |
| 262 | +tools.gdb.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/ |
| 263 | +tools.gdb.cmd=arm-none-eabi-gdb |
| 264 | +tools.gdb.cmd.windows=arm-none-eabi-gdb.exe |
| 265 | + |
| 266 | +debug.executable={build.path}/{build.project_name}.elf |
| 267 | +debug.toolchain=gcc |
| 268 | +debug.toolchain.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/ |
| 269 | +debug.toolchain.prefix=arm-none-eabi |
| 270 | +debug.server=openocd |
| 271 | +debug.server.openocd.path={runtime.tools.openocd-0.11.0-arduino2.path}/bin/openocd |
| 272 | +debug.server.openocd.scripts_dir={runtime.tools.openocd-0.11.0-arduino2.path}/share/openocd/scripts/ |
| 273 | + |
| 274 | +debug.cortex-debug.custom.postAttachCommands.0=set remote hardware-watchpoint-limit 2 |
| 275 | +debug.cortex-debug.custom.postAttachCommands.1=monitor reset halt |
| 276 | +debug.cortex-debug.custom.postAttachCommands.2=monitor gdb_sync |
| 277 | +debug.cortex-debug.custom.postAttachCommands.3=c |
| 278 | +debug.cortex-debug.custom.overrideRestartCommands.0=monitor reset halt |
| 279 | +debug.cortex-debug.custom.overrideRestartCommands.1=monitor gdb_sync |
| 280 | +debug.cortex-debug.custom.overrideRestartCommands.2=c |
0 commit comments