Offline Compilation

Hi all,

Just about to purchase a Spark Core but am interested in knowing whether it can be programmed entirely offline (i.e. from the Spark CLI). The tutorials show offline compilation with Spark but during the compilation it seems as though the CLI fetches a ‘base’ image from the Spark website. This is shown below:

$ spark compile blinky.ino
Including:
blinky.ino
attempting to compile firmware
pushing file: blinky.ino
grabbing binary from: https://api.spark.io/v1/binaries/01234567890ABCDEFGH
saved firmware to firmware_123456781234.bin
Compiled firmware downloaded.

Note the “grabbing binary” line.

Is this always necessary or is there are way to compile entirely offline?

Thanks,
Ian

You are in fact compiling your code with the build farm on the spark :cloud:.

A true offline compilation would be using the GCC toolchain + make :wink:

1 Like

@ibebbs, the Spark CLI uses the Spark Cloud’s compile server farm so it is not truly offline. When you compile an application, the final .bin file is comprised of the base core-firmware and the user program. The .bin file you see being “grabbed” from the Cloud compile servers is that final file being downloaded to your PC.

For truly offline compiling you need to create a local toolchain and clone the core firmware repos onto your PC. You can follow the instructions on the core-firmware github repo here. :slight_smile:

3 Likes

That’s what I needed to know.

Thanks peekay

1 Like

i’ve got some 0.8 builds of dfu-util here and of course git and make etc. you can get via your distro’s package manager e.g: apt-get install git-core build-essential on debian or for fedora yum install git make

the gcc-arm-none-eabi page isn’t very user-friendly, so basically you need to get this file, untar it and add the bin subdirectory to your $PATH.

basically don’t install dfu-util or gcc-arm-none-eabi from the debian/ubuntu repo’s they’re hideously old and broken.

Hi @sej7278

Are you using a 32 bit linux distro? I’m having trouble with the version of gcc-arm-none-eabi that I’ve downloaded, I think it’s because I’m running 64 bit debian.

sorry for the noise, I just worked it out. Just requires having ia32-libs installed for multiarch support.

1 Like