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
Hot Topic (More than 8 Replies) Cant make the simulator to work (Read 4786 times)
Chagui
Newbies
*
Offline


Posts: 4
Joined: Feb 26th, 2017
Cant make the simulator to work
Feb 27th, 2017 at 5:46pm
Print Post  
Hi,
im having troubles working with the simulator in a project done with visual micro. Problem is i cant debug code correctly, it seems it doesnt find the source file (just shows disassembly).

Im using Atmes Studio 7, and visual micro.

i followed the guide thats in the build output, that is, i created the .cpp file, i have selected atmel studio deviuce programming, and selected alwasy use programmer for uploading. then i selected the atmel studio debugger from the visual micro debugger menu.

things i tried:
Creating a new normal project. Works OK.
Creating new arduino project from file->new->project. Not working.
Creating a new arduino project from visual micro menu. Not working.
tried disabling the optimizations by using the macros i found somewhere in the web

My project complies fine, its just that it doesnt find the source files when debugging, and im left with only assembler.

i tried searching for more info in the net but i failed to fix the issue.

Am i missing something? Is there a guide, like for dummies, that shows all the steps from start to finish?

Thanks.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cant make the simulator to work
Reply #1 - Feb 27th, 2017 at 5:59pm
Print Post  
If the sim starts okay but then can't find sources try click "vMicro>Toggle Hidden Files" so that short cuts to underlying code becomes known to the project.

If you have "vMicro>debugging>atmel studio debugging" enabled think might work better these days. Historically we have used the atmel studio "File>Open object file for debugging"  to open the compiled output.

I have not yet tried the sim with "vMicro>debugging>atmel studio debugging" . In any case if you have it enabled you should follow the guide to NOT use .ino files but use a combined .cpp instead. Have you seen the note about this in the build output when "vMicro>debugging>atmel studio debugging" is enabled?

Finally say what hardware you are using and give a screen shot of the ide with project open.

Thanks
  
Back to top
WWW  
IP Logged
 
Chagui
Newbies
*
Offline


Posts: 4
Joined: Feb 26th, 2017
Re: Cant make the simulator to work
Reply #2 - Feb 27th, 2017 at 8:11pm
Print Post  
Thank you!

at his point im just running an empty project, my .ino file is empty, and my .cpp has just an almost empty loop

I was using an atmega1284p in my previous project, but in this example im using arduino uno board with atmega328p.

If i use "toggle hidden files" i get an error window saying something about some file that already exists with a different extension. It still works though, it shows all the files.

If i use File->Open->"open object file for debugging" i get the same effect, i just see disassembly, no c++ code.
« Last Edit: Feb 27th, 2017 at 8:31pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cant make the simulator to work
Reply #3 - Feb 27th, 2017 at 8:30pm
Print Post  
Thanks

The error can be ignored when you use toggle hidden. atmel studio doesn't like files with names the same even if the extension is different. You appear to have enough source in the project so it should work.

1)

If you right click the project and look at the standard atmel studio project properties which folder is the .elf output file pointing to and what is the name of the .elf

2)

If you look in the output folder specified in 1),  has visual micro placed .elf, .hex and .o files in that folder. is there a .elf with the same name?

3)

Switch on vmicro>compiler>verbose and also the "show build properties" option. then build isual micro the output and copy the "micro build" output window into a .txt file. Email the .txt to info[at]visualmicro.com along with a link to this post.


thanks
  
Back to top
WWW  
IP Logged
 
Chagui
Newbies
*
Offline


Posts: 4
Joined: Feb 26th, 2017
Re: Cant make the simulator to work
Reply #4 - Feb 27th, 2017 at 9:14pm
Print Post  
1)
name of elf: test2.elf
folder of elf: i cant find any option to set this, but i think it defaults to the /debug directory inside the project.

2) output files: i can see .elf, .hex, and .o files is there but goes away when debugger starts.
If i look in a working, normal atmel studio project, the .o file does not get deleted. So maybe thats it?


if i see the output of a normal atmel studio project, it has indeed a main.o and also a main.d file

3)file sent to specified email

thanks!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cant make the simulator to work
Reply #5 - Feb 28th, 2017 at 12:44pm
Print Post  
Thanks

I already reported to atmel that they are clearing the files for no reason at all. They will fix sometime but try this.

Make sure the project is NOT selected for atmel studio build. "Build>Configuration Manager>Remove the check mark from all check boxes" 
  
Back to top
WWW  
IP Logged
 
Chagui
Newbies
*
Offline


Posts: 4
Joined: Feb 26th, 2017
Re: Cant make the simulator to work
Reply #6 - Mar 1st, 2017 at 1:21pm
Print Post  
Hellooo
i did more testing and discovered the issue.

I installed a new virtual machine, in which i installed atmel studio 6.2 with arduino 1.6.9. Everything worked fine.
Then i installed atmel studio 7, using the same arduino, 1.6.9. Everything worked fine, Huh??
I changed from arduino 1.6.9 to 1.6.12, the same version i have installed here. Issues come back!
I changed from 1.6.12 to 1.8.1. Everything worked fine.
So it seems to be something specific to 1.6.12. 
I checked more versions and came to this list:
1.6.9 good
1.6.10 bad
1.6.11 bad
1.6.12 bad
1.6.13 bad
1.8.1 good

all versions compile fine, but the bad ones wont debug.
« Last Edit: Mar 1st, 2017 at 1:35pm by Chagui »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cant make the simulator to work
Reply #7 - Mar 1st, 2017 at 6:30pm
Print Post  
Thanks very much for letting me know. I have no idea what difference there is between those Arduino versions that would affect the results but well done for fixing.
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cant make the simulator to work
Reply #8 - Mar 1st, 2017 at 8:34pm
Print Post  
I've just had a thought. I might have read some discussion on the arduino dev channel about the debug output compiler switch being switched on. 

I wonder if your findings show that it used to be on then was switched off for a while.

We can compare the verbose compiler output of a single "avr-gcc/++" command to see the difference between compiler switches.

For future reference: Compiler switches can also be added via the visual micro project properties.
« Last Edit: Mar 1st, 2017 at 8:34pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint