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
+55-46Lines changed: 55 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -15,25 +15,68 @@ This repository contains the official implementation of **Arduino Core** for Zep
15
15
## ⚙️ Installation
16
16
17
17
Install the core and its toolchains via Board Manager:
18
-
* Download and install the latest [Arduino IDE](https://www.arduino.cc/en/software) (only versions `2.x.x` are supported)
19
-
* Open the *'Settings / Preferences'* window
20
-
* Open the *'Boards Manager'* from the side menu and search for *'Zephyr'*
21
-
* If it doesn’t appear, add the following URL to the *'Additional Boards Manager URLs'* field: `https://downloads.arduino.cc/packages/package_zephyr_index.json` (if you have multiple URLs, separate them with a comma)
22
-
* Install the `Arduino Zephyr Boards` platform
18
+
* Download and install the latest [Arduino IDE](https://www.arduino.cc/en/software) (only versions `2.x.x` are supported).
19
+
* Open the *'Settings / Preferences'* window.
20
+
* Open the *'Boards Manager'* from the side menu and search for *'Zephyr'*.
21
+
* If it doesn’t appear, add the following URL to the *'Additional Boards Manager URLs'* field: `https://downloads.arduino.cc/packages/package_zephyr_index.json` (if you have multiple URLs, separate them with a comma).
22
+
* Install the `Arduino Zephyr Boards` platform.
23
23
24
24
Alternatively, to install the core using the command line, run the following command with the Arduino CLI:
* Put the board in bootloader mode by double-clicking the RESET button.
34
+
* Run the `Burn Bootloader` option from the IDE/CLI.
35
+
* Note that due to limitations in the Arduino IDE, you may need to select any programmer from the `Programmers` menu.
36
+
* Once the bootloader is installed, you can load your first sketch by placing the board into bootloader mode again.
37
+
38
+
> [!NOTE]
39
+
> After the initial setup, future sketches will be loaded automatically without needing to reset the board.
40
+
41
+
## 🔧 Troubleshooting
42
+
43
+
### Common Issues
31
44
32
-
Unlike traditional Arduino implementations, where the final output is a standalone binary loaded by a bootloader, this core generates a freestanding `elf` file. This file can be dynamically loaded by a precompiled Zephyr firmware, referred to as the `loader`.
45
+
#### **Q: My Sketch doesn't start (Serial doesn't appear)**
46
+
**A:** Connect a USB-to-UART adapter to the default UART (eg. TX0/RX0 on Giga, TX/RX on Nano) and read the error message (with the sketch compiled in `Default` mode). If you don't own a USB-to-UART adapter, compile the sketch in `Debug` mode; this will force the shell to wait until you open the Serial Monitor. Then, run `sketch` command and *probably* you'll be able to read the error (if generated by `llext`). For OS crashes, the USB-to-UART adapter is the only way to collect the crash.
33
47
34
-
For the end user, installing the `loader` is easy. Simply run `Burn Bootloader` option from the IDE/CLI while the board is in bootloader mode (by double-clicking the RESET button). Note that due to limitations in the Arduino IDE, you may need to select any programmer from the `Programmers` menu.
48
+
---
49
+
50
+
#### **Q: I did it and I get the error: `<err> llext: Undefined symbol with no entry in symbol table ...`**
51
+
**A:** This means you are trying to use a Zephyr function which has not yet been exported. Open `llext_exports.c`, add the function you need and recompile/upload the loader.
52
+
53
+
---
54
+
55
+
#### **Q: I want to use a Zephyr subsystem which is not compiled in**
56
+
**A:** Open the `.conf` file for your board, add the required `CONFIG_`, recompile/upload the loader.
35
57
36
-
To load the first sketch, the board must also be manually placed into bootloader mode. After this initial setup, the standard "autoload" method will take over for future sketches.
58
+
---
59
+
60
+
#### **Q: I get an OS crash, like `<err> os: ***** USAGE FAULT *****`**
61
+
**A:** This is usually due to a buffer overflow or coding error in the user's own code. However, since the project is still in beta 🧪, a [good bug report](#bug-reporting) could help identify any issues in our code.
62
+
63
+
---
64
+
65
+
#### **Q: I get an out of memory error**
66
+
**A:** Since collecting bug reports is very important at this time, we are keeping Zephyr's shell enabled to allow loading a full sketch (which requires a large stack). Adjust your board's `.conf` file to reduce the stack size if your platform doesn't have enough RAM.
67
+
68
+
## 📚 Libraries
69
+
70
+
### Included with the core: ###
71
+
72
+
### Separately supplied: ###
73
+
-**ArduinoBLE**: This library is enabled only for the Arduino Nano 33 BLE. Please use [this branch](https://github.com/facchinm/ArduinoBLE/tree/zephyr_hci) to test it.
74
+
75
+
## 🧢 Under the hood
76
+
77
+
Unlike traditional Arduino implementations, where the final output is a standalone binary loaded by a bootloader, this core generates a freestanding `elf` file. This file is dynamically loaded by a precompiled Zephyr firmware, referred to as the `loader`.
78
+
79
+
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.
37
80
38
81
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.
39
82
@@ -51,7 +94,7 @@ The most important components of this project are:
51
94
52
95
## 🛠️ Setup the environment
53
96
54
-
In this section, we’ll guide you through setting up your environment to work with the core, making it easy to compile and upload your sketches to compatible boards.
97
+
In this section, we’ll guide you through setting up your environment to work with the core.
55
98
56
99
Shell scripts are available to simplify the installation process (Windows is not supported at the moment 😔).
57
100
@@ -76,7 +119,7 @@ Download and install the Zephyr SDK for your OS from [here](https://github.com/z
@@ -97,44 +140,10 @@ If the board is fully supported by Zephyr, you can flash the firmware directly o
97
140
west flash
98
141
```
99
142
100
-
##🖥️ Using the Core in Arduino IDE/CLI
143
+
###Using the Core in Arduino IDE/CLI
101
144
102
145
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`.
103
146
104
-
## 🔧 Troubleshooting
105
-
106
-
### Common Issues
107
-
108
-
#### **Q: My Sketch doesn't start (Serial doesn't appear)**
109
-
**A:** Connect a USB-to-UART adapter to the default UART (eg. TX0/RX0 on Giga, TX/RX on Nano) and read the error message (with the sketch compiled in `Default` mode). If you don't own a USB-to-UART adapter, compile the sketch in `Debug` mode; this will force the shell to wait until you open the Serial Monitor. Then, run `sketch` command and *probably* you'll be able to read the error (if generated by `llext`). For OS crashes, the USB-to-UART adapter is the only way to collect the crash.
110
-
111
-
---
112
-
113
-
#### **Q: I did it and I get the error: `<err> llext: Undefined symbol with no entry in symbol table ...`**
114
-
**A:** This means you are trying to use a Zephyr function which has not yet been exported. Open `llext_exports.c`, add the function you need and recompile/upload the loader.
115
-
116
-
---
117
-
118
-
#### **Q: I want to use a Zephyr subsystem which is not compiled in**
119
-
**A:** Open the `.conf` file for your board, add the required `CONFIG_`, recompile/upload the loader.
120
-
121
-
---
122
-
123
-
#### **Q: I get an OS crash, like `<err> os: ***** USAGE FAULT *****`**
124
-
**A:** This is usually due to a buffer overflow or coding error in the user's own code. However, since the project is still in beta 🧪, a [good bug report](#bug-reporting) could help identify any issues in our code.
125
-
126
-
---
127
-
128
-
#### **Q: I get an out of memory error**
129
-
**A:** Since collecting bug reports is very important at this time, we are keeping Zephyr's shell enabled to allow loading a full sketch (which requires a large stack). Adjust your board's `.conf` file to reduce the stack size if your platform doesn't have enough RAM.
130
-
131
-
## 📚 Libraries
132
-
133
-
### Included with the core: ###
134
-
135
-
### Separately supplied: ###
136
-
-**ArduinoBLE**: This library is enabled only for the Arduino Nano 33 BLE. Please use [this branch](https://github.com/facchinm/ArduinoBLE/tree/zephyr_hci) to test it.
137
-
138
147
## 🚀 Adding a new target
139
148
140
149
To add a new board that is already supported by mainline Zephyr, follow these steps:
0 commit comments