2021-02-13 12:55 AM
Hi,
I have pretty simple design with STM32L031 MCU without external crystal, and when I try to program it I got "Target held under rese" error.
I use STM32CubeID V 1.5.1 Build: 9029_20201210_1234 (UTC) with STLink V2 debugger.
Schematic
Logs:
STLINK GDB
STMicroelectronics ST-LINK GDB server. Version 5.7.0
Copyright (c) 2020, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Target Held under Reset
Error in initializing ST-LINK device.
Reason: Target held under reset.
OpenOCD log
Open On-Chip Debugger 0.10.0+dev-01288-g7491fb4 (2020-10-27-17:36)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.215779
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : clock speed 4000 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x0bc11477
Info : STM32L031G6Ux.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : STM32L031G6Ux.cpu: external reset detected
Info : starting gdb server for STM32L031G6Ux.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Error: timed out while waiting for target halted
Error executing event gdb-attach on target STM32L031G6Ux.cpu:
TARGET: STM32L031G6Ux.cpu - Not halted
Error: Cannot identify target as an STM32 L0 or L1 family device.
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
Any suggestions?
I know that I made some mistake, but I could not find where :)
regards
Goran
Solved! Go to Solution.
2021-02-13 01:09 AM
Don't pull NRST low.
Typically you pull High, or leave floating, with perhaps a capacitor to ground to keep it lower slightly long during reset.
2021-02-13 01:00 AM
Not seeing an schematic.
Check you power VDDA
2021-02-13 01:01 AM
2021-02-13 01:09 AM
Don't pull NRST low.
Typically you pull High, or leave floating, with perhaps a capacitor to ground to keep it lower slightly long during reset.
2021-02-13 01:11 AM
OK, THX, I'll try it. I will remove res and leave it floated.
THX
Goran
2021-02-13 01:28 AM
this worked,
THX
Goran