tinygo/targets/pca10040.json
Ayke van Laethem 611bca39ab
all: rename 'arm' to 'tinygo.arm' for Cortex-M
Let the standard library think that it is compiling for js/wasm.

The most correct way of supporting bare metal Cortex-M targets would be
using the 'arm' build tag and specifying no OS or an 'undefined' OS
(perhaps GOOS=noos?). However, there is no build tag for specifying no
OS at all, the closest possible is GOOS=js which makes very few
assumptions.

Sadly GOOS=js also makes some assumptions: it assumes to be running with
GOARCH=wasm. This would not be such a problem, just add js, wasm and arm
as build tags. However, having two GOARCH build tags leads to an error
in internal/cpu: it defines variables for both architectures which then
conflict.

To work around these problems, the 'arm' target has been renamed to
'tinygo.arm', which should work around these problems. In the future, a
GOOS=noos (or similar) should be added which can work with any
architecture and doesn't implement OS-specific stuff.
2018-11-09 11:50:38 +01:00

26 строки
870 Б
JSON

{
"llvm-target": "armv7em-none-eabi",
"build-tags": ["pca10040", "nrf52832", "nrf52", "nrf", "tinygo.arm", "js", "wasm"],
"linker": "arm-none-eabi-gcc",
"compiler-rt": true,
"pre-link-args": [
"-nostdlib",
"-nostartfiles",
"-mcpu=cortex-m4",
"-mthumb",
"-T", "targets/nrf52.ld",
"-Wl,--gc-sections",
"-fno-exceptions", "-fno-unwind-tables",
"-ffunction-sections", "-fdata-sections",
"-Os",
"-DNRF52832_XXAA",
"-Ilib/CMSIS/CMSIS/Include",
"lib/nrfx/mdk/system_nrf52.c",
"src/device/nrf/nrf52.s"
],
"objcopy": "arm-none-eabi-objcopy",
"flash": "nrfjprog -f nrf52 --sectorerase --program {hex} --reset",
"ocd-daemon": ["openocd", "-f", "interface/jlink.cfg", "-c", "transport select swd", "-f", "target/nrf51.cfg"],
"gdb": "arm-none-eabi-gdb",
"gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"]
}