2021-05-17 03:15 AM
Hello ,
recently I upgraded to ST Link V3 and it works fine so far. Only one thing is annoying: I always get a double reset when uploading a new firmware from Cube IDE to my target. Console output is this:
STMicroelectronics ST-LINK GDB server. Version 5.8.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
Waiting for debugger connection...
Debugger connected
-------------------------------------------------------------------
STM32CubeProgrammer v2.7.0-RC1
-------------------------------------------------------------------
ST-LINK SN : 0672FF383337554E43183919
ST-LINK FW : V2J37M26
Board : NUCLEO-G070RB
Voltage : 3.22V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x460
Revision ID : Rev B
Device name : STM32G07x/STM32G08x
Flash size : 128 KBytes
Device type : MCU
Device CPU : Cortex-M0+
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a03436.srec
File : ST-LINK_GDB_server_a03436.srec
Size : 20740 Bytes
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 10]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:00.684
Verifying ...
After line 14 "Debugger connected" it seems reset is released for a short time, starting the old firmware again, before in a second reset the new firmware is programmed to the target. The time between the resets is about half a second, enough to do some things that are not wanted at that moment...
Did I miss some settings? I checked Run configurations but couldn't find anything.
Any help is welcome
Martin
2021-05-17 03:57 AM
Hi,
Are you sure that it is a V3 that you have ? The Nucleo-G070RB has a V2-1.
In any case, if you want to understand what is going on, you should change the verbosity output of CubeProgrammer with the option -vb 3
That should tell you how many "monitor reset" command are being sent.
2021-05-17 04:26 AM
Hi Kraal,
yes you are right, it is connected to the Nucleo-G070RB directly, so it is its STlink V2, not my brand new V3 ;)
But with your help (I was trying to set -vb 3) I found a solution:
in Run Configurations (CubeIDE), tab Debugger, I now set Reset behaviour to None, it was Connect under reset before. With the new setting there is only one reset.
Still, can you tell me where and how to set -vb 3 in Cube IDE?
Martin
2021-05-17 06:32 AM
Hi Martin,
Glad that you found a solution.
I don't use CubeIDE, but Atollic TrueStudio. So in my case when I want to program the device I have to use an "External tool", from which you can call any exe you like with the arguments that you need. See attached picture.
The arguments are :
-c port=SWD mode=UR -e all --skipErase -d ${workspace_loc}\${project_name}\${config_name:${project_name}}\${project_name}.hex -v -rst
In my case I connect under reset (UR) which you don't want. I would add "-vb 3" before "-e" and after "UR"
2021-05-18 12:16 AM
Hi Kraal,
thanks for this hint.
I also use Atollic True Studio for another project and here I really have an STLink V3 connected and I also have a double reset here.
So I have the settings you describe and I set in -vb 3 which produces a lot of output. But with the solution I found above I also found a solution here and that is to delet mode=UR. Without this there is only one reset. It seems UR connects under reset but then releases reset again to reactivate it before erasing the flash and program it with the new progam.
Do you see a double reset with your settings too?
Martin
2021-05-18 04:17 AM
Hi Martin,
You can set -vb from 1 (minimal debug output) to 3 (maximal debug output).
I did not actually tried it, so I don't know which level is enough to understand your issue.
Never the less, since the issue disappear when you remove the under reset option, it may really be related.
I always connect with UR, but I never verified the number of actual reset that are performed since it does not present an issue in my applications.
I will try to verify this somewhere in the next days.
Best regards,
K.