forked from krisstakos/Hoverboard-Firmware-Hack-Gen2.1
-
Notifications
You must be signed in to change notification settings - Fork 27
Flash via PYocd
reed-dan edited this page Feb 25, 2024
·
3 revisions
The below instruction are written with the MM32SPIN05PF mcu as an exmaple, but should apply to other boards as well.
By default the MM32SPIN05PF mcu is not included as a built in target with PYOCD. Don’t be worried though adding the board is easy, as someone else has already built the necessary files.
- Check to make sure your mcu is available by searching on https://www.keil.arm.com/devices/
-
pyocd pack -u
ORpyocd pack --update
- Update the CMSIS Device Family Packs that provide additional target device support.
-
pyocd pack -i mm32spin05pf
ORpyocd pack install mm32spin05pf
- Install the CMSIS Device pack for the MM32SPIN05PF
-
pyocd list -t
ORpyocd list --targets
- This will list all the installed CMSIS Device packs
- Connect chip mcu NREST pin to ground (not all mcu require shorting NREST to ground try first without it)
- If using a St Link V2 don't connect the nrst to stlink because the rst on stlink v2 is for stm8 only
pyocd erase -t mm32spin05pf --chip
- Quickly disconnect NREST from ground
- If you see "Timed out waiting for core to halt after reset (state is RESET) [cortex_m]" you didn't pull the NREST to ground connection quick enough.
- Connect chip mcu NREST pin to ground (not all mcu require shorting NREST to ground try first without it)
- If using a St Link V2 don't connect the nrst to stlink because the rst on stlink v2 is for stm8 only
-
pyocd flash -t mm32spin05pf c:\blink.hex
pyocd flash -t mm32spin05pf file location
- A .bin file is also acceptable
- Once you see "I Erasing chip... [eraser]" disconnect NREST from ground
- C Memory transfer fault (Unspecified error.) [main]
- You did not successfully bring NREST to ground
- W Timed out waiting for core to halt after reset (state is RESET) [cortex_m]
C cannot write registers pc, r0, r1, r2, r9, sp, lr because core #0 is not halted [main]
- You did not disconnect NREST from ground in time
- C Memory transfer fault (Unspecified error.) [main]
C:\Users\X>pyocd erase -t mm32spin05pf --chip
0002614 W STLink, CMSIS-DAPv2 and PicoProbe probes are not supported because no libusb library was found. [common]
0005179 C Memory transfer fault (Unspecified error.) [__main__]
C:\Users\X>pyocd erase -t mm32spin05pf --chip
0002267 W STLink, CMSIS-DAPv2 and PicoProbe probes are not supported because no libusb library was found. [common]
0004488 I Erasing chip... [eraser]
0008618 W Timed out waiting for core to halt after reset (state is RESET) [cortex_m]
0008710 C cannot write registers pc, r0, r1, r2, r9, sp, lr because core #0 is not halted [__main__]
C:\Users\x>pyocd erase -t mm32spin05pf --chip
0002621 W STLink, CMSIS-DAPv2 and PicoProbe probes are not supported because no libusb library was found. [common]
0005375 I Erasing chip... [eraser]
0006575 I Chip erase complete [eraser]
SWD Flashers
SWD Flashing
- Flash via Keil
- Flash via PYocd
- Flash via StLink Utilities
- Flash via Stm32 Cube Programmer
- Flash via st-flash.exe
Submit New Layout