devanlai / dapboot

DFU Bootloader for STM32 chips
Other
331 stars 111 forks source link

Flashing dapboot-v1.20 using openocd #53

Open dzianisv opened 1 year ago

dzianisv commented 1 year ago

Hi, i think this question has to be in the discussions, but discussions are not open for this project. I tried to flash https://github.com/devanlai/dapboot/releases/download/v1.20/dapboot-v1.20-maplemini.bin into my copy of mapple mini.

OOCD_INTERFACE=interface/stlink-v2.cfg
OOCD_BOARD=target/stm32f1x.cfg

openocd -f $OOCD_INTERFACE -f $OOCD_BOARD \
            -c "init" -c "reset init" \
            -c "stm32f1x unlock 0; reset halt" \
            -c "flash erase_sector 0 0 last" \
            -c "flash write_image erase ${DFU:?DFU is not set} 0x08000000" \
            -c "reset" 

Output

Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.258394
Info : [stm32f1x.cpu] Cortex-M3 r1p1 processor detected
Info : [stm32f1x.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f1x.cpu on 3333
Info : Listening on port 3333 for gdb connections
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x20000108 msp: 0x20005000
Info : device id = 0x20036410
Info : flash size = 128 KiB
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x20000108 msp: 0x20005000
erased sectors 0 through 127 on flash bank 0 in 0.025608s

Warn : Adding extra erase range, 0x08001a5c .. 0x08001bff
auto erase enabled
wrote 6748 bytes from file /Users/engineer/Downloads/dapboot-v1.20-maplemini.bin in 0.477412s (13.803 KiB/s)

But after flashing when I connect stm32f103 board to the laptop over usb, I don't see any DFU device in lsusb list. Could you help me with it?