From 2d18a5019461e1467a3ab6372b2afd2be3b884e5 Mon Sep 17 00:00:00 2001 From: EmanuelFeru Date: Wed, 26 Feb 2020 14:50:50 +0100 Subject: [PATCH] Updated How to Unlock MCU Flash (markdown) --- How-to-Unlock-MCU-Flash.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/How-to-Unlock-MCU-Flash.md b/How-to-Unlock-MCU-Flash.md index 990e736..c3ee7fb 100644 --- a/How-to-Unlock-MCU-Flash.md +++ b/How-to-Unlock-MCU-Flash.md @@ -6,25 +6,31 @@ This wiki page explains how to unlock the flash of an STM32 or a GD32 to allow r * Step 1: Download and install the [ST-Link Utility](https://www.st.com/en/development-tools/stsw-link004.html) * Step 2: Connect the ST-Link programmer to the MCU programming pins GND, SWDIO, SWCLK. Connect the 3V3 pin only if your MCU is not powered externally. -* Step 3: Open the ST-Link utility and press Connect to target +* Step 3: Open the ST-Link utility and press `Connect to target` ![unlock1](https://raw.githubusercontent.com/EmanuelFeru/hoverboard-firmware-hack-FOC/master/docs/pictures/unlock_mcu_1.png) -* Step 4: If you get the message "Can not read memory!" the MCU is most probably locked -* Step 5: Go to Target and click Option Bytes +* Step 4: If you get the message `Can not read memory!` the MCU is most probably locked +* Step 5: Go to `Target` and click `Option Bytes` ![unlock2](https://raw.githubusercontent.com/EmanuelFeru/hoverboard-firmware-hack-FOC/master/docs/pictures/unlock_mcu_2.png) -* Step 6: Select **Disable** in Read Out Protection drop-down menu and click Apply +* Step 6: Select **Disable** in `Read Out Protection` drop-down menu and click `Apply` ![unlock3](https://raw.githubusercontent.com/EmanuelFeru/hoverboard-firmware-hack-FOC/master/docs/pictures/unlock_mcu_3.png) -* Step 7: Click Connect to target +* Step 7: Click `Connect to target` ![unlock4](https://raw.githubusercontent.com/EmanuelFeru/hoverboard-firmware-hack-FOC/master/docs/pictures/unlock_mcu_4.png) * Step 8: If you see the window above, then you have successfully unlocked your MCU. You can now flash the MCU. +## Troubleshooting +If you get funny, unexpected behavior from your board after flashing (see this [thread](https://github.com/EmanuelFeru/hoverboard-sideboard-hack-GD/issues/3)), it is most likely that the unlocking process did not succeed properly. To fix it follow these steps: +* Step 1: Lock the GD32 following the Steps above in reverse order +* Step 2: Unlock the GD32 as described above, however at Step 6, check all the boxes for `User configuration option bytes` +* Step 3: Click `OK` if you get any error/warning. +* Step 4: Flash the firmware and try # Method 2: Using Ubuntu