Skip to content

Commit

Permalink
feat: (ISP) Program with STM32 built-in USB DFU Bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
but0n committed Dec 23, 2016
1 parent 5e07e04 commit c071af1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ dump:
open DUMP.s
tty: flash
screen /dev/tty.SLAB_USBtoUART 115200
dfu:
dfu-util -d 0483:df11 -c 1 -a 0 -s 0x08000000:leave -D main.bin
2 changes: 1 addition & 1 deletion linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ MEMORY {
EXTSRAM (RWX) : ORIGIN = 0x68000000 , LENGTH = 0
/*Adust LENGTH to (FLASHsize - FeePROMsize) of target MCU:*/
/*STM32F103RBT --> 126K*/
FLASH (RX) : ORIGIN = 0x08000000 , LENGTH = 508K
FLASH (RX) : ORIGIN = 0x08000000 , LENGTH = 256K
/*STM32F103RET --> 508K*/
/*FLASH (RX) : ORIGIN = 0x08000000 , LENGTH = 508K*/
/*STM32F103ZET --> 508K*/
Expand Down
9 changes: 9 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,15 @@ void drawille_task() {
}

int main() {
RCC->APB2ENR |= RCC_APB2ENR_IOPBEN;
GPIOB->CRH &= 0xFFFFF0FF;
GPIOB->CRH |= 0x00000300;
while(1) {
GPIOB->ODR &= 0b11111111111111111111101111111111;
delay(1000);
GPIOB->ODR |= 0b00000000000000000000010000000000;
delay(1000);
}

#ifdef DEBUG_BLDC
//Brushless motor auto init
Expand Down

0 comments on commit c071af1

Please sign in to comment.