Skip to content

rename FirmwareUploader to arduino-fwuploader #62

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
merged 5 commits into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check-certificates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
jobs:
get-certificates-list:
# This workflow would fail in forks that don't have the certificate secrets defined
if: github.repository == 'arduino/FirmwareUploader'
if: github.repository == 'arduino/arduino-fwuploader'
runs-on: ubuntu-latest
outputs:
certificates: ${{ steps.get-files.outputs.certificates }}
Expand All @@ -38,7 +38,7 @@ jobs:

check-certificates:
# This workflow would fail in forks that don't have the certificate secrets defined
if: github.repository == 'arduino/FirmwareUploader'
if: github.repository == 'arduino/arduino-fwuploader'
runs-on: ubuntu-latest
needs: get-certificates-list

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-notarization-certificates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
jobs:
check-certificates:
# This workflow would fail in forks that don't have the certificate secrets defined
if: github.repository == 'arduino/FirmwareUploader'
if: github.repository == 'arduino/arduino-fwuploader'
runs-on: ubuntu-latest

strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/link-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
verify-links:
# Don't trigger on schedule event when in a fork
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'arduino/FirmwareUploader')
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'arduino/arduino-fwuploader')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ jobs:
run: |
# GitHub's upload/download-artifact@v2 actions don't preserve file permissions,
# so we need to add execution permission back.
chmod +x dist/macos64/FirmwareUploader
chmod +x dist/macos64/arduino-fwuploader
TAG=${GITHUB_REF/refs\/tags\//}
tar cjf dist/FirmwareUploader_${TAG}_macOS_64bit.tar.bz2 \
tar cjf dist/arduino-fwuploader_${TAG}_macOS_64bit.tar.bz2 \
firmwares \
LICENSE.txt \
-C dist/macos64/ FirmwareUploader
-C dist/macos64/ arduino-fwuploader

- name: Upload artifacts
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -146,4 +146,4 @@ jobs:
bodyFile: "dist/CHANGELOG.md"
draft: false
prerelease: ${{ steps.prerelease.outputs.IS_PRE }}
artifacts: dist/FirmwareUploader*,dist/package_index.json
artifacts: dist/arduino-fwuploader*,dist/package_index.json
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/debug
/FirmwareUploader*
/arduino-fwuploader*
/.vscode/
.idea
coverage_*.txt
Expand Down
79 changes: 52 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,85 @@ Use this tool to update the firmware and/or add SSL certificates for any WINC, N

You can download the Firmware/Certificates updater here:

https://github.com/arduino/FirmwareUploader/releases/latest
https://github.com/arduino/arduino-fwuploader/releases/latest

## Usage

Extract the zip file and run (for example, NINA -> WiFi1010)
### Firmware Flashing

Extract the zip file and, to update a mkr 1010, run:

```
./arduino-fwuploader firmware flash -b arduino:samd:mkrwifi1010 -a /dev/ttyACM0
```

You just have to specify the fqbn (`-b` or `--fqbn`) of the board and the serial port (`-a` or `--address`) The firmware
uploader will take care of fetching everything is required to perform the update process. If no module and version are
specified **the latest version of the firmware** will be used.

If you want to flash a specific version of a firmware you can use the `-m` or `--module` flag

For example to flash a MKR1000 with 19.6.1 version of the firmware you can run something like:

```
./FirmwareUploader --flasher firmwares/NINA/FirmwareUpdater.mkrwifi1010.ino.bin --firmware firmwares/NINA/1.2.1/NINA_W102.bin --port /dev/ttyACM0 --address arduino.cc:443 --restore_binary /tmp/arduino_build_619137/WiFiSSLClient.ino.bin --programmer {runtime.tools.bossac}/bossac
./arduino-fwuploader firmware flash -b arduino:samd:mkr1000 -a /dev/ttyACM0 -m [email protected]
```

To flash a MKR1000:
There is also a retry mechanism bundled in the tool because the flashing process sometimes can be a bit unreliable. For
example to update a Nano RP2040 Connect with the retry set to 2 you can use:

```
./FirmwareUploader --flasher firmwares/WINC1500/FirmwareUpdater.mkr1000.ino.bin --firmware firmwares/WINC1500/19.5.4/m2m_aio_3a0.bin --port /dev/ttyACM0 --address arduino.cc:443 --restore_binary /tmp/arduino_build_619137/WiFiSSLClient.ino.bin --programmer {runtime.tools.bossac}/bossac
./arduino-fwuploader firmware flash --fqbn arduino:mbed_nano:nanorp2040connect -a /dev/ttyACM0 --retries 2
```

To update a MKRNB1500:
It's possible also to list the available firmwares for every board/module with:

```
./FirmwareUploader --flasher firmwares/SARA/SerialSARAPassthrough.ino.bin --firmware firmwares/SARA/5.6A2.00-to-5.6A2.01.pkg --port /dev/ttyACM0 --restore_binary firmwares/SARA/SerialSARAPassthrough.ino.bin --programmer {runtime.tools.bossac}/bossac
./arduino-fwuploader firmware list
```

To update a Nano RP2040 Connect:
but you can also filter the results by specifying the `-b` or `--fqbn` flag

The tool offers the ability to print output in json, with the `--format json`

### Certificates

The tool offers also the ability to flash SSL certificates to a board:

```
./FirmwareUploader --flasher firmwares/NINA/FirmwareUpdater.nanorp2040connect.ino.elf --firmware firmwares/NINA/1.4.5/NINA_W102-Nano_RP2040_Connect.bin --port /dev/ttyACM0 --address arduino.cc:443 --programmer {runtime.tools.rp2040tools}/rp2040load
/arduino-fwuploader flash -b arduino:samd:nano_33_iot" -a COM10 -u arduino.cc:443 -u google.cc:443
```

or you can specify a path to a file with `-f`

### Command line options

The full list of command line options can be obtained with the `-h` option: `./FirmwareUploader -h`
The full list of command line options can be obtained with the `-h` option: `./arduino-fwuploader -h`

```
FirmwareUploader (FirmwareUploader).
Arduino Firmware Uploader (arduino-fwuploader).

Usage:
FirmwareUploader [flags]
arduino-fwuploader [command]

Examples:
./FirmwareUploader <command> [flags...]
./arduino-fwuploader <command> [flags...]

Available Commands:
certificates Commands to operate on certificates.
firmware Commands to operate on firmwares.
help Help about any command
version Shows version number of arduino-fwuploader.

Flags:
--address strings address (host:port) to fetch and flash root certificate for, multiple values allowed
--certs string root certificate directory
--firmware string firmware file to flash
--flasher string firmware upload binary (precompiled for the right target)
--get_available_for string Ask for available firmwares matching a given board
-h, --help help for FirmwareUploader
--model string module model (winc, nina or sara)
--port string serial port to use for flashing
--programmer string path of programmer in use (avrdude/bossac)
--read read all firmware and output to stdout
--restore_binary string binary to restore after the firmware upload (precompiled for the right target)
--retries int Number of retries in case of upload failure (default 9)
--format string The output format, can be {text|json}. (default "text")
-h, --help help for arduino-fwuploader
--log-file string Path to the file where logs will be written
--log-format string The output format for the logs, can be {text|json}.
--log-level string Messages with this level and above will be logged. Valid levels are: trace, debug, info, warn, error, fatal, panic (default "info")
-v, --verbose Print the logs on the standard output.

Use "arduino-fwuploader [command] --help" for more information about a command.
```

## How to build the tools from source file
Expand All @@ -72,7 +97,7 @@ task dist:<OS>_<ARCH>

Where <OS> could be one of: `macOS`,`Windows`,`Linux`. And <ARCH>: `32bit`, `64bit`, `ARM` or `ARM64`

This will create the `FirmwareUploader` executable.
This will create the `arduino-fwuploader` executable.

## Security

Expand All @@ -96,4 +121,4 @@ details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

[security-policy]: https://github.com/arduino/FirmwareUploader/security/policy
[security-policy]: https://github.com/arduino/arduino-fwuploader/security/policy
14 changes: 7 additions & 7 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ tasks:
- poetry run black .

vars:
PROJECT_NAME: "FirmwareUploader"
PROJECT_NAME: "arduino-fwuploader"
DIST_DIR: "dist"
# build vars
COMMIT:
Expand All @@ -106,9 +106,9 @@ vars:
LDFLAGS: >
-ldflags
'
-X github.com/arduino/FirmwareUploader/version.versionString={{.VERSION}}
-X github.com/arduino/FirmwareUploader/version.commit={{ .COMMIT }}
-X github.com/arduino/FirmwareUploader/version.date={{.TIMESTAMP}}
-X github.com/arduino/arduino-fwuploader/version.versionString={{.VERSION}}
-X github.com/arduino/arduino-fwuploader/version.commit={{ .COMMIT }}
-X github.com/arduino/arduino-fwuploader/version.date={{.TIMESTAMP}}
'
# test vars
GOFLAGS: "-timeout 10m -v -coverpkg=./... -covermode=atomic"
Expand All @@ -117,9 +117,9 @@ vars:
TEST_LDFLAGS: >
-ldflags
'
-X github.com/arduino/FirmwareUploader/version.versionString={{.TEST_VERSION}}
-X github.com/arduino/FirmwareUploader/version.commit={{.TEST_COMMIT}}
-X github.com/arduino/FirmwareUploader/version.date={{.TIMESTAMP}}
-X github.com/arduino/arduino-fwuploader/version.versionString={{.TEST_VERSION}}
-X github.com/arduino/arduino-fwuploader/version.commit={{.TEST_COMMIT}}
-X github.com/arduino/arduino-fwuploader/version.date={{.TIMESTAMP}}
'
# check-lint vars
GOLINTBIN:
Expand Down
2 changes: 1 addition & 1 deletion cli/certificates/certificates.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
FirmwareUploader
arduino-fwuploader
Copyright (c) 2021 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or
Expand Down
10 changes: 5 additions & 5 deletions cli/certificates/flash.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
FirmwareUploader
arduino-fwuploader
Copyright (c) 2021 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -27,13 +27,13 @@ import (
"strings"
"time"

"github.com/arduino/FirmwareUploader/flasher"
"github.com/arduino/FirmwareUploader/indexes"
"github.com/arduino/FirmwareUploader/indexes/download"
programmer "github.com/arduino/FirmwareUploader/programmers"
"github.com/arduino/arduino-cli/arduino/serialutils"
"github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-fwuploader/flasher"
"github.com/arduino/arduino-fwuploader/indexes"
"github.com/arduino/arduino-fwuploader/indexes/download"
programmer "github.com/arduino/arduino-fwuploader/programmers"
"github.com/arduino/go-paths-helper"
"github.com/arduino/go-properties-orderedmap"
"github.com/sirupsen/logrus"
Expand Down
18 changes: 9 additions & 9 deletions cli/cli.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
FirmwareUploader
arduino-fwuploader
Copyright (c) 2021 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or
Expand All @@ -25,13 +25,13 @@ import (
"os"
"strings"

"github.com/arduino/FirmwareUploader/cli/certificates"
"github.com/arduino/FirmwareUploader/cli/firmware"
"github.com/arduino/FirmwareUploader/cli/version"
"github.com/arduino/arduino-fwuploader/cli/certificates"
"github.com/arduino/arduino-fwuploader/cli/firmware"
"github.com/arduino/arduino-fwuploader/cli/version"

v "github.com/arduino/FirmwareUploader/version"
"github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback"
v "github.com/arduino/arduino-fwuploader/version"
"github.com/mattn/go-colorable"
"github.com/rifflock/lfshook"
"github.com/sirupsen/logrus"
Expand All @@ -47,11 +47,11 @@ var (
)

func NewCommand() *cobra.Command {
// FirmwareUploader is the root command
// arduino-fwuploader is the root command
rootCmd := &cobra.Command{
Use: "FirmwareUploader",
Short: "FirmwareUploader.",
Long: "FirmwareUploader (FirmwareUploader).",
Use: "arduino-fwuploader",
Short: "arduino-fwuploader.",
Long: "Arduino Firmware Uploader (arduino-fwuploader).",
Example: " " + os.Args[0] + " <command> [flags...]",
Args: cobra.NoArgs,
PersistentPreRun: preRun,
Expand Down
2 changes: 1 addition & 1 deletion cli/firmware/firmware.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
FirmwareUploader
arduino-fwuploader
Copyright (c) 2021 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or
Expand Down
12 changes: 6 additions & 6 deletions cli/firmware/flash.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
FirmwareUploader
arduino-fwuploader
Copyright (c) 2021 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -27,14 +27,14 @@ import (
"strings"
"time"

"github.com/arduino/FirmwareUploader/flasher"
"github.com/arduino/FirmwareUploader/indexes"
"github.com/arduino/FirmwareUploader/indexes/download"
"github.com/arduino/FirmwareUploader/indexes/firmwareindex"
programmer "github.com/arduino/FirmwareUploader/programmers"
"github.com/arduino/arduino-cli/arduino/serialutils"
"github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-fwuploader/flasher"
"github.com/arduino/arduino-fwuploader/indexes"
"github.com/arduino/arduino-fwuploader/indexes/download"
"github.com/arduino/arduino-fwuploader/indexes/firmwareindex"
programmer "github.com/arduino/arduino-fwuploader/programmers"
"github.com/arduino/go-paths-helper"
"github.com/arduino/go-properties-orderedmap"
"github.com/sirupsen/logrus"
Expand Down
4 changes: 2 additions & 2 deletions cli/firmware/list.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
FirmwareUploader
arduino-fwuploader
Copyright (c) 2021 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or
Expand All @@ -22,9 +22,9 @@ package firmware
import (
"os"

"github.com/arduino/FirmwareUploader/indexes"
"github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/table"
"github.com/arduino/arduino-fwuploader/indexes"
"github.com/spf13/cobra"
semver "go.bug.st/relaxed-semver"
)
Expand Down
2 changes: 1 addition & 1 deletion cli/globals/globals.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
FirmwareUploader
arduino-fwuploader
Copyright (c) 2021 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or
Expand Down
8 changes: 4 additions & 4 deletions cli/version/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
FirmwareUploader
arduino-fwuploader
Copyright (c) 2021 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or
Expand All @@ -22,17 +22,17 @@ package version
import (
"os"

v "github.com/arduino/FirmwareUploader/version"
"github.com/arduino/arduino-cli/cli/feedback"
v "github.com/arduino/arduino-fwuploader/version"
"github.com/spf13/cobra"
)

// NewCommand created a new `version` command
func NewCommand() *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Shows version number of FirmwareUploader.",
Long: "Shows the version number of FirmwareUploader which is installed on your system.",
Short: "Shows version number of arduino-fwuploader.",
Long: "Shows the version number of arduino-fwuploader which is installed on your system.",
Example: " " + os.Args[0] + " version",
Args: cobra.NoArgs,
Run: run,
Expand Down
2 changes: 1 addition & 1 deletion flasher/certificate.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
FirmwareUploader
arduino-fwuploader
Copyright (c) 2021 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or
Expand Down
2 changes: 1 addition & 1 deletion flasher/flasher.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
FirmwareUploader
arduino-fwuploader
Copyright (c) 2021 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or
Expand Down
Loading