STLink Gnuk is not getting detected
NIIBE Yutaka
gniibe at fsij.org
Thu Oct 17 03:28:33 CEST 2024
Hello,
Abhijith PA wrote:
> But after flashing, system is not recognizing gnuk usb device. May be
> 1 in 10 times, it get recognized, but most of the time its not.
Firstly, please check the physical hardware for USB DP pull up.
There are multiple ST-Link implementations; There would be more for
ST-Link clones.
Did you configure with --target=ST_DONGLE (it means the ST-Link V2-1 in
Nucleo F103)?
For ST_DONGLE, we can find three versions of board schematics at st.com
in the page of:
Schematic Pack (3):
https://www.st.com/en/evaluation-tools/nucleo-f103rb.html#cad-resources
To enable USB communication, the board requires PA15 (signal name
USB_RENUMn) asserted (and --target=ST_DONGLE does that).
We also have a support for STM8S_DISCOVERY, which is a version of
ST-Link implementation in STM8S Discovery Kit.
IIUC, for STM8S_DISCOVERY, we can find a board schematic at st.com,
in the page of:
User Manuals (2): UM1482:
https://www.st.com/en/evaluation-tools/stm8svldiscovery.html#documentation
This implementation does not have USB_RENUMn pin support and
--target=STM8S_DISCOVERY does nothing.
(Note that hardware feature of USB_RENUMn is not needed when we use the
board bus-powered.)
I thik that this pull-up might be a cause of problem for some boards. I
know "Bluepill" does wrong thing:
https://electronics.stackexchange.com/questions/598925/usb-pull-up-in-stm32f103-d
Secondly.... another problem would be... I wonder if the chip on your
board is STM32F103 or one of its variants. If its not STM32F103, sleep
support of the chip would have different behavior. (I encounter a
symptom of USB enumeration sometime works, but not all the times, for
CH32V203 for sleep support of chip.) If it might be the case, please
modify the function chx_idle in
chopstx-STABLE-2/mcu/chx-stm32f103.c
into:
==========================
void __attribute__((naked))
chx_idle (void)
{
for (;;)
;
}
==========================
That is, no use of sleep support of the chip. Try and see if things
improved.
--
More information about the Gnuk-users
mailing list