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 Visual Micro Debugger PROGMEM Arduino (Read 2433 times)
Mikaka1
Junior Member
**
Offline


Posts: 10
Joined: Sep 19th, 2014
Visual Micro Debugger PROGMEM Arduino
Sep 21st, 2014 at 3:34pm
Print Post  
Hello I have a quick question about the debugger for Arduino.
Does it use program memory for storing strings it injects into code, or does it use ram?

In Arduino every string created by string literal, for example:
Code (C++)
Select All
Serial.print("abcd"); 


will be copied into ram at program start, and stored there for as long as program is running, so it's essentialy wasted ram.
In order to store it in flash memory one should to use PROGMEM library.
I'm asking this because my program is too big for my board and I'm already using almost all of its memory, and I would like to know whether adding messages in breakpoint could cause my program to run out of memory, and make debugging more difficult.
« Last Edit: Sep 21st, 2014 at 3:35pm by Mikaka1 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro Debugger PROGMEM Arduino
Reply #1 - Sep 21st, 2014 at 4:16pm
Print Post  
Hi,

This is a good question.

The debugger does not store the large "when hit" message strings on the arduino, instead if keeps them on the pc and shows the correct text for the breakpoint numbered 0-infinity. Breakpoint 1, 2 3 etc.

However, the debugger does carry a memory overhead which can increase depending on what your code uses. For example if your code already uses the serial port then the additional overhead of the debugger using the serial is zero otherwise it is the serial buffer + some other arduino stuff.

Each breakpoint will cause a small memory increase depending on the specified break condition and number of {expressions} being watched. It also uses small 4 byte strings as packet terminators so could be more efficient in this area.

Generally speaking if you have your own hardcoded serial.print() commands commenting them and replacing with a breakpoint when hit can save a huge amount of arduino memory. This tends to benefit newer uses or project where code is often full of diagnostics/pint messages. 

From what you have said, I suspect your memory usage is very highly tuned and in that case the debugger might not be a viable solution.
« Last Edit: Sep 21st, 2014 at 4:20pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint