Skip to content
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

Rename FirmwareUpdater to FirmwareUploader #21

Merged
merged 4 commits into from
Apr 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.
Jump to
Jump to file
Failed to load files.
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/FirmwareUpdater'
if: github.repository == 'arduino/FirmwareUploader'
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/FirmwareUpdater'
if: github.repository == 'arduino/FirmwareUploader'
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/FirmwareUpdater'
if: github.repository == 'arduino/FirmwareUploader'
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/FirmwareUpdater')
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'arduino/FirmwareUploader')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ jobs:
# Repackage the signed binary replaced in place by Gon (ignoring the output zip file)
run: |
TAG=${GITHUB_REF/refs\/tags\//}
tar cjf dist/FirmwareUpdater_${TAG}_macOS_64bit.tar.bz2 \
tar cjf dist/FirmwareUploader_${TAG}_macOS_64bit.tar.bz2 \
firmwares \
LICENSE.txt \
-C dist/macos64/ FirmwareUpdater
-C dist/macos64/ FirmwareUploader

- name: Upload artifacts
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -141,4 +141,4 @@ jobs:
bodyFile: "dist/CHANGELOG.md"
draft: false
prerelease: ${{ steps.prerelease.outputs.IS_PRE }}
artifacts: dist/FirmwareUpdater*,dist/package_index.json
artifacts: dist/FirmwareUploader*,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
/FirmwareUpdater*
/FirmwareUploader*
/.vscode/
.idea
coverage_*.txt
Expand Down
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,63 +6,67 @@ 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/FirmwareUpdater/releases/latest
https://github.com/arduino/FirmwareUploader/releases/latest

## Usage

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

```
./$your_os/updater -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
./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
silvanocerza marked this conversation as resolved.
Show resolved Hide resolved
```

To flash a MKR1000:

```
./$your_os/updater -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
./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
silvanocerza marked this conversation as resolved.
Show resolved Hide resolved
```

To update a MKRNB1500:

```
./$your_os/updater -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
./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
```

### Command line options

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

```
Usage of ./distrib/linux64/updater:
Usage of ./FirmwareUploader:
-address value
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) -> if not provided it will expect FirmwareUpdater sketch to be already flashed on the board
firmware upload binary (precompiled for the right target)
-get_available_for string
Ask for available firmwares matching a given board
-model string
module model (winc or nina)
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
firmware upload binary (precompiled for the right target) -> if not provided it will try to restore the original firmware
firmware upload binary (precompiled for the right target)
```

## How to build the tools from source file

From the sources root directory run:
To build we use [task](https://taskfile.dev/) for simplicity. From the sources root directory run:

```
go build -o updater
task dist:<OS>_<ARCH>
```

This will create the `updater` executable.
Where <OS> could be one of: `macOS`,`Windows`,`Linux`. And <ARCH>: `32bit`, `64bit`, `ARM` or `ARM64`

This will create the `FirmwareUploader` executable.

## Security

Expand All @@ -86,4 +90,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/FirmwareUpdater/security/policy
[security-policy]: https://github.com/arduino/FirmwareUploader/security/policy
14 changes: 7 additions & 7 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ tasks:
- npx {{ .PRETTIER }} --write "**/*.{yml,yaml}"

vars:
PROJECT_NAME: "FirmwareUpdater"
PROJECT_NAME: "FirmwareUploader"
DIST_DIR: "dist"
# build vars
COMMIT:
Expand All @@ -71,9 +71,9 @@ vars:
LDFLAGS: >
-ldflags
'
-X github.com/arduino/FirmwareUpdater/version.versionString={{.VERSION}}
-X github.com/arduino/FirmwareUpdater/version.commit={{ .COMMIT }}
-X github.com/arduino/FirmwareUpdater/version.date={{.TIMESTAMP}}
-X github.com/arduino/FirmwareUploader/version.versionString={{.VERSION}}
-X github.com/arduino/FirmwareUploader/version.commit={{ .COMMIT }}
-X github.com/arduino/FirmwareUploader/version.date={{.TIMESTAMP}}
'
# test vars
GOFLAGS: "-timeout 10m -v -coverpkg=./... -covermode=atomic"
Expand All @@ -82,9 +82,9 @@ vars:
TEST_LDFLAGS: >
-ldflags
'
-X github.com/arduino/FirmwareUpdater/version.versionString={{.TEST_VERSION}}
-X github.com/arduino/FirmwareUpdater/version.commit={{.TEST_COMMIT}}
-X github.com/arduino/FirmwareUpdater/version.date={{.TIMESTAMP}}
-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}}
'
# check-lint vars
GOLINTBIN:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/arduino/FirmwareUpdater
module github.com/arduino/FirmwareUploader

