Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Code compiled although Global variables use 3208 bytes (125%) of dynamic memory !! (Read 112 times)
Waleed El-Badry
Junior Member
**
Offline



Posts: 14
Egypt
Code compiled although Global variables use 3208 bytes (125%) of dynamic memory !!
Sep 13th, 2020 at 10:21pm
 
Hello,
Visual Micro compiles a code that the Arduino compiler can not compile!

When I compile the code from Arduino IDE, it gives me the following error:

Code:
Global variables use 3208 bytes (125%) of dynamic memory, leaving -648 bytes for local variables. The maximum is 2560 bytes.
 



When I compile the same code on the same target, the hex file is generated!

Code:
Program smote_arduino size: 12,312 bytes (used 43% of a 28,672 byte maximum) (1.66 secs)
Minimum Memory Usage: 3208 bytes (125% of a 2560 byte maximum)
 



I used Arduino Leonardo.
Back to top
 
 
IP Logged
 
Waleed El-Badry
Junior Member
**
Offline



Posts: 14
Egypt
Re: Code compiled although Global variables use 3208 bytes (125%) of dynamic memory !!
Reply #1 - Sep 13th, 2020 at 10:26pm
 
I attached the log
Back to top
 

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



Posts: 10895
United Kingdom
Re: Code compiled although Global variables use 3208 bytes (125%) of dynamic memory !!
Reply #2 - Sep 13th, 2020 at 10:49pm
 
Thanks for the log. When Usb/Wifi debugging is enabled the debug commands are injected into the temp version of the code prior to compile.

You can see if debug is enabled because the "Compiling" message include the word "debug"
Code:
Compiling debug version of 'smote_arduino' for 'Arduino Leonardo' 



If Automatic Debugging is enabled (the default) then please switch the tool bar from Debug to Release.

Does this solve the issue?

Thanks

ps: We will inspect your output during th next few days to see why debug mode has consumed so much memory. That can depend on the number of breakpoints and the use of Serial can also consume global memory. Therefore for smaller cpu's such as the lenorado there can be a fine balance depending on what your own code is (or is not already) doing.
Back to top
« Last Edit: Sep 13th, 2020 at 10:51pm by Visual Micro »  

Tim Leek
home
WWW  
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 537
Re: Code compiled although Global variables use 3208 bytes (125%) of dynamic memory !!
Reply #3 - Sep 18th, 2020 at 2:03pm
 
We have a new release (20.09.10.2) which will fail the compilation if > 100% of the memory is used at build time as expected.

This is available from the top of the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print