Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: [1] 2  Send TopicPrint
Very Hot Topic (More than 25 Replies) long time to start debugger (Read 5400 times)
simma
Junior Member
**
Offline


Posts: 20
Joined: Apr 7th, 2019
long time to start debugger
Nov 29th, 2020 at 3:23pm
Print Post  
Hi guys,

I am facing an issue when starting the debugging. Although compilation is relatively quick, the process of starting the debugging takes very long about few minutes.

CPU : STM32F429ZI
Debugger : ST-link

Appreciate if somebody could guide me on this.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: long time to start debugger
Reply #1 - Nov 30th, 2020 at 10:11am
Print Post  
Thanks for the report.

Can you confirm if you are running Debug > Start Debugging, or Debug > Attach to Process?
  
Back to top
 
IP Logged
 
simma
Junior Member
**
Offline


Posts: 20
Joined: Apr 7th, 2019
Re: long time to start debugger
Reply #2 - Nov 30th, 2020 at 3:57pm
Print Post  
If I select Start debugging, 
after compilation, it takes a long time to start the programmer and after programming it takes similar or longer time to activate the debugger.

However, after programming, attach to the process is faster.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: long time to start debugger
Reply #3 - Dec 1st, 2020 at 11:06am
Print Post  
Thanks for confirming the actions, and its the build process which is taking a long time from your report.

This is due to how the <SrcWrapper.h> is added as part of the build process, which causes the Deep Search to assess a large number of files every build.

The Build process can be faster, by Disabling the Compiler > Deep Search option, BUT you will need to add in the SrcWrapper.h and all other library and header files which need to be included.

Code
Select All
// Top of Main Sketch INO File
// Avoid Official STM32 Build Time: --> Add these #includes, and all other library headers, then disable vMicro > Compiler > Deep Search
#include <SrcWrapper.h>
 

  
Back to top
 
IP Logged
 
simma
Junior Member
**
Offline


Posts: 20
Joined: Apr 7th, 2019
Re: long time to start debugger
Reply #4 - Dec 1st, 2020 at 1:22pm
Print Post  
Thank you, Simon for the quick response. 

I am sure it is not the build process that is delaying (although there is a high chance I am ignorant about the process), because

First build takes takes about 100 secs and subsequent builds takes around 17secs.

However, the time after that to connect to the Stlink long (around few minutes). This happens even for just "build and upload" alone.

Code
Select All
Program MnC2test size: 115,240 bytes (used 5% of a 2,097,152 byte maximum) (112.21 secs)
Minimum Memory Usage: 47772 bytes (24% of a 196608 byte maximum)

# Copy build result to 'Project>Property Pages>Intermediate Directory'
# Destination: file:///D:/xxxx/MnC2test/Debug/

Uploading 'MnC2test' to 'Nucleo-144' using 'COM1'
Uploader started for board Nucleo-144
Upload method will be: bootloader
Uploading via Bootloader
CubeProg.bat 0 .bin" -g
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.4.0                  
      ------------------------------------------------------------------- 



Also, I just got a prompt from VS2019 about VM being unresponsive. I am attaching the screenshot for your reference.
« Last Edit: Dec 2nd, 2020 at 1:27pm by simma »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: long time to start debugger
Reply #5 - Dec 1st, 2020 at 1:53pm
Print Post  
Thanks for the detail, and the uploader in use here seems to be the STM32Cube Programmer via Serial, which is part of the core package.

Is this faster if you select the "STLinkv2.1 + OpenOCD (vMicro)" as the uploader?
(This will use OpenOCD to connect to the STLink and upload the code via the programmer)
  
Back to top
 
IP Logged
 
simma
Junior Member
**
Offline


Posts: 20
Joined: Apr 7th, 2019
Re: long time to start debugger
Reply #6 - Dec 1st, 2020 at 2:37pm
Print Post  
But the selection is  STM32Cube Programmer (SWD). Anyway, I will try as suggested.
  
Back to top
 
IP Logged
 
simma
Junior Member
**
Offline


Posts: 20
Joined: Apr 7th, 2019
Re: long time to start debugger
Reply #7 - Dec 1st, 2020 at 2:55pm
Print Post  
Hi, I tried as suggested, but the results are the same. For some reason Serial upload is auto selected. I am attaching the screenshot for your reference.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: long time to start debugger
Reply #8 - Dec 1st, 2020 at 3:22pm
Print Post  
Thanks for the update.  I was trying to understand if the issue is the core tools, or whether it is something else.

This has failed to program the board via the programmer, so I would expect this to be faster than when it is programming successfully via the STM32 Cube Programmer.

Can you confirm if this failed upload, was as slow as the previous ones? (around a minute)

  
Back to top
 
IP Logged
 
simma
Junior Member
**
Offline


Posts: 20
Joined: Apr 7th, 2019
Re: long time to start debugger
Reply #9 - Dec 1st, 2020 at 3:40pm
Print Post  
It has failed to program.

If I choose STlink (SWD), although it took a long time but it programmed the chip.
« Last Edit: Dec 1st, 2020 at 3:44pm by simma »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: long time to start debugger
Reply #10 - Dec 1st, 2020 at 4:21pm
Print Post  
Can you confirm if the failed upload via the vMicro OpenOCD option was as slow as the previous ones? (around a minute)

