|
| 1 | +# |
| 2 | +# Map of STM32 cube MX CMSIS HAL drivers to underlay maple libs |
| 3 | +# |
| 4 | +# configured by sheepdoll (Julie S Porter) 2015 |
| 5 | +# modified by Baram |
| 6 | +# For more info: |
| 7 | +# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification |
| 8 | +# http://stm32duino.com/ |
| 9 | +# http://oroca.org |
| 10 | + |
| 11 | +name=OpenCR |
| 12 | +version=1.0.0 |
| 13 | + |
| 14 | +compiler.warning_flags=-w -DDEBUG_LEVEL=DEBUG_NONE |
| 15 | +compiler.warning_flags.none=-w -DDEBUG_LEVEL=DEBUG_NONE |
| 16 | +compiler.warning_flags.default=-DDEBUG_LEVEL=DEBUG_NONE |
| 17 | +compiler.warning_flags.more=-Wall -DDEBUG_LEVEL=DEBUG_FAULT |
| 18 | +compiler.warning_flags.all=-Wall -Wextra -DDEBUG_LEVEL=DEBUG_ALL |
| 19 | + |
| 20 | +# compiler variables |
| 21 | +# ---------------------- |
| 22 | +compiler.path={runtime.tools.opencr_gcc.path}/bin/ |
| 23 | +compiler.c.cmd=arm-none-eabi-gcc |
| 24 | +compiler.c.flags=-c -g -O2 -std=gnu11 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 {compiler.warning_flags} -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -DBOARD_{build.variant} |
| 25 | +compiler.c.elf.cmd=arm-none-eabi-g++ |
| 26 | +compiler.c.elf.flags=-Os -Wl,--gc-sections |
| 27 | +compiler.S.cmd=arm-none-eabi-gcc |
| 28 | +compiler.S.flags=-c -g -x assembler-with-cpp -MMD |
| 29 | +compiler.cpp.cmd=arm-none-eabi-g++ |
| 30 | +compiler.cpp.flags=-c -g -O2 -std=gnu++11 -mfloat-abi=softfp -mfpu=fpv5-sp-d16 {compiler.warning_flags} -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_{build.variant} |
| 31 | +compiler.ar.cmd=arm-none-eabi-ar |
| 32 | +compiler.ar.flags=rcs |
| 33 | +compiler.objcopy.cmd=arm-none-eabi-objcopy |
| 34 | +compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 |
| 35 | +compiler.elf2hex.flags=-O binary |
| 36 | +compiler.elf2hex.cmd=arm-none-eabi-objcopy |
| 37 | +compiler.ldflags= |
| 38 | +compiler.size.cmd=arm-none-eabi-size |
| 39 | +compiler.define=-DARDUINO= |
| 40 | +compiler.libraries.ldflags= |
| 41 | + |
| 42 | + |
| 43 | +build.cpu_flags= |
| 44 | +build.hs_flag= |
| 45 | +build.upload_flags= |
| 46 | +#build.extra_flags= {build.upload_flags} {build.cpu_flags} {build.hs_flag} {build.common_flags} |
| 47 | + |
| 48 | + |
| 49 | +# These can be overridden in platform.local.txt |
| 50 | +compiler.c.extra_flags= |
| 51 | +compiler.c.elf.extra_flags="-L{build.variant.path}/ld" |
| 52 | +compiler.cpp.extra_flags= |
| 53 | +compiler.S.extra_flags= |
| 54 | +compiler.ar.extra_flags= |
| 55 | +compiler.elf2hex.extra_flags= |
| 56 | + |
| 57 | + |
| 58 | +## Compiler include paths |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +# sheepdoll a better more generic library include paths |
| 63 | +compiler.libs.c.flags= "-I{build.variant.path}/{build.inc1}" "-I{build.variant.path}/{build.inc2}" "-I{build.variant.path}/{build.inc3}" "-I{build.variant.path}/{build.inc4}" "-I{build.variant.path}/{build.inc5}" "-I{build.variant.path}/{build.inc6}" "-I{build.variant.path}/{build.inc7}" |
| 64 | + |
| 65 | + |
| 66 | +# build patterns |
| 67 | +# --------------------- |
| 68 | + |
| 69 | +## Compile c files |
| 70 | +recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {build.cpu_flags} {build.common_flags} {compiler.libs.c.flags} {includes} "{source_file}" -o "{object_file}" |
| 71 | +### |
| 72 | + |
| 73 | +## Compile c++ files |
| 74 | +recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {build.cpu_flags} {build.hs_flag} {build.common_flags} {compiler.libs.c.flags} {includes} "{source_file}" -o "{object_file}" |
| 75 | +#### {compiler.libs.c.flags} before includes |
| 76 | + |
| 77 | +## Compile S files |
| 78 | +recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.cpu_flags} {build.hs_flag} {build.common_flags} {compiler.libs.c.flags} {includes} "{source_file}" -o "{object_file}" |
| 79 | +recipe.s.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.cpu_flags} {build.hs_flag} {build.common_flags} {compiler.libs.c.flags} {includes} "{source_file}" -o "{object_file}" |
| 80 | + |
| 81 | + |
| 82 | +## Create archives |
| 83 | +recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" |
| 84 | +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} -Wl,--whole-archive "{build.path}/{archive_file}" -Wl,--no-whole-archive {compiler.libraries.ldflags} -Wl,--end-group |
| 85 | + |
| 86 | +## Create eeprom |
| 87 | +recipe.objcopy.eep.pattern= |
| 88 | + |
| 89 | +## Create hex or binary |
| 90 | +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}.bin" |
| 91 | + |
| 92 | +## Save binary |
| 93 | +recipe.output.tmp_file={build.project_name}.bin |
| 94 | +recipe.output.save_file={build.project_name}.{build.variant}.bin |
| 95 | + |
| 96 | + |
| 97 | +## Compute size |
| 98 | +# --------------------- |
| 99 | +recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" |
| 100 | +recipe.size.regex=^(?:\.text|\.data|\.rodata|\.text.align|\.ARM.exidx)\s+([0-9]+).* |
| 101 | +recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* |
| 102 | + |
| 103 | + |
| 104 | +# Uploader tools |
| 105 | +# ------------------- |
| 106 | +tools.opencr_ld.cmd=opencr_ld |
| 107 | +tools.opencr_ld.cmd.windows=opencr_ld.exe |
| 108 | +#tools.opencr_ld.path={runtime.hardware.path}/tools/win |
| 109 | +#tools.opencr_ld.path.macosx={runtime.hardware.path}/tools/macosx |
| 110 | +#tools.opencr_ld.path.linux={runtime.hardware.path}/tools/linux |
| 111 | +tools.opencr_ld.path={runtime.tools.opencr_tools.path}/win |
| 112 | +tools.opencr_ld.path.macosx={runtime.tools.opencr_tools.path}/macosx |
| 113 | +tools.opencr_ld.path.linux={runtime.tools.opencr_tools.path}/linux |
| 114 | + |
| 115 | +tools.opencr_ld.upload.params.verbose=-d |
| 116 | +tools.opencr_ld.upload.params.quiet=n |
| 117 | +tools.opencr_ld.upload.pattern="{path}/{cmd}" "{serial.port}" "115200" "{build.path}/{build.project_name}.bin" "1" |
| 118 | + |
| 119 | +tools.dfu_util.cmd=dfu-util |
| 120 | +tools.dfu_util.cmd.windows=dfu-util.exe |
| 121 | +tools.dfu_util.path={runtime.tools.opencr_tools.path}/win/dfu-util |
| 122 | +tools.dfu_util.path.macosx={runtime.tools.opencr_tools.path}/macosx/dfu-util |
| 123 | +tools.dfu_util.path.linux={runtime.tools.opencr_tools.path}/linux/dfu-util |
| 124 | + |
| 125 | +tools.dfu_util.erase.params.verbose=-v |
| 126 | +tools.dfu_util.erase.params.quiet=-q -q |
| 127 | +tools.dfu_util.erase.pattern= |
| 128 | + |
| 129 | +tools.dfu_util.bootloader.params.verbose=-v -v -v -v |
| 130 | +tools.dfu_util.bootloader.params.quiet=-q -q |
| 131 | +tools.dfu_util.bootloader.pattern="{path}/{cmd}" -d 0483:df11 -a 0 -s 0x08000000 -D "{runtime.platform.path}/bootloaders/{bootloader.file}" |
0 commit comments