go 1.14

Expand Down
6 changes: 3 additions & 3 deletions gon.config.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source = ["dist/macos64/FirmwareUpdater"]
bundle_id = "cc.arduino.FirmwareUpdater"
source = ["dist/macos64/FirmwareUploader"]
bundle_id = "cc.arduino.FirmwareUploader"

sign {
application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)"
Expand All @@ -8,5 +8,5 @@ sign {
# Ask Gon for zip output to force notarization process to take place.
# The CI will ignore the zip output, using the signed binary only.
zip {
output_path = "FirmwareUpdater.zip"
output_path = "FirmwareUploader.zip"
}
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"os"
"strings"

"github.com/arduino/FirmwareUpdater/modules/nina"
"github.com/arduino/FirmwareUpdater/modules/sara"
"github.com/arduino/FirmwareUpdater/modules/winc"
"github.com/arduino/FirmwareUpdater/utils"
"github.com/arduino/FirmwareUpdater/utils/context"
"github.com/arduino/FirmwareUploader/modules/nina"
"github.com/arduino/FirmwareUploader/modules/sara"
"github.com/arduino/FirmwareUploader/modules/winc"
"github.com/arduino/FirmwareUploader/utils"
"github.com/arduino/FirmwareUploader/utils/context"
)

var ctx context.Context
Expand Down
2 changes: 1 addition & 1 deletion modules/nina/flasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"log"
"time"

"github.com/arduino/FirmwareUpdater/utils"
"github.com/arduino/FirmwareUploader/utils"
"go.bug.st/serial"
)

Expand Down
6 changes: 3 additions & 3 deletions modules/nina/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (
"strconv"
"strings"

"github.com/arduino/FirmwareUpdater/programmers/avrdude"
"github.com/arduino/FirmwareUpdater/programmers/bossac"
"github.com/arduino/FirmwareUpdater/utils/context"
"github.com/arduino/FirmwareUploader/programmers/avrdude"
"github.com/arduino/FirmwareUploader/programmers/bossac"
"github.com/arduino/FirmwareUploader/utils/context"
)

var f *Flasher
Expand Down
2 changes: 1 addition & 1 deletion modules/sara/flasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"strings"
"time"

"github.com/arduino/FirmwareUpdater/utils"
"github.com/arduino/FirmwareUploader/utils"
"go.bug.st/serial"
)

Expand Down
4 changes: 2 additions & 2 deletions modules/sara/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ package sara

import (
"fmt"
"github.com/arduino/FirmwareUpdater/programmers/bossac"
"github.com/arduino/FirmwareUpdater/utils/context"
"github.com/arduino/FirmwareUploader/programmers/bossac"
"github.com/arduino/FirmwareUploader/utils/context"
"io/ioutil"
"log"
"strconv"
Expand Down
2 changes: 1 addition & 1 deletion modules/winc/flasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"log"
"time"

"github.com/arduino/FirmwareUpdater/utils"
"github.com/arduino/FirmwareUploader/utils"
"go.bug.st/serial"
)

Expand Down
4 changes: 2 additions & 2 deletions modules/winc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
"os"
"strconv"

"github.com/arduino/FirmwareUpdater/programmers/bossac"
"github.com/arduino/FirmwareUpdater/utils/context"
"github.com/arduino/FirmwareUploader/programmers/bossac"
"github.com/arduino/FirmwareUploader/utils/context"
)

var f *Flasher
Expand Down
2 changes: 1 addition & 1 deletion programmers/avrdude/avrdude.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"time"

"github.com/arduino/FirmwareUpdater/utils/context"
"github.com/arduino/FirmwareUploader/utils/context"
"github.com/arduino/arduino-cli/executils"
"github.com/pkg/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion programmers/bossac/bossac.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"time"

"github.com/arduino/FirmwareUpdater/utils/context"
"github.com/arduino/FirmwareUploader/utils/context"
"github.com/arduino/arduino-cli/arduino/serialutils"
"github.com/arduino/arduino-cli/executils"
"github.com/pkg/errors"
Expand Down