summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-04-18 01:30:19 +0700
committerhathach <[email protected]>2021-04-18 01:30:19 +0700
commit38cc459c93d039968c4e89b302880e621e42eed3 (patch)
tree7be2721b08c6e4c8023b10b9ff8001fa98014ac1
parent91e574075d159a7f04280743d93279e6c6efd227 (diff)
parent4ba64719bd2216561a294c136c962c89ea30905a (diff)
Merge branch 'master' into alisitsyn-esp-based_on_334e95f
-rw-r--r--.gitignore1
-rw-r--r--examples/make.mk1
-rw-r--r--examples/rules.mk10
-rw-r--r--hw/bsp/stm32f4/boards/stm32f401blackpill/board.h2
-rw-r--r--hw/bsp/stm32f4/boards/stm32f411blackpill/board.h2
5 files changed, 14 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 093bcc579..f7adff4c9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@ latex
.env
.settings/
.idea/
+.gdb_history
/examples/*/*/build*
test_old/
tests_obsolete/
diff --git a/examples/make.mk b/examples/make.mk
index 47879c66f..09ddb1397 100644
--- a/examples/make.mk
+++ b/examples/make.mk
@@ -60,6 +60,7 @@ CROSS_COMPILE ?= arm-none-eabi-
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
+GDB = $(CROSS_COMPILE)gdb
OBJCOPY = $(CROSS_COMPILE)objcopy
SIZE = $(CROSS_COMPILE)size
MKDIR = mkdir
diff --git a/examples/rules.mk b/examples/rules.mk
index 00ad14292..2d86d5c79 100644
--- a/examples/rules.mk
+++ b/examples/rules.mk
@@ -172,6 +172,16 @@ flash-pyocd: $(BUILD)/$(PROJECT).hex
pyocd flash -t $(PYOCD_TARGET) $<
pyocd reset -t $(PYOCD_TARGET)
+# flash with Black Magic Probe
+
+# This symlink is created by https://github.com/blacksphere/blackmagic/blob/master/driver/99-blackmagic.rules
+BMP ?= /dev/ttyBmpGdb
+
+flash-bmp: $(BUILD)/$(PROJECT).elf
+ $(GDB) --batch -ex 'target extended-remote $(BMP)' -ex 'monitor swdp_scan' -ex 'attach 1' -ex load $<
+
+debug-bmp: $(BUILD)/$(PROJECT).elf
+ $(GDB) -ex 'target extended-remote $(BMP)' -ex 'monitor swdp_scan' -ex 'attach 1' $<
#-------------- Artifacts --------------
diff --git a/hw/bsp/stm32f4/boards/stm32f401blackpill/board.h b/hw/bsp/stm32f4/boards/stm32f401blackpill/board.h
index 570f5fcec..0f820512c 100644
--- a/hw/bsp/stm32f4/boards/stm32f401blackpill/board.h
+++ b/hw/bsp/stm32f4/boards/stm32f401blackpill/board.h
@@ -34,7 +34,7 @@
// LED
#define LED_PORT GPIOC
#define LED_PIN GPIO_PIN_13
-#define LED_STATE_ON 1
+#define LED_STATE_ON 0
// Button
#define BUTTON_PORT GPIOA
diff --git a/hw/bsp/stm32f4/boards/stm32f411blackpill/board.h b/hw/bsp/stm32f4/boards/stm32f411blackpill/board.h
index 570f5fcec..0f820512c 100644
--- a/hw/bsp/stm32f4/boards/stm32f411blackpill/board.h
+++ b/hw/bsp/stm32f4/boards/stm32f411blackpill/board.h
@@ -34,7 +34,7 @@
// LED
#define LED_PORT GPIOC
#define LED_PIN GPIO_PIN_13
-#define LED_STATE_ON 1
+#define LED_STATE_ON 0
// Button
#define BUTTON_PORT GPIOA