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 product ideas (Read 4939 times)
Simon Fedida
Newbies
*
Offline


Posts: 6
Location: London UK
Joined: Jan 27th, 2013
VM product ideas
Jun 2nd, 2013 at 9:22pm
Print Post  
Hi -

I've been using VM for a couple of months now coding up a little project (info here http://astrobling.weebly.com/digital-setting-circles.html) and today just paid my sub ($15 = £19 ??)

So here are a couple of suggestions for VM product ideas that occurred to me while working on it - apologies if they have already come up or been discussed:

It would be very nice to be able to run code on a simulation of the arduino board(s) rather than download to the target.  There are 2 modes I would have in mind: 

the first is to be able to run code that doesn't reference target hardware at all: loads of code could be tested by loading up some start values and letting it run without ever going near the board.

Second mode would be if the arduino board could run a monitor program that executed primitive functions like reading/writing ports on command from the PC.  The debugger on the PC runs the user code, intercepts any arduino or hardware function calls, relays them to the monitor, gets the results back and hands them over to the user code. Obviously any critical timings would be all over the place, but you would have the advantage of debugging your code executing on the PC.

Thats my 2 bits.  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VM product ideas
Reply #1 - Jun 2nd, 2013 at 9:46pm
Print Post  
Thanks and thanks for supporting the project.

Quote:
the first is to be able to run code that doesn't reference target hardware at all: loads of code could be tested by loading up some start values and letting it run without ever going near the board


Yes, this has and is being considered as we speak. There is are couple of simulators out there already. One question is could we speak with the authors and discuss integration. 

Interestingly we recently added support for wincyg. This has been used by the diydrones Arduino project to provide "Software In The Loop", the diyd Arduino project compiles the SITL version using cygwin and runs the resulting windows program instead of uploading to an arduino board. You can read about this in the wiki (see APM)

The question is what can be done easily and quickly so that we have something to experiment with.

If you have time, maybe you can take a look at how the SITL.ino source in the APM project re-defines the Arduino core to imitate the Arduino. If you find it is relatively easy to use this source to make a SITL build of your own project then maybe it will be easy for the add-in to replicate your work in a standard way.

The .net microframework emulator is another tool I would like to explore. It defines a good interface for a sim and it would be interesting to see if we can use some of the microsoft tools for our Arduino projects. At worst maybe look at the interfaces it provides and also how various emulator hardware might be defined using custom xml definition files.

Quote:
Second mode would be if the arduino board could run a monitor program that executed primitive functions like reading/writing ports on command from the PC.  The debugger on the PC runs the user code, intercepts any arduino or hardware function calls, relays them to the monitor, gets the results back and hands them over to the user code. Obviously any critical timings would be all over the place, but you would have the advantage of debugging your code executing on the PC.


If I read this right, this is how the Arduino Firmata system works and has long been a consideration for an alternative debug mode within VS/Atmel.

Sorry for the quick brain dump, dev is pretty busy for a few weeks with the final Arduino 1.5x changes. However it is a great topic and if anything I have said sparks a fuse then please continue this discussion here.

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VM product ideas - Atmel Simulator
Reply #2 - Jun 5th, 2013 at 2:43pm
Print Post  
Hi,

I have had some interesting discussion with Atmel regarding the sim and hope to have a smoother option soon. 

After we have a smooth way to start the sim then we can consider how to use real-time values from the Arduino sensors within the sim.

In the meantime you might like to try this, I just tried it and it worked.

1) Switch Tools>Options>Visual Micro>Compiler>Always Show Build Path

2) Build your Arduino project

3) In a new instance of Atmel Studio click "File>Open Object File For Debugging". When prompted paste the build path and name of your sketch.elf into the "Specify Object File To Debug" field. Give the sim project  a name and click OK

4) When Atmel opens the new sim project click "No Tool" on the tool bar and select "Simulator" from the "Debugger/Programmer" drop down list.

5) The just start debugging and the sim will run with your Arduino program

Look forward to hearing how you get on, thanks

  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint