Skip to content

Commit bcd2d2e

Browse files
authored
Merge pull request #25 from omicronns/master
Create Nucleo target without bootloader support.
2 parents e9fdd11 + e624a56 commit bcd2d2e

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ DAP42K6U.bin: | $(BUILD_DIR)
9393
$(Q)$(MAKE) TARGET=DAP42K6U -C src/
9494
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)
9595

96+
DAP103-NUCLEO.bin: | $(BUILD_DIR)
97+
@printf " BUILD $(@)\n"
98+
$(Q)$(MAKE) TARGET=STLINKV2-1 -C src/ clean
99+
$(Q)$(MAKE) TARGET=STLINKV2-1 -C src/
100+
$(Q)cp src/DAP42.bin $(BUILD_DIR)/$(@)
101+
96102
DAP103-NUCLEO-STBOOT.bin: | $(BUILD_DIR)
97103
@printf " BUILD $(@)\n"
98104
$(Q)$(MAKE) TARGET=STLINKV2-1-STBOOT -C src/ clean

src/stm32f103/stlinkv2-1/config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#define CDC_AVAILABLE 1
3434
#define DEFAULT_BAUDRATE 115200
3535

36-
#define CONSOLE_USART USART1
36+
#define CONSOLE_USART USART2
3737
#define CONSOLE_TX_BUFFER_SIZE 128
3838
#define CONSOLE_RX_BUFFER_SIZE 4096
3939

@@ -50,7 +50,7 @@
5050
#define CONSOLE_RX_DMA_CONTROLLER DMA1
5151
#define CONSOLE_RX_DMA_CLOCK RCC_DMA1
5252
#define CONSOLE_RX_DMA_CHANNEL DMA_CHANNEL6
53-
53+
5454
#define BULK_AVAILABLE 1
5555
#define HID_AVAILABLE 0
5656
#define WINUSB_AVAILABLE 1

src/stm32f103/stlinkv2-1/target.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
/* Reconfigure processor settings */
2828
void cpu_setup(void) {
29+
#if DFU_AVAILABLE
2930
/* Disable any interrupts enabled by the bootloader */
3031
int i = 0;
3132
for (i=0; i*32 < NVIC_IRQ_COUNT; i++) {
@@ -34,6 +35,7 @@ void cpu_setup(void) {
3435

3536
/* Relocate the vector table */
3637
SCB_VTOR = 0x08004000;
38+
#endif
3739
}
3840

3941
/* Set STM32 to 72 MHz. */
File renamed without changes.

src/targets.mk

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,17 @@ ifeq ($(TARGET),STLINKV2-DONGLE-DAPBOOT)
102102
ARCH = STM32F1
103103
DFU_VID_PID := 1209:db42
104104
endif
105+
ifeq ($(TARGET),STLINKV2-1)
106+
TARGET_COMMON_DIR := ./stm32f103
107+
TARGET_SPEC_DIR := ./stm32f103/stlinkv2-1
108+
LDSCRIPT ?= ./stm32f103/stm32f103x8.ld
109+
DEFS += -DDFU_AVAILABLE=0
110+
ARCH = STM32F1
111+
endif
105112
ifeq ($(TARGET),STLINKV2-1-STBOOT)
106113
TARGET_COMMON_DIR := ./stm32f103
107114
TARGET_SPEC_DIR := ./stm32f103/stlinkv2-1
108-
LDSCRIPT ?= ./stm32f103/stlinkv2-1/stm32f103x8-stlinkv2-1-boot.ld
115+
LDSCRIPT ?= ./stm32f103/stm32f103x8-stlinkv2-1-boot.ld
109116
DEFS += -DDFU_AVAILABLE=1
110117
ARCH = STM32F1
111118
endif

0 commit comments

Comments
 (0)