Upload application firmware using PUT - multiple source files?

I wish to find a way not to use the web build interface. I want to keep my source code locally and use standard Unix techniques for source code version control and a Makefile to manage the build and the upload. How do I use HTTPS PUT to upload the source of firmware when the source consists of a not only a program but also an include file and a library? I can see and understand the instructions when one only file must be PUT. But I will have 3 (or more) files composing one application firmware.

Once you build the application binary it will contain the include files and libraries. You’ll only need to upload the one bin file. You don’t compile on the Spark; you compile on your Linux host (or via the Web IDE) and then upload the result to the Spark.

You can do like what @erjm mentioned and upload to your core using Spark-CLI :slight_smile:

1 Like

No, my reading is that that is not how it has to work. You can do it your way but there is an easier way: You can PUT source code and it is compiled in the cloud and sent to the Core. I am trying to avoid having to do the build. But my source is three files and I don’t see how I can combine those into one PUT. How do I do that?

I have a separate thread about not being able to install spark-cli - it’s not my day :frowning:

Oh yes I saw that. What’s the time there?

I can give you some assistance after a morning run :slight_smile:

Hi @psb777,

If you’re familiar with Javascript / Node, you can see how I did this in the CLI here:

https://github.com/spark/spark-cli/blob/master/js/lib/ApiClient.js#L362

and here:

https://github.com/spark/spark-cli/blob/master/js/commands/CloudCommands.js#L158

Essentially, you just PUT to that API endpoint, with multiple files, and make sure you set the filename attribute, and then grab the binary from the url in the response.

Thanks,
David

1 Like

Thanks! That looks as if it might be just the thing I need although I may not be able to try it for a few days. Currently I’m battling installing spark-cli (another thread here) but I make some progress. Thanks again, I will report back, when I can.

1 Like

But there is an easier way!

1 Like