Run spark code on PC/Linux/OSX


How do all of you do development? I find the compile/upload/test/debugging cycle to slow. My goal is not tot a circuit simulation but the functional testing of “my custom code”

I have been looking att VBB, proteus SSI etc but the tools i have found are either not really good or quit expensive and not tailored to the spark.

I am interesting to know others are doing this. Do you run “custom code” locally on your desktop (PC/OSX/linux)? How? .Compiled agains the spark core firmware or some kind of mockup framework? Are there any open source tools available?


If you do a quick forum search, you’ll be sure to find several topics covering this. To spare you the trouble, take a look at Spark Dev, and the Spark CLI. Both can be found in the docs. Supporting information can be found on the forum if you search for it.

@gijs, just to add to what @Moors7 said, there is a great topic on setting up a local debugging environement:

If you are referring to an emulator for the core, there is no such "formal" environment. The closest thing is the development of a HAL layer which has been demonstrated to run on a PC to emulate a core. Perhaps @mdma can speak more to that :smile:

I developed the flashee library on my desktop machine, only moving to the spark after various unit tests had passed. This made the development cycle much faster and gave me higher confidence in the code (as well as tools to debug one problem that appeared later.)

The trick is to have a good abstraction of the spark system - try to make your code as independent of the underlying hardware as possible, abstracting any use of the system into functions or classes, so these can easily be faked on your desktop machine.

Hope this helps! :slight_smile:

1 Like

I mean something like codeblocks for Arduino ( It contains a simulator the runs code on my desktop.

Is that possible out of the box with the HAL layer @mdma refers too? Is there a guide available on how to use that?

regards Gijs