Skip to content

Instantly share code, notes, and snippets.

@gjsman
Created February 22, 2020 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gjsman/83ef53f1c91d74989a5d403246021489 to your computer and use it in GitHub Desktop.
Save gjsman/83ef53f1c91d74989a5d403246021489 to your computer and use it in GitHub Desktop.
Platform.txt file for Energia on MSP-EXP432E401Y
# Energia MSP432E Core and platform.
# ------------------------------
#
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
name=Energia MSP432E (32-bits) Boards
version=5.19.0
# MSP432E 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={runtime.tools.arm-none-eabi-gcc-6.3.1-20170620.path}/bin/
compiler.c.cmd=arm-none-eabi-gcc
compiler.c.flags=-c -g -O0 {compiler.warning_flags} -ffunction-sections -fdata-sections -std=c99 -MMD
compiler.cpp.elf.cmd=arm-none-eabi-g++
compiler.c.elf.flags=-O0 -Wl,--gc-sections -specs=nano.specs -specs=rdimon.specs -specs=nosys.specs
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=-c -g -O0 {compiler.warning_flags} -ffunction-sections -fdata-sections -fno-threadsafe-statics -fno-rtti -fno-exceptions -std=c++98 -MMD
compiler.ar.cmd=arm-none-eabi-ar
compiler.ar.flags=rcPs
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.elf2hex.flags=-O binary
compiler.elf2hex.cmd=arm-none-eabi-objcopy
compiler.ldflags=
compiler.size.cmd=arm-none-eabi-size
#compiler.driverlib.c.flags=""
compiler.driverlib.c.flags="-I{build.system.path}/source/ti/devices/msp432e4/driverlib" "-I{build.system.path}/source/ti/devices/msp432e4/inc" "-I{build.system.path}/source/ti/devices/msp432e4/" "-I{build.system.path}/source/third_party/CMSIS/Include"
# compiler.emt.c.flags="-I{build.core.path}/ti/runtime/wiring/" "-I{build.core.path}/ti/runtime/wiring/msp432e" "-I{build.system.path}/kernel/tirtos/packages/ti/sysbios/posix" "-I{build.system.path}/source/ti/posix/gcc" "-I{build.system.path}/kernel/tirtos/packages" "-I{build.system.path}/source" "-I{build.system.path}/energia" -D_DEFAULT_SOURCE "-I{build.system.path}/kernel/tirtos/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include"
compiler.emt.c.flags="-I{build.system.path}/energia" "-I{build.core.path}/ti/runtime/wiring/" "-I{build.core.path}/ti/runtime/wiring/msp432e" "-I{build.system.path}/source/ti/net/bsd" "-I{build.system.path}/source" "-I{build.system.path}/source/third_party/CMSIS/Include" "-I{build.system.path}/source/ti/posix/gcc" "-I{build.system.path}/kernel/tirtos/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include/newlib-nano" "-I{build.system.path}/kernel/tirtos/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include" "-I{build.system.path}/source" "-I{build.system.path}/kernel/tirtos/packages" "-I{build.system.path}/kernel/tirtos/builds/MSP_EXP432E401Y/release/gcc/.." "-I{build.system.path}/kernel/tirtos/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include/newlib-nano" "-I{build.system.path}/kernel/tirtos/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include" "-I{compiler.path}/arm-none-eabi/include"
# this can be overriden in boards.txt
build.extra_flags=-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mabi=aapcs -g -Dxdc_target_types__=gnu/targets/arm/std.h -Dxdc_target_name__=M4F -Dxdc_cfg__xheader__="configPkg/package/cfg/energia_pm4fg.h" -DBOARD_MSP_EXP432E401Y -Dxdc__nolocalstring=1 -D__MSP432E401Y__
linker.include.flags="-L{build.system.path}/kernel/tirtos/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard" "-L{build.path}" "-L{build.core.path}" "-L{build.system.path}/energia" "-L{build.system.path}/kernel" "-L{build.system.path}/source" "-L{build.system.path}/kernel/tirtos/builds/{build.variant}/energia/" "-L{build.system.path}/kernel/tirtos/packages"
# These can be overridden in platform.local.txt
compiler.c.extra_flags={compiler.driverlib.c.flags}
compiler.c.elf.extra_flags=-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mabi=aapcs
compiler.cpp.extra_flags={compiler.driverlib.c.flags}
compiler.S.extra_flags=
compiler.ar.extra_flags=
compiler.elf2hex.extra_flags=
# USB Flags
# ---------
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} -DUSBCON '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
# Default usb manufacturer will be replaced at compile time using
# numeric vendor ID if available or by board's specific value.
build.usb_manufacturer="Unknown"
# MSP432E compile patterns
# ---------------------
# TI's ino2ccp
build.ino2cpp.path={runtime.tools.ino2cpp.path}
build.ino2cpp.cmd.path={runtime.tools.ino2cpp.path}/ino2cpp.jar
recipe.hooks.sketch.prebuild.1.pattern="java" "-jar" "{build.ino2cpp.cmd.path}" -o "{build.path}/sketch/" -T "{build.ino2cpp.path}/templates/Variables.mk.template" -r "{build.ino2cpp.path}" -n {build.project_name} "{build.project_path}" msp432e:MSP_EXP432E401Y"
## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {build.extra_flags} {compiler.c.flags} -mcpu={build.mcu} -mthumb -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DENERGIA={runtime.ide.version} -DENERGIA_{build.board} -DENERGIA_ARCH_{build.arch} {compiler.c.extra_flags} {compiler.emt.c.flags} {compiler.driverlib.c.flags} {includes} "{source_file}" -o "{object_file}"
## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {build.extra_flags} {compiler.cpp.flags} -mcpu={build.mcu} -mthumb -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DENERGIA={runtime.ide.version} -DENERGIA_{build.board} -DENERGIA_ARCH_{build.arch} {compiler.cpp.extra_flags} {compiler.emt.c.flags} {compiler.driverlib.c.flags} {includes} "{source_file}" -o "{object_file}"
## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -mcpu={build.mcu} -mthumb -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DENERGIA={runtime.ide.version} -DENERGIA_{build.board} -DENERGIA_ARCH_{build.arch} {compiler.S.extra_flags} {compiler.emt.c.flags} {build.extra_flags} {compiler.driverlib.c.flags} {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}"
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.cpp.elf.cmd}" -mcpu={build.mcu} -mthumb -nostartfiles {compiler.c.elf.flags} "-Wl,-u,main" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} {linker.include.flags} "-L{build.core.path}/ti/runtime/wiring/msp432e" "-L{build.core.path}/ti/runtime/wiring/msp432e/variants/MSP_EXP432E401Y" -Wl,--check-sections -Wl,--gc-sections "{build.path}/{archive_file}" "-Wl,-T{build.system.path}/energia/{build.ldscript}" "{build.system.path}/source/ti/devices/msp432e4/driverlib/lib/gcc/m4f/msp432e4_driverlib.a" -static -lstdc++ -lgcc -lc -lm -lnosys
## recipe.hooks.linking.postlink.1.pattern.windows=cmd /c copy "{build.system.path}/energia/energia_pm4fg.rov.xs" "{build.path}"
recipe.hooks.linking.postlink.1.pattern.linux=bash -c "cp {build.system.path}/energia/energia_pm4fg.rov.xs {build.path}"
recipe.hooks.linking.postlink.1.pattern.macosx=bash -c "cp {build.system.path}/energia/energia_pm4fg.rov.xs {build.path}"
## Create output (.bin file)
#recipe.objcopy.bin.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"
## Save hex
recipe.output.tmp_file={build.project_name}.bin
recipe.output.save_file={build.project_name}.{build.variant}.bin
## 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)\s+([0-9]+).*
# TI's DSLite
tools.dslite.upload.params.verbose=
tools.dslite.upload.params.quiet=
#tools.dslite.path={runtime.tools.dslite-7.2.0.2096.path}
#tools.dslite.path={runtime.tools.dslite-8.2.0.1400.path}
tools.dslite.path={runtime.tools.dslite-8.0.0.1202.path}
tools.dslite.config.path={path}
tools.dslite.cmd.path={path}/DebugServer/bin/DSLite
#tools.dslite.upload.pattern={cmd.path} {upload.verbose} load -c "{config.path}/EK-TM4C1294XL.ccxml" -f "{build.path}/{build.project_name}.elf"
tools.dslite.upload.pattern={cmd.path} {upload.verbose} load -c "{config.path}/MSP_EXP432E401Y.ccxml" -f "{build.path}/{build.project_name}.elf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment