diff options
author | Yusuke Mitsuki <[email protected]> | 2019-04-12 13:36:14 +0900 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2019-04-13 13:32:05 +0200 |
commit | 1322f404a6531e6bd17bf2d2809f0c800f2d8b27 (patch) | |
tree | 0cfb159f2fe515771f2ba28d46adffc3892eb710 /targets | |
parent | 315cd4059fd38be4c078a5974556e5d120d1662a (diff) | |
download | tinygo-1322f404a6531e6bd17bf2d2809f0c800f2d8b27.tar.gz tinygo-1322f404a6531e6bd17bf2d2809f0c800f2d8b27.zip |
stm32: add support for the STM32F4Discovery
Signed-off-by: Yusuke Mitsuki <[email protected]>
Diffstat (limited to 'targets')
-rw-r--r-- | targets/stm32f407.ld | 10 | ||||
-rw-r--r-- | targets/stm32f4disco.json | 18 |
2 files changed, 28 insertions, 0 deletions
diff --git a/targets/stm32f407.ld b/targets/stm32f407.ld new file mode 100644 index 000000000..2709ca048 --- /dev/null +++ b/targets/stm32f407.ld @@ -0,0 +1,10 @@ + +MEMORY +{ + FLASH_TEXT (rw) : ORIGIN = 0x08000000, LENGTH = 1M + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +} + +_stack_size = 4K; + +INCLUDE "targets/arm.ld" diff --git a/targets/stm32f4disco.json b/targets/stm32f4disco.json new file mode 100644 index 000000000..67fe78411 --- /dev/null +++ b/targets/stm32f4disco.json @@ -0,0 +1,18 @@ +{ + "inherits": ["cortex-m"], + "llvm-target": "armv7em-none-eabi", + "build-tags": ["stm32f4disco", "stm32f407", "stm32"], + "cflags": [ + "--target=armv7em-none-eabi", + "-Qunused-arguments" + ], + "ldflags": [ + "-T", "targets/stm32f407.ld" + ], + "extra-files": [ + "src/device/stm32/stm32f407.s" + ], + "flash": "openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c 'program {hex} reset exit'", + "ocd-daemon": ["openocd", "-f", "interface/stlink.cfg", "-f", "target/stm32f4x.cfg"], + "gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"] +} |