-
-
Notifications
You must be signed in to change notification settings - Fork 17
Add documentation on the new plugin system #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
alessio-perugini
merged 1 commit into
arduino:add-new-plugin-docs
from
MatteoPologruto:update-docs
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,99 @@ | ||||||
# Plugins | ||||||
|
||||||
A new plugin-system has been implemented in the fwuploader. A plugin is basically another executable/tool, specifically | ||||||
tailored for a board/family of boards, but with a well-defined user interface. Inside the plugin, there is all the | ||||||
business logic to support a board/family of boards. Every plugin implements the | ||||||
[interface](https://github.com/arduino/fwuploader-plugin-helper/blob/main/plugin.go#L28) contained in the | ||||||
[fwuploader-plugin-helper](https://github.com/arduino/fwuploader-plugin-helper) repository. | ||||||
|
||||||
The fwuploader is still responsible for downloading the files required for the plugin to work: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
- plugins/tools | ||||||
- certificates | ||||||
- firmware | ||||||
|
||||||
The new information is hosted in the | ||||||
[plugin_firmware_index.json](https://downloads.arduino.cc/arduino-fwuploader/boards/plugin_firmware_index.json), which | ||||||
is generated by `generator.py`. | ||||||
|
||||||
## uno-r4-wifi-plugin | ||||||
|
||||||
The source code can be found [here](https://github.com/arduino/uno-r4-wifi-fwuploader-plugin). | ||||||
|
||||||
### Known issues | ||||||
|
||||||
#### Espflash panic `UnknownModel` | ||||||
|
||||||
On some arm64 Linux distros, version 2.0.0 of [espflash](https://github.com/esp-rs/espflash/) might panic with the | ||||||
following error: | ||||||
|
||||||
``` | ||||||
Error: × Main thread panicked. | ||||||
├─▶ at espflash/src/interface.rs:70:33 | ||||||
╰─▶ called `Result::unwrap()` on an `Err` value: UnknownModel | ||||||
help: set the `RUST_BACKTRACE=1` environment variable to display a | ||||||
backtrace. | ||||||
``` | ||||||
|
||||||
#### The esp32 module does not go into download mode | ||||||
alessio-perugini marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
On Linux, the uno r4 must be plugged into a **hub usb** to make the flash process work. Otherwise, it won’t be able to | ||||||
alessio-perugini marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
reboot in download mode. | ||||||
alessio-perugini marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
```bash | ||||||
$ arduino-fwuploader firmware flash -b arduino:renesas_uno:unor4wifi -a /dev/ttyACM0 -v --log-level debug | ||||||
|
||||||
Done in 0.001 seconds | ||||||
Write 46588 bytes to flash (12 pages) | ||||||
[==============================] 100% (12/12 pages) | ||||||
Done in 3.106 seconds | ||||||
|
||||||
Waiting to flash the binary... | ||||||
time=2023-07-18T14:50:10.492+02:00 level=INFO msg="getting firmware version" | ||||||
time=2023-07-18T14:50:10.509+02:00 level=INFO msg="firmware version is > 0.1.0 using sketch" | ||||||
time=2023-07-18T14:50:10.511+02:00 level=INFO msg="check if serial port has changed" | ||||||
[2023-07-18T12:50:20Z INFO ] 🚀 A new version of espflash is available: v2.0.1 | ||||||
[2023-07-18T12:50:20Z INFO ] Serial port: '/dev/ttyACM0' | ||||||
[2023-07-18T12:50:20Z INFO ] Connecting... | ||||||
[2023-07-18T12:50:20Z INFO ] Unable to connect, retrying with extra delay... | ||||||
[2023-07-18T12:50:21Z INFO ] Unable to connect, retrying with default delay... | ||||||
[2023-07-18T12:50:21Z INFO ] Unable to connect, retrying with extra delay... | ||||||
[2023-07-18T12:50:21Z INFO ] Unable to connect, retrying with default delay... | ||||||
[2023-07-18T12:50:21Z INFO ] Unable to connect, retrying with extra delay... | ||||||
[2023-07-18T12:50:21Z INFO ] Unable to connect, retrying with default delay... | ||||||
[2023-07-18T12:50:21Z INFO ] Unable to connect, retrying with extra delay... | ||||||
Error: espflash::connection_failed | ||||||
|
||||||
× Error while connecting to device | ||||||
╰─▶ Failed to connect to the device | ||||||
help: Ensure that the device is connected and the reset and boot pins are | ||||||
not being held down | ||||||
|
||||||
Error: exit status 1 | ||||||
ERRO[0021] couldn't update firmware: exit status 3 | ||||||
INFO[0021] Waiting 1 second before retrying... | ||||||
INFO[0022] Uploading firmware (try 2 of 9) | ||||||
time=2023-07-18T14:50:22.229+02:00 level=INFO msg=upload_command_sketch | ||||||
time=2023-07-18T14:50:22.230+02:00 level=INFO msg="sending serial reset" | ||||||
Error: reboot mode: upload commands sketch: setting DTR to OFF | ||||||
... | ||||||
``` | ||||||
|
||||||
#### I flashed the certificates, but I am unable to reach the host | ||||||
|
||||||
The **whole certificate chain** is needed to make it work. Using `-u` flags (ex: `-u www.arduino.cc:443`) won’t work | ||||||
because it only downloads the root certificates. The solution is to use only the `-f` flag and provide a pem certificate | ||||||
containing the whole chain. | ||||||
alessio-perugini marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
#### My antivirus says that `espflash` is a threat | ||||||
|
||||||
The binary is not signed [#348](https://github.com/esp-rs/espflash/issues/348), and some antiviruses might complain. If | ||||||
still doubtful, https://github.com/esp-rs/espflash is open source, and it's possible to double-check the md5 hashes of | ||||||
the binary and the source code. For more information, you can follow | ||||||
[this](https://forum.arduino.cc/t/radio-module-firmware-version-0-2-0-is-now-available/1147361/11) forum thread. | ||||||
|
||||||
#### Not running on armv7 | ||||||
|
||||||
At the moment, we are always downloading the armv6 binaries. Since they are dynamically linked, most likely they are not | ||||||
going to run on armv7. More infos on the topic: | ||||||
[here](https://developer.arm.com/documentation/ddi0419/c/Appendices/ARMv7-M-Differences/ARMv6-M-and-ARMv7-M-compatibility). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.