Skip to content

Commit 0596a84

Browse files
Your Namelucarin91
authored andcommitted
readme update
1 parent 1d15843 commit 0596a84

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,49 @@ This tool acts as a versatile wrapper for OpenOCD (Open On-Chip Debugger), allow
1414
## License
1515

1616
This project is licensed under the GPL3 license. See the LICENSE file for details.
17+
18+
## ArduinoCore-Zephyr ecosystem
19+
ArduinoCore-Zephyr acts as a wrapper for the Arduino API, implemented using the powerful and flexible APIs of the [Zephyr RTOS](https://www.zephyrproject.org/). This allows developers to write standard Arduino sketches that run on Zephyr-supported hardware.
20+
21+
### How it Works ⚙️
22+
23+
The core translates familiar Arduino functions into their Zephyr equivalents. This translation is resolved at **compile time** based on the selected hardware platform.
24+
25+
For example, the standard Arduino `digitalWrite()` function is implemented using Zephyr's `gpio_pin_set_dt()`:
26+
27+
```cpp
28+
// From: cores/arduino/zephyrCommon.cpp
29+
void digitalWrite(pin_size_t pinNumber, PinStatus status) {
30+
gpio_pin_set_dt(&arduino_pins[pinNumber], status);
31+
}
32+
```
33+
In Zephyr a platform generally refers to the combination of hardware and architecture that Zephyr can run on.
34+
35+
The `gpio_pin_set_dt` function is part of Zephyr's hardware abstraction layer and is configured specifically for the target board during the build process.
36+
37+
38+
### Platforms & Compilation
39+
40+
In the Zephyr ecosystem, a platform refers to the specific combination of hardware and architecture. This core uses the standard Arduino platform definition format.
41+
42+
For example, the platform for an Arduino UNO Q board (running on an STM32U585xx) is defined as: `arduino:zephyr:unoq`
43+
44+
45+
You can compile a sketch for a specific platform using the arduino-cli:
46+
47+
```bash
48+
arduino-cli compile YourSketch.ino -b arduino:zephyr:unoq
49+
```
50+
51+
This command compiles the sketch, linking it against the correct Zephyr APIs for the specified board.
52+
53+
### Uploading with remoteocd
54+
Uploading the compiled binary to the microcontroller is handled by remoteocd. Instead of relying on hard-coded flash commands, it accepts an OpenOCD configuration file. This allows you to tailor the upload script to specific debugging or flashing requirements.
55+
ArduinoCore-Zephyr automatically installs remoteocd into the Arduino tools folder during setup.
56+
57+
To upload your compiled sketch, use the following Arduino CLI command:
58+
59+
```bash
60+
arduino-cli upload YourCompiledSketch -b arduino:zephyr:unoq
61+
```
62+

0 commit comments

Comments
 (0)