1
Hello fellow Spark users.
I wanted to show you my small side project: a Atom editor package, which allows quick flashing using bundled dfu-util. Just open an Arduino project, compile it using Spark CLI spark compile ., press F6 in Atom and have your code uploaded using DFU:
For now it only works on OS X, but I would be happy to add more platforms if someone could prepare all required binaries 
If you want to try it, open Atom command palette -> Settings View: Install Packages and search for Spark Dfu Util.
Feel free to share your opinions 
BDub 3
That's sweet! Looks similar to Sublime Text... which leads me to the question, why Atom vs. Sublime Text? Is it just that it's free and open?
I've been trying to think of a better way to get the Core into DFU mode automatically... there is one suggestion that uses the Cloud which is quite novel, but not practical in the sense that you have to add special code to your Core with every application
suda 4
Thanks man!
Atom was chosen because it started as a āSpark Studioā idea
I wanted to create a standalone IDE for core and I needed an editor which license would alow that. But weāll see how it goes.
With DFU I was looking into the same topic, but it would create additional problems. I can add this code before compiling, but then thereās no guarantee that core is connected to cloud or which core is the one we want to flash. Only way I see is tinkering with DFU protocol on both core and desktop to be able to force DFU mode via dfu-util. But even with manual DFU it still beats cloud flash when it comes to speed (at least in EU) 
zach 5
This is AWESOME!!! I canāt wait to try it myself.
Have you thought about adding the option for flashing through the Cloud, in addition to flash over USB? You could use the Spark CLI:
I could imagine this working in two ways. First, you could call the CLI directly with exec; second, you could integrate the Node.js code from the CLI directly into the IDE. That would quickly give you the full power of the CLI, which would give you the OTA flash, and also the account management stuff (to login to your spark account so you donāt have to manually enter your access token)
What binaries are you looking at? Iām 0 experience with this but if you could tell me what you need to port, letās say Windows, Iāll try 
Always wanted to do this and was looking at codebender.cc! Power of the open source community indeed 
suda 7
@zach definitely! I want to integrate whole CLI along with OTA flash and all the other goodies it provides
Iāve looked into it and it should be pretty straightforward (just needs a few UI views).
@kennethlimcp I see that all tools (gcc-arm-embedded, make, dfu-util) actually already have binaries for Windows. Only the part with Zadig and replacing driver with libusbK (thanks for the tutorial BTW!) can be tricky from command line/script. Iāll have to get hold of some Windows machine and try it out.
Hey @suda, you donāt need that for the Web IDE.
The user needs to change the driver by themselves and maybe you just need to have a notice when they select dfu flashing in Windows?
Thanks for the great work! I really appreciate your effort 
suda 9
@kennethlimcp I could ask user to do this, but it would be more āmagicalā it it was done automatically 
I know that OTA flash is the preferred method, but in my case it takes around 1ā²40ā³ compared to 10ā³ using USB.
BDub 10
So are you at least taking advantage currently of the Cloud compiler?
You can compile in the cloud (1 second typically), download the BIN, then DFU over USB as normal ![]()
Compiling remotely and Flashing locally
http://docs.spark.io/cli/#running-from-source-advanced-spark-flash
Hey @suda,
Thereās an unofficial build source for Windows we can use!
Iām just wondering, how do we update the bundled software in future? 
Also, iām unable to build/verify/flash/toggle log view etc⦠Sorry to hijack here. Would be happy to resolve this with you offline? 
suda 12
@BDub I did not now about this
It looks like I wasted a lot of my time on bundling binaries and generating makefiles for nothing. Iāll play around with it and probably use it as a default way of compiling in future versions.
@kennethlimcp Are you using this Windows build? We can Skype (my handle is suda_skype) and try to resolve any issues.
About update, core utils like gcc, make or dfu-util donāt have to be updated. Only core-firmware and libraries need to be up to date. There can be a schedule to update plugin once a week with new firmware. Although if cloud compile would be used, thereās no need for that.
Iām actually on Mac OSx
Do i need to install make etc? I only installed Atom followed by your plugin
suda 14
You donāt have to install anything (itās all bundled with plugin). Add me on Skype and weāll try to figure it out.
see you there. Mineās kennethlimcp 
another thing to take note is that the Spark-CLI compile function via the
allows the file to be a .cpp and the folder name does not to be the same as the .cpp file 
Something for the backlog maybe?
Thanks man! Iāll loving this new tool on top of the existing Spark-CLI which brought me tons of joy 
frlobo 16
Hi All.
What is this doing behind the scenes?
I want to compile an app locally (like the cloud IDE does), but donāt know what I need to do with make to compile an uploadable binary.
avidan 17
this is seriously cool. just locally compiled using Atom + pluginā¦this might be my local IDE of choice. could not have been easier.
now if there was only a way to enter DFU mode without physically touching the core buttons.
suda 19
This plugin contains all required tools required to compile core-firmware with replacing application.cpp using your code. Then it launches dfu-util to flash the core 
So if youāre on OS X, itās all you need to build and flash your code locally (without the cloud).
avidan 20
this is awesome! now, assuming that i add this function all my applications (wish this could be built in by default!)....would i just make a rest call to "doDFU" before using the Atom plugin to compile / flash? it would be really great if we could modify the plugin to all "doDFU".
thoughts?
