-
Notifications
You must be signed in to change notification settings - Fork 948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32F103 HIC nRESET pin pullup issue #824
Comments
I had the problem you described with an STM32-MINI board with the original STM32F103CBT6 chip. Your solution worked great. Thank you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tested DAPLink on HIC with STM32F103CB without problems. Using HIC with clone GD32F103CB causes problem - it starts in bootloader update mode. I investigated this issue and I found the reason.
At startup bootloader checks nRESET pin to determine to go in update mode if this pin is shorted to ground. In theory nRESET pin is configured to output OD state with pullup. I checked datasheet and found that unfortunatelly pins in STM32F103 (and also in clones) have hardware disabled internal pullup or pulldown when they are in in output state. This mode can't be enabled like in other microcontrollers series like STM32F0.
nRESET pin at startup (after configuration) acts as floating pin with undetermined state. Statistically on STM32F103 it is read as Hi state so it seems that programmer works, on GD32F103 it almost always is read as Lo state so programmer goes to update mode.
The best solution is to rewrite code and define nRESET pin output states as follows:
Lo - output OD mode with Lo state
Hi - input mode with pullup
The simplest solution I've found is to change configuration in "hic_hal\stm32\stm32f103xb\gpio.c" file from
to
This pin is reconfigured to output OD mode in functions DAP_SETUP() and PORT_SWD_SETUP() so this solution is safe and allows to check nRESET pin real state at startup. For me it works.
The text was updated successfully, but these errors were encountered: