Skip to content
Rohit Samineni edited this page Nov 26, 2020 · 2 revisions

STM32duino-bootloader

Bootloader for STM32F103 boards, for use with the Arduino_STM32 repo and the Arduino IDE.

Compiling A bootloader for your custom bootloader.

Requirements

steps

  • define your stm32f103 custom board hardware in config.h, eg:
#elif defined TARGET_CUSTOM_BOARD
#define HAS_MAPLE_HARDWARE 1
#define LED_BANK GPIOB
#define LED_PIN 1
#define LED_ON_STATE 1
/* On the Mini, BUT is PB8 */
#define BUTTON_BANK GPIOB
#define BUTTON 8
/* USB Disc Pin Setup. USB DISC is PB9 */
#define USB_DISC_BANK GPIOB
#define USB_DISC 9
#define USER_CODE_RAM ((u32)0x20000C00)
#define RAM_END ((u32)0x20005000)

  • Add rules for your custom board in the MAKE file
custom-board: begin clean gccversion build_custom-board sizeafter finished  copy_custom-board end
	
build_custom-board: TARGETFLAGS= -DTARGET_CUSTOM_BOARD $(DEFINES)
# Set the linker script
build_custom-board: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
build_custom-board: elf bin lss sym
copy_custom-board:
	@echo
	@echo "Copying to binaries folder"
	@echo
	cp $(TARGET).bin bootloader_only_binaries/custom-board.bin
	@echo


  • save the files and enter the command

make custom-board

Clone this wiki locally