Pages: [1]   Go Down
Author Topic: Emulator?  (Read 1795 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How about an Arduino emulator and compiler that could be used within another IDE like, say, Eclipse? The idea would be to allow Arduino sketches to be written and debugged in that environment (with access to first class debugging facilities), and then simply uploaded to the board using the basic IDE. It would make development of non-simple sketches a whole lot easier.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6637
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Emulators get really complicated when they have to somehow simulate events external to a circuit.
And to some extent, most debuggers are beyond the comprehension of the target audience.  (Every debugger I've seen is essentially similar, and relies a lot on the person behind the screen having a reasonable knowledge of things like variable scope, stack frames, function linkage...)

But yeah, something like this would be nice, even if (especially if?) it managed to implement a simplified subset of debugging and simulation...  (good research project for someone's Master's thesis?)

Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 594
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Atmel's simulators and Atmel's debuggers are the closest tools you'll find for this, you'll need to use AVR Studio for this stuff.

Or you can use something with OpenOCD and GNU's GDB and work in Eclipse.

With both these methods, you'll need to ditch Arduino's IDE and compile the core files manually into every project.

Asking for these features to be added into the Arduino IDE is like asking Lego to include a lathe in every box.
Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Asking for these features to be added into the Arduino IDE is like asking Lego to include a lathe in every box.
He he, great analogy smiley

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6637
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I like  the analogy too.
Quote
you'll need to ditch Arduino's IDE and compile the core files manually into every project.
Actually, the IDE already includes "-g" (GDB debugging support) in each compile command.  In theory, you could start up a gdb on the resulting .elf file and debug away using the gnu simulator (simulavr) ...

I have higher hopes for a sort of source-level simulator (there's at least one out there already: http://hacknmod.com/hack/100-software-based-arduino-simulator/ ), but I don't know how well they'll hold up to the sort of mix of "Arduino library" and "bare metal C manipulation" that is pretty common in Arduino Applications.  (digitalWrite(pin, val) is easy to simulate.  PORTB |= 1<<4 is less so...
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The debugging I was interested in primarily is just to be able to step through the code and see what is going on, view the local variable state and so on.
Logged

Portugal
Offline Offline
God Member
*****
Karma: 6
Posts: 962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That can be easilly done using AvrStudio that as a built-in Simulator for all the Avr micro-controllers, but I dont know how to use GDB, but it looks like a powerfull tool.
Logged

Pages: [1]   Go Up
Jump to: