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
Copy file name to clipboardExpand all lines: README.md
+78-35Lines changed: 78 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -80,23 +80,40 @@ Unlike traditional Arduino implementations, where the final output is a standalo
80
80
81
81
The `loader` is responsible for managing the interaction between your sketches and the underlying Zephyr system. After the initial bootloader installation, the `loader` takes over the sketch loading process automatically.
82
82
83
-
To ensure flexibility, the `loader` project is designed to be generic. Any necessary modifications for specific boards should be made in the corresponding `DTS overlay` or a special `fixup` file, using appropriate guards to maintain stability.
83
+
To ensure flexibility, the `loader` project is designed to be generic. Any necessary modifications for specific boards should be made in the corresponding "DTS overlay" or a special "fixup" file, using appropriate guards to maintain compatibility.
84
84
85
-
The behavior of the `loader` can be adjusted through the `Mode` menu:
85
+
The behavior of the `loader` can be adjusted through the `Mode` menu of the IDE:
86
86
-`Standard`: The sketch is loaded automatically.
87
87
-`Debug`: The user must type `sketch` in Zephyr's shell, which is accessible via the default Serial.
88
88
89
89
The most important components of this project are:
The firmwares will be copied to [firmwares](/firmwares) folder.
167
+
The firmwares will be copied to the [firmware](/firmware) folder, and the
168
+
associated variant will be updated.
142
169
143
170
### Flash the Loader
144
171
145
172
If the board is fully supported by Zephyr, you can flash the firmware directly onto the board using the following command:
146
173
```bash
147
174
west flash
148
175
```
176
+
This can also be performed via the "Burn bootloader" action in the IDE if the core is properly installed, as detailed below.
149
177
150
178
### Using the Core in Arduino IDE/CLI
151
179
152
-
After running the `bootstrap` script, you can symlink the core to `$sketchbook/hardware/arduino-git/zephyr`. Once linked, it will appear in the IDE/CLI, and the board's Fully Qualified Board Name (FQBN) will be formatted as `arduino-git:zephyr:name_from_boards_txt`.
180
+
After running the `bootstrap.sh` script, you can symlink the core to `$sketchbook/hardware/arduino-git/zephyr`. Once linked, it will appear in the IDE/CLI, and the board's Fully Qualified Board Name (FQBN) will be formatted as `arduino-git:zephyr:name_from_boards_txt`.
153
181
154
-
### Using the Core in Arduino IDE/CLI (without installing Zephyr toolchain)
182
+
##🚀 Adding a new target
155
183
156
-
To help core developers (who might not be interested at all in setting up a full Zephyr build system) we are providing [sync-zephyr-artifacts](/extra/sync-zephyr-artifacts) utility. After compiling it via `go build`, run as `sync-zephyr-artifacts .` to retrieve the files needed to compile sketches and flash the loader.
184
+
> [!TIP]
185
+
>
186
+
> While Zephyr supports a lot of different hardware targets, only the few
187
+
> currently used by the Arduino core are installed by default. To add the
188
+
> support for every Zephyr target to your workspace, run the following
189
+
> commands:
190
+
>
191
+
> ```bash
192
+
>. venv/bin/activate
193
+
> west config -d manifest.project-filter
194
+
> west sdk install --version 0.17.0
195
+
> west update
196
+
>```
157
197
158
-
## 🚀 Adding a new target
198
+
To add a new board that is already supported by mainline Zephyr with the target`$your_board`, follow these steps:
159
199
160
-
To add a new board that is already supported by mainline Zephyr, follow these steps:
200
+
* Get the variant name from your board by running `extra/get_variant_name.sh $your_board`.
201
+
* Create a folder in the [`variants/`](/variants) directory with the same name as the variant for your new board.
202
+
* Create the DTS `<variant>.overlay` and Kconfig `<variant>.conf` files in that directory.
161
203
162
-
* Create the `DTS overlay` and `.conf` files in the [loader](/loader/boards) directory.
163
204
The overlay must include:
164
-
* A flash partition called `user_sketch`, tipically located near the end of the flash.
205
+
* A flash partition called `user_sketch`, typically located near the end of the flash.
165
206
* A `zephyr,user` section containing the description forGPIOs, Analog, UART, SPI and I2C devices. Feel free to leave some fields emptyincase Zephyr support is missing. This will result in some APIs not being available at runtime (eg. `analogWrite` if PWM section is empty).
166
-
* Build the Loader: run `./extra.build.sh $your_board $your_board` and start debugging the errors. :grin:
207
+
208
+
The Kconfig file must include any board-specific options required by this target.
209
+
* Build the Loader: run `./extra/build.sh $your_board` (with any additional arguments as required) and start debugging the errors. :grin:
167
210
* Update the `boards.txt`: add an entry for your board, manually filling the required fields.
168
-
* Implement touch support: if your board supports the `1200bps touch` method, implement `_on_1200_bps` in a file located inside the `variant/your_board` folder.
169
-
* ⏳ Temporary steps
170
-
* Create `includes.txt` based on `llext-edk/Makefile.cflags`, taking inspiration for other variants.
171
-
* Amend `your_board.compiler.zephyr.*` with information from `llext-edk/Makefile.cflags`.
211
+
212
+
Make sure to set:
213
+
*`build.zephyr_target` and `build.zephyr_args` to the arguments used in the `build.sh` call;
214
+
*`build.zephyr_hals` to the (space-separated list of) HAL modules required by the board;
215
+
*`build.variant` to the variant name identified above.
216
+
* Implement touch support: if your board supports the "1200bps touch" method, implement `_on_1200_bps`in a file located inside the variant folder of your board.
172
217
173
218
## 🐛 Bug Reporting
174
219
@@ -183,14 +228,12 @@ Contributions are always welcome. The preferred way to receive code contribution
183
228
184
229
## 📌 Upcoming features
185
230
186
-
-[x] Unify overlay in [loader](/loader/boards) with the one provided in [variant](/variant) for interoperability with GSoC project
187
-
-[x] Autogenerate `defines.txt`, `includes.txt`, `cflags.txt` from `llext-edk` output
231
+
- [ ] Remove binaries from this repo history (arduino/ArduinoCore-zephyr#102, :warning: will require a clean clone)
188
232
- [x] Network: support UDP and TLS
189
-
-[ ] USB: switch to USB_DEVICE_STACK_NEXT to support PluggableUSB
190
-
-[ ] Relocate RODATA in flash to accomodate sketches with large assets
233
+
- [ ] USB: switch to `USB_DEVICE_STACK_NEXT` to support PluggableUSB
234
+
- [ ] Relocate RODATA in flash to accommodate sketches with large assets
191
235
- [ ] Provide better error reporting for failed llext operations
192
-
-[ ] Replace [llext_exports.c](/loader/llext_exports.c) with proper symbols generation (via includes)
193
-
-[x] Provide better usability for `Debug` builds (eg. shell over USB)
0 commit comments