Skip to content

Olimex STM32 H103 board #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ PRODUCT_ID := 0003
BOARD ?= maple
MEMORY_TARGET ?= flash

OOCD ?= openocd
OOCD_INTERFACE ?= olimex-arm-usb-ocd
OOCD_BOARD ?= olimex_stm32_h103

# $(BOARD)- and $(MEMORY_TARGET)-specific configuration
include $(MAKEDIR)/target-config.mk

Expand Down Expand Up @@ -90,7 +94,7 @@ $(foreach m,$(LIBMAPLE_MODULES),$(eval $(call LIBMAPLE_MODULE_template,$(m))))
##

# main target
include $(SRCROOT)/build-targets.mk
include build-targets.mk

.PHONY: install sketch clean help debug cscope tags ctags ram flash jtag doxygen mrproper

Expand All @@ -101,7 +105,13 @@ UPLOAD_ram := $(SUPPORT_PATH)/scripts/reset.py && \
UPLOAD_flash := $(SUPPORT_PATH)/scripts/reset.py && \
sleep 1 && \
$(DFU) -a1 -d $(VENDOR_ID):$(PRODUCT_ID) -D $(BUILD_PATH)/$(BOARD).bin -R
UPLOAD_jtag := $(OPENOCD_WRAPPER) flash
UPLOAD_jtag := $(OOCD) -f interface/$(OOCD_INTERFACE).cfg \
-f board/$(OOCD_BOARD).cfg \
-c "init" -c "reset init" \
-c "flash write_image erase unlock $(BUILD_PATH)/$(BOARD).elf 0" \
-c "verify_image $(BUILD_PATH)/$(BOARD).elf" \
-c "reset run" \
-c "shutdown"

# Conditionally upload to whatever the last build was
install: INSTALL_TARGET = $(shell cat $(BUILD_PATH)/build-type 2>/dev/null)
Expand Down Expand Up @@ -154,7 +164,10 @@ help:
@echo " "

debug:
$(OPENOCD_WRAPPER) debug
$(OOCD) -f interface/$(OOCD_INTERFACE).cfg \
-f board/$(OOCD_BOARD).cfg \
-c "init" -c "reset init" \
-c "reset halt"

cscope:
rm -rf *.cscope
Expand Down
6 changes: 6 additions & 0 deletions libmaple/usb/usb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
#define USB_DISC_DEV GPIOB
#define USB_DISC_PIN 8

#elif defined(BOARD_olimex_stm32_h103)

#define VCOM_ID_PRODUCT 0x0004
#define USB_DISC_DEV GPIOC
#define USB_DISC_PIN 11

#else

#error ("Sorry! the USB stack relies on LeafLabs board-specific " \
Expand Down
1 change: 1 addition & 0 deletions support/ld/olimex_stm32_h103
1 change: 0 additions & 1 deletion support/make/build-rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ DISAS := arm-none-eabi-objdump
OBJDUMP := arm-none-eabi-objdump
SIZE := arm-none-eabi-size
DFU := dfu-util
OPENOCD_WRAPPER := support/scripts/openocd-wrapper.sh

# Suppress annoying output unless V is set
ifndef V
Expand Down
10 changes: 10 additions & 0 deletions support/make/target-config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ ifeq ($(BOARD), maple_RET6)
SRAM_SIZE := 65536
endif

ifeq ($(BOARD), olimex_stm32_h103)
MCU := STM32F103RB
PRODUCT_ID := 0003
ERROR_LED_PORT := GPIOC
ERROR_LED_PIN := 12
DENSITY := STM32_MEDIUM_DENSITY
FLASH_SIZE := 131072
SRAM_SIZE := 20480
endif

# Memory target-specific configuration values

ifeq ($(MEMORY_TARGET), ram)
Expand Down
75 changes: 0 additions & 75 deletions support/openocd/debug_0.3.cfg

This file was deleted.

75 changes: 0 additions & 75 deletions support/openocd/debug_0.4.cfg

This file was deleted.

89 changes: 0 additions & 89 deletions support/openocd/flash_0.3.cfg

This file was deleted.

Loading