feat: (ISP) Program with STM32 built-in USB DFU Bootloader

This commit is contained in:
but0n 2016-12-23 14:08:13 +08:00
parent 5e07e04549
commit c071af1322
3 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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*/

View File

@ -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