You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cslt-tool is a convenient wrapper of [arduino-cli](https://github.com/arduino/arduino-cli), it compiles Arduino sketches outputting object files and a json file in a `build/`directory
4
-
The json contains information regarding libraries and core to use in order to build the sketch. The result is achieved by parsing the verbose output of `arduino-cli`.
3
+
`cslt-tool` is a convenient wrapper of [arduino-cli](https://github.com/arduino/arduino-cli), it compiles Arduino sketches outputting a precompiled library in the current working directory.
4
+
It generates a json file in the `extras/` folder that contains information regarding libraries and core to use in order to build the sketch. The result is achieved by parsing the verbose output of `arduino-cli` and by using [GNU ar](https://sourceware.org/binutils/docs/binutils/ar.html) to generate an archive of the object files.
5
5
6
-
## Requisites
7
-
In order to run this tool you have to install first the [arduino-cli](https://github.com/arduino/arduino-cli) and have `arduino-cli` binary in your path, otherwise `cslt-tool` won't work.
8
-
Please use a version of the cli that has [this](https://github.com/arduino/arduino-cli/pull/1608) change, version > 0.20.2
6
+
## Prequisites
7
+
In order to run this tool you have to install first the [Arduino CLI](https://github.com/arduino/arduino-cli) and have `arduino-cli` binary in your `$PATH`, otherwise `cslt-tool` won't work.
8
+
Please use a version of the Arduino CLI that has [this](https://github.com/arduino/arduino-cli/pull/1608) change (version > 0.20.2).
9
+
10
+
Another requirement is [`gcc-ar`](https://sourceware.org/binutils/docs/binutils/ar.html) (installable with `apt-get install gcc`) in your `$PATH`.
For example, running `./cslt-tool compile -b arduino:samd:mkrwifi1010 sketch/sketch.ino` should produce a library with the following structure, in the current working directory:
23
21
```
24
-
The structure of the `build` forder is the following:
22
+
libsketch/
23
+
├── examples
24
+
│ └── sketch
25
+
│ └── sketch.ino <-- the actual sketch we are going to compile with the arduino-cli later
INFO[0001] created libsketch/src/cortex-m0plus/libsketch.a
53
+
INFO[0001] created libsketch/extras/result.json
54
+
```
55
+
56
+
And the content of `libsketch/extras/result.json` is:
31
57
```json
32
58
{
33
59
"coreInfo": {
@@ -36,9 +62,42 @@ And the content of `build/result.json` is:
36
62
},
37
63
"libsInfo": [
38
64
{
39
-
"name": "MKRWAN",
40
-
"version": "1.1.0"
65
+
"name": "WiFiNINA",
66
+
"version": "1.8.13",
67
+
"provides_includes": [
68
+
"WiFiNINA.h"
69
+
]
70
+
},
71
+
{
72
+
"name": "SPI",
73
+
"version": "1.0",
74
+
"provides_includes": [
75
+
"SPI.h"
76
+
]
41
77
}
42
78
]
43
79
}
80
+
```
81
+
82
+
## How to compile the precompiled sketch
83
+
In order to compile the sketch you have first to install manually the libraries and the core listed in the `<libsketch>/extras/result.json` file.
84
+
85
+
You can install a library with [`arduino-cli lib install LIBRARY[@VERSION_NUMBER]`](https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_lib_install/).
86
+
87
+
You can install a core with [`arduino-cli core install PACKAGER:ARCH[@VERSION]`](https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_core_install/).
88
+
89
+
After completing that operation you can compile it with:
0 commit comments