Does the upload via the STLink (SWD) report progress during the upload? (or just appear to hang)
  
Back to top
 
IP Logged
 
simma
Junior Member
**
Offline


Posts: 20
Joined: Apr 7th, 2019
Re: long time to start debugger
Reply #11 - Dec 1st, 2020 at 4:39pm
Print Post  
>>Can you confirm if the failed upload via the vMicro OpenOCD option was as slow as the previous ones? (around a minute)

Yes.

>>Does the upload via the STLink (SWD) report progress during the upload? (or just appear to hang)

Code
Select All
ST-LINK FW  : V2J37S7
Voltage     : 3.25V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x419
Device name : STM32F42xxx/F43xxx
Flash size  : 1 MBytes
Device type : MCU
Device CPU  : Cortex-M4
Memory Programming ...
Opening and parsing file: MnC2test.ino.bin
  File          : MnC2test.ino.bin
  Size          : 76760 Bytes
  Address       : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 4]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:02.817
	The upload process has finished.
# Copy build result to 'Project>Property Pages>Intermediate Directory'
# Destination: file:///D:/xxxx/MnC2test/Debug/
RUNNING Program ...

  Address:      : 0x8000000
Warning: The core is halted
Start operation achieved successfully 


  
Back to top
 
IP Logged
 
simma
Junior Member
**
Offline


Posts: 20
Joined: Apr 7th, 2019
Re: long time to start debugger
Reply #12 - Dec 1st, 2020 at 4:41pm
Print Post  
VS prompting as "VM is unresponsive" and asks if would like to disable the extension.

This is not a show stopper. But may give you a hint.

Please advise.
« Last Edit: Dec 1st, 2020 at 4:42pm by simma »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: long time to start debugger
Reply #13 - Dec 1st, 2020 at 4:59pm
Print Post  
Thanks for confirming the vMicro failed upload took as long, which is odd as it should fail virtually instantly.

The "unresponsive" prompt will be due to vMicro waiting on the upload process to complete, but it is not our code running at this point.

The upload snippet above shows a time elapsed of 2.817s, but your experience is the upload alone is taking > 1minute? 
(use the vMicro > Uploader > Upload Last Build to test upload in isolation)

Is it the same in the Arduino IDE using the same sketch and programming method?

Apologies if repeat questions, I'm just trying to make sure I understand the issue fully.

  
Back to top
 
IP Logged
 
simma
Junior Member
**
Offline


Posts: 20
Joined: Apr 7th, 2019
Re: long time to start debugger
Reply #14 - Dec 2nd, 2020 at 12:38am
Print Post  
Hi,

>>The upload snippet above shows a time elapsed of 2.817s, but your experience is the upload alone is taking > 1minute?
(use the vMicro > Uploader > Upload Last Build to test upload in isolation)
The process takes > 1min to start the programmer. But actual programming is fast (2-3sec). If I choose Debug, it takes > 1min after programming process. Most of the time it will fail to debug. I can debug only by "attach to the process" method.

>>Is it the same in the Arduino IDE using the same sketch and programming method?

In Arduino IDE, it is quicker. Programmer starts immediately.
« Last Edit: Dec 2nd, 2020 at 12:43am by simma »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: long time to start debugger
Reply #15 - Dec 2nd, 2020 at 10:31am
Print Post  
Thanks for the detail.

Debug > Start - This will take around a minute as it rebuilds the solution, and re-uploads it.
Debug > Attach - This should be quick to attach once programmed, and only attaches the debugging process.

Could you follow the steps below to reveal further information for us:
1) Add the attached entries to a board.txt in your project (Right click project in Solution Explorer > Add > Local Board.txt) and Restart VS
2) Set the Compiler > Verbose, and Compiler > Show Build Properties
3) Perform the "Build and Upload" process.
4) After this please attach the BuildTimings.txt file it generates, and the entire Build Output


  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
simma
Junior Member
**
Offline


Posts: 20
Joined: Apr 7th, 2019
Re: long time to start debugger
Reply #16 - Dec 2nd, 2020 at 1:25pm
Print Post  
I am attaching the BuildTimings.txt for your review. I have done both "clean, build and upload" and "build & upload".

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: long time to start debugger
Reply #17 - Dec 2nd, 2020 at 5:52pm
Print Post  
Thanks for the timings and detail.

Could you please also attach the output from Output Window, for a build and upload?  (with the settings set as shown at the top of the page)
  
Back to top
 
IP Logged
 
simma
Junior Member
**
Offline


Posts: 20
Joined: Apr 7th, 2019
Re: long time to start debugger
Reply #18 - Dec 3rd, 2020 at 10:23am
Print Post  
I am attaching the BuildTimings.txt, build.txt for you review.
« Last Edit: Dec 3rd, 2020 at 11:15am by simma »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
simma
Junior Member
**
Offline


Posts: 20
Joined: Apr 7th, 2019
Re: long time to start debugger
Reply #19 - Dec 3rd, 2020 at 11:25am
Print Post  
There is some improvements. I can program immediately if I commnet out the 

"recipe.hooks.postbuild.2.pattern=notepad.exe {ProjectDir}BuildTimings.txt"

This was tested on Win 7. I will check with other Win 10.

There is another issue with Debug. I cannot "Start debug" but only "Attach to Process".

Any Idea, why?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint