Skip to content

Commit 92a4ee5

Browse files
committed
stm32: add support for the STM32L031G6U6
1 parent 1de1f87 commit 92a4ee5

File tree

4 files changed

+49
-1
lines changed

4 files changed

+49
-1
lines changed

GNUmakefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,8 @@ ifneq ($(STM32), 0)
837837
@$(MD5SUM) test.hex
838838
$(TINYGO) build -size short -o test.hex -target=mksnanov3 examples/blinky1
839839
@$(MD5SUM) test.hex
840+
$(TINYGO) build -size short -o test.hex -target=stm32l0x1 examples/serial
841+
@$(MD5SUM) test.hex
840842
endif
841843
$(TINYGO) build -size short -o test.hex -target=atmega328pb examples/blinkm
842844
@$(MD5SUM) test.hex
@@ -907,7 +909,7 @@ endif
907909
$(TINYGO) build -size short -o test.hex -target=hw-651 examples/machinetest
908910
@$(MD5SUM) test.hex
909911
$(TINYGO) build -size short -o test.hex -target=hw-651-s110v8 examples/machinetest
910-
@$(MD5SUM) test.hex
912+
@$(MD5SUM) test.hex
911913
ifneq ($(WASM), 0)
912914
$(TINYGO) build -size short -o wasm.wasm -target=wasm examples/wasm/export
913915
$(TINYGO) build -size short -o wasm.wasm -target=wasm examples/wasm/main

src/machine/board_stm32l0x1.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//go:build stm32l0x1 && !nucleol031k6
2+
3+
// This file is for the bare STM32L0x1 (not for any specific board that is based
4+
// on the STM32L0x1).
5+
6+
package machine
7+
8+
const (
9+
I2C0_SCL_PIN = NoPin
10+
I2C0_SDA_PIN = NoPin
11+
12+
UART_TX_PIN = NoPin
13+
UART_RX_PIN = NoPin
14+
15+
SPI0_SDI_PIN = NoPin
16+
SPI0_SDO_PIN = NoPin
17+
SPI0_SCK_PIN = NoPin
18+
)

targets/stm32l031x6.ld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
MEMORY
3+
{
4+
FLASH_TEXT (rx) : ORIGIN = 0x08000000, LENGTH = 32K
5+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
6+
}
7+
8+
_stack_size = 2K;
9+
10+
INCLUDE "targets/arm.ld"

targets/stm32l0x1.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"inherits": [
3+
"cortex-m0plus"
4+
],
5+
"build-tags": [
6+
"stm32l031",
7+
"stm32l0x1",
8+
"stm32l0",
9+
"stm32"
10+
],
11+
"linkerscript": "targets/stm32l031x6.ld",
12+
"extra-files": [
13+
"src/device/stm32/stm32l0x1.s"
14+
],
15+
"flash-method": "openocd",
16+
"openocd-interface": "cmsis-dap",
17+
"openocd-target": "stm32l0"
18+
}

0 commit comments

Comments
 (0)