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 Send TopicPrint
Normal Topic VM resetting target when started (Read 420 times)
FylB
Junior Member
**
Offline


Posts: 13
Joined: Jan 27th, 2022
VM resetting target when started
Dec 19th, 2024 at 5:02am
Print Post  
I have an Arduino project that runs fine except for some code bug that causes it to fail after about a week. I have a bunch of debug statements outputting variables et al to the COM port. I would like to be able to leave this project running and end VM whereupon, after it fails a week later, I'd like to bring VM up to look at the COM port data. Unfortunately, VM seems to be resetting my target when it initializes. How can I get it to stop doing that and let me see the COM data without resetting it?
  
Back to top
 
IP Logged
 
Acuario
Full Member
***
Offline


Posts: 247
Location: Spain
Joined: Aug 28th, 2015
Re: VM resetting target when started
Reply #1 - Dec 19th, 2024 at 7:22am
Print Post  
I do a similar thing but I don´t rely on Visual Studio/VM as I use it for other things.
I use a terminal program called Termite and connect this to the COM port to record the data on the serial port.

If you get an exception with a stack trace you can copy this from the Termite output and, after loading your project in VM, open the com port (or IP port, it doesn´t matter). Disconnect the monitor (Connect button) and paste the stack into the monitor window. With Termite connected VM won´t be able to connect to the com port so your target won´t get reset.

The monitor will then give you the exception decoder button to see the stack trace.

Hope this helps.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2626
Joined: Feb 13th, 2019
Re: VM resetting target when started
Reply #2 - Dec 19th, 2024 at 10:06am
Print Post  
The resetting of the board is likely related to the DTR/RTS settings in the Serial Monitor.  If you can attach a build log with the settings shown at the top of the page we will investigate further.

Visual Micro includes Serial Monitor Logging, which can be enabled by clicking the "Log" button in the top right of the Serial Monitor Window.

You can also edit where these files are logged, as shown on the below page (Item 17):
https://visualmicro.com/page/User-Guide.aspx?doc=Serial-Monitor.html

« Last Edit: Dec 19th, 2024 at 10:21am by Simon@Visual Micro »  
Back to top
IP Logged
 
FylB
Junior Member
**
Offline


Posts: 13
Joined: Jan 27th, 2022
Re: VM resetting target when started
Reply #3 - Jan 4th, 2025 at 5:56pm
Print Post  
So I did a bit more investigation into this and found that every terminal app causes a reset of my target. In looking at the hardware I realized that, as you say, DTR is controlling the Atmel reset input. After I disconnected this line, terminal apps now do not reset the Atmel. I can use this to debug my code but I also see that VM needs to control the reset to function properly.

I'm using an Adafruit CP2104 USB to serial converter and my suspicion is that the 2104 part toggles DTR when a USB device connects to it. The data sheet does not explicitly say this but it appears to be the case just from the the behavior of the device.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2626
Joined: Feb 13th, 2019
Re: VM resetting target when started
Reply #4 - Jan 6th, 2025 at 8:56am
Print Post  
Thanks for the report.

You can disable DTR in the vMicro Serial Monitor at the bottom of the window before connecting it (per-Visual Studio Load) for normal Serial Comms, and it is often used in reset functionality for uploads (depending on the board in use).

The chip does appear to support auto reset functionality which it controls, the below post implies a 100nf Capacitor needs to be installed between the CP2104's CTS Pin and the targets' Reset pin:
https://forums.adafruit.com/viewtopic.php?t=143419

Does adding (or removing if already present) this circuitry help at all?

Can you confirm which board you are using with this adapter?
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint