Git Product home page Git Product logo

arduino / arduino-fwuploader Goto Github PK

View Code? Open in Web Editor NEW
51.0 23.0 18.0 16.01 MB

A Command Line Tool made to update the firmware and/or add SSL certificates for any Arduino board equipped with WINC or NINA Wi-Fi module.

Home Page: https://arduino.github.io/arduino-fwuploader/

License: GNU Affero General Public License v3.0

Go 90.61% Python 9.39%
golang command-line tooling-team arduino firmware nina winc1510

arduino-fwuploader's Introduction

Arduino Firmware Uploader

The Arduino Firmware Uploader is a tool made to update the firmware and/or add SSL certificates for any Arduino board equipped with ESP32-S3 or NINA Wi-Fi module.

Test Go status Codecov Test Integration status Deploy Website status

❗❗❗Notice regarding versions before 2.0.0 ❗❗❗

ATTENTION old versions (e.g 1.0.x) will not work anymore, further details in this issue. Please use the latest release

Docs

For guidance on installation and development, see the User documentation

Quickstart

  1. Install the Arduino Firmware Uploader
  2. Follow the Usage guide to check out what the tool can do
  3. Browse the Commands reference to see all the available commands

Security

If you think you found a vulnerability or other security-related bug in this project, please read our security policy and report the bug to our Security Team 🛡️ Thank you!

e-mail contact: [email protected]

arduino-fwuploader's People

Contributors

aentinger avatar alessio-perugini avatar cmaglie avatar dependabot[bot] avatar facchinm avatar fede85 avatar matteopologruto avatar pennam avatar per1234 avatar sandeepmistry avatar silvanocerza avatar umbynos avatar vipau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-fwuploader's Issues

Signature verification failed error and the arduino-fwuploader tool panics with ver 1.x.y

Bug Report

Current behavior

I get Signature verification failed error and the arduino-fwuploader tool panics:

$ arduino-fwuploader firmware list
signature verification failed: index "https://downloads.arduino.cc/arduino-fwuploader/boards/module_firmware_index.json.gz" has an invalid signature
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8c162e]
goroutine 1 [running]:
github.com/arduino/arduino-fwuploader/cli/firmware.list(0x0, 0x0)
        /home/umberto/Nextcloud/8tb/Lavoro/arduino-fwuploader/cli/firmware/list.go:66 +0x4e
github.com/arduino/arduino-fwuploader/cli/firmware.newListCommand.func1(0xc00027e280, 0xd89330, 0x0, 0x0)
        /home/umberto/Nextcloud/8tb/Lavoro/arduino-fwuploader/cli/firmware/list.go:42 +0x39
github.com/spf13/cobra.(*Command).execute(0xc00027e280, 0xd89330, 0x0, 0x0, 0xc00027e280, 0xd89330)
        /home/umberto/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xc0001cd680, 0x0, 0x0, 0xffffffff)
        /home/umberto/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /home/umberto/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
main.main()
        /home/umberto/Nextcloud/8tb/Lavoro/arduino-fwuploader/main.go:35 +0x3c

Expected behavior

I expect the tool to list correctly all the available firmware for the supported boards like:

$ arduino-fwuploader firmware list
Board                       FQBN                                Module     Version
Arduino MKR1000             arduino:samd:mkr1000                WINC1500   19.4.4 
Arduino MKR1000             arduino:samd:mkr1000                WINC1500   19.5.2 
Arduino MKR1000             arduino:samd:mkr1000                WINC1500   19.5.4 
Arduino MKR1000             arduino:samd:mkr1000                WINC1500 ✔ 19.6.1 
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.0.0  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.1.0  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.2.1  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.2.2  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.2.3  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.2.4  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.3.0  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.0  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.1  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.2  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.3  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.4  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.5  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.6  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA     ✔ 1.4.7  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.0.0  
[ ... ]

Environment

  • Updater version: arduino-fwuploader Version: 1.0.2 Commit: 1289a0c Date: 2021-07-28T10:29:45Z
  • OS and platform: All

Additional context

This issue is caused by a replace of the GPG keypair used to sign and verify the module_firmware_index.json that contains all the information related to the boards and their modules (see #90).
Unfortunately we had to replace the GPG keypair due to a private key leak that ended up to be published on an Arduino public facing data store

RPI flashing not working

I am using a RPI3. When I run the command with the correct serial device name it just says
'no device found'. Has anyone has the same problem?

./FirmwareUploader -flasher ~/firmwareuploader/firmwares/NINA/FirmwareUpdater.nano_33_iot.ino.bin -firmware ~/firmwareuploader/firmwares/NINA/1.4.5/NINA_W102.bin -port /dev/ttyACM0 -programmer /usr/bin/bossac

NANO 33 IoT - Programmer not responding

Bug Report

Current behavior

After uploading the WifiNINA FirmwareUpdater sketch to my Nano 33 IoT, when I then open the Firmware updater tool, select my board Arduino NANO 33 IoT (dev/cu.usbmodem141401) and attempt to Test connection, I get the error "Programmer not responding, Make sure that FirmwareUpdater sketch is loaded on the board"

Expected behavior

Test connection responds with success

Environment

  • Updater version: 0.11.0
  • OS and platform: MacOS, Arduino 1.8.13

Additional context

I resolved this by modifying the sketch

  Serial.begin(1000000);

  while (!ESP32BootROM.begin(921600)) {
    Serial.println("Unable to communicate with ESP32 boot ROM!");
    ESP32BootROM.end();
  }
}

`arduino-fwuploader` panics

Describe the problem

./arduino-fwuploader
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x824766]

goroutine 1 [running]:
debug/elf.(*Section).ReadAt(0xc000200000?, {0xc000210000?, 0x270?, 0x24?}, 0x40?)
	<autogenerated>:1 +0x26
archive/zip.readDirectoryEnd({0xa23b20, 0xc000138e80}, 0x210)
	/opt/hostedtoolcache/go/1.19.1/x64/src/archive/zip/reader.go:526 +0xf5
archive/zip.(*Reader).init(0xc000179a40, {0xa23b20?, 0xc000138e80}, 0x210)
	/opt/hostedtoolcache/go/1.19.1/x64/src/archive/zip/reader.go:97 +0x5c
archive/zip.NewReader({0xa23b20, 0xc000138e80}, 0x210)
	/opt/hostedtoolcache/go/1.19.1/x64/src/archive/zip/reader.go:90 +0x5e
github.com/daaku/go%2ezipexe.zipExeReaderElf({0xa246c0?, 0xc0000ae0c0}, 0xd758be)
	/home/runner/go/pkg/mod/github.com/daaku/[email protected]/zipexe.go:128 +0x8b
github.com/daaku/go%2ezipexe.NewReader({0xa246c0, 0xc0000ae0c0}, 0x0?)
	/home/runner/go/pkg/mod/github.com/daaku/[email protected]/zipexe.go:48 +0x98
github.com/daaku/go%2ezipexe.OpenCloser({0xc0000d62d0?, 0xc000115720?})
	/home/runner/go/pkg/mod/github.com/daaku/[email protected]/zipexe.go:30 +0x57
github.com/cmaglie/go%2erice.init.0()
	/home/runner/go/pkg/mod/github.com/cmaglie/[email protected]/appended.go:42 +0x65

To reproduce

This seems to only affect linux 2.2.1 released binary

Expected behavior

The binary should not crash

Arduino Firmware Uploader version

arduino-fwuploader Version: 2.2.1 Commit: 75bcf76

Operating system

Linux

Operating system version

Ubuntu 18.04 (same also on archlinux)

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details

wifi101 firmware updater query

Hi @sandeepmistry

I am using the firmware updater GUI to upload an SSL certificate corresponding to my server in to my module.
I am also changing the PPA value and the gain table of the wifi module's firmware using an Atmel ASF project and then using your GUI to add a certificate to it.

Question: does the certificate updater GUI erase the entire flash of the wifi module or just updates the certificate section? I assume its just an update but I wanted to verify.

Thanks a lot
Sudheera

Wifi101 Bricked — Firmware Updater loop?

This is all I get when attempting to upgrade the firmware of the Wifi 101 on my official Arduino Uno:

2016/03/02 14:56:10 Connecting to programmer
2016/03/02 14:56:12 Synch with programmer
2016/03/02 14:56:12 Reading max payload size
2016/03/02 14:56:12 Flashing firmware from '/Wifi101_FirmwareUpdater/firmware/19.4.4/m2m_aio_2b0.bin'
2016/03/02 14:56:12 Error during FlashErase()

Now none of the Wifi101 examples, including Check101FirmwareVersion work. Could had something gone wrong during the upgrading process? Anything I can do to start anew?

Add more verbose messages to the cli firmware updater

Currently the cli outputs only "Reading max payload size" or "Converting and flashing certificates from..." that make people wonder if the operation has completed successfully. It would be nice to have more detailed messages and indication of completion. For example:

  • "Payload size is: xyz bytes"
  • "Writing cert 1/x", "Writing cert 2/x" etc.
  • "Write completed"

Don't panic on `firmware list` without Internet connection

Describe the current behavior

Running the arduino-fwuploader firmware list command while your computer does not have access to the Internet results in a user unfriendly stack trace.

To Reproduce

  1. Disconnect your computer from the Internet.
  2. Run the arduino-fwuploader firmware list command.
$ arduino-fwuploader version
arduino-fwuploader Version: test-c061e884578ceb9ffcc643a6ec545e1c3fc2b344-git-snapshot Commit: c061e88 Date: 2022-01-14T10:17:26Z

$ arduino-fwuploader firmware list
downloading index https://downloads.arduino.cc/arduino-fwuploader/boards/module_firmware_index.json.gz: Get "https://downloads.arduino.cc/arduino-fwuploader/boards/module_firmware_index.json.gz": dial tcp: lookup downloads.arduino.cc: no such host
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xa59430]

goroutine 1 [running]:
github.com/arduino/arduino-fwuploader/cli/firmware.list({0x0, 0x0})
        /home/runner/work/arduino-fwuploader/arduino-fwuploader/cli/firmware/list.go:65 +0x90
github.com/arduino/arduino-fwuploader/cli/firmware.newListCommand.func1(0xc0001b6c80, {0xf93458, 0x0, 0x0})
        /home/runner/work/arduino-fwuploader/arduino-fwuploader/cli/firmware/list.go:41 +0x27
github.com/spf13/cobra.(*Command).execute(0xc0001b6c80, {0xf93458, 0x0, 0x0})
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0xc0001b6000)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x3ad
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
main.main()
        /home/runner/work/arduino-fwuploader/arduino-fwuploader/main.go:34 +0x45

Describe the request

Print an error message that clearly communicates the problem to the user:

The output of the other commands under these conditions is fine:

$ arduino-fwuploader.exe firmware flash -b arduino:samd:nano33iot -a COM36 -m NINA
Can't load package index: downloading index https://downloads.arduino.cc/packages/package_index.json.gz: Get "https://downloads.arduino.cc/packages/package_index.json.gz": dial tcp: lookup downloads.arduino.cc: no such host

IMO, panics should only be used in cases that should never occur. When such a thing does occur, a developer must investigate and the stack trace will be very useful for that. But the tool running without access to the Internet is a normal condition, and so should be handled gracefully.

Environment

  • Updater version: test-c061e884578ceb9ffcc643a6ec545e1c3fc2b344-git-snapshot Commit: c061e88 Date: 2022-01-14T10:17:26Z
  • OS and platform: Windows 10

Additional context

Real world example of this causing some alarming looking Arduino IDE 2.x startup output, which acted as a "red herring":
https://forum.arduino.cc/t/arduino-2-0-not-starting-up/950998/5

Fatal error - MacOS

Hi, I am trying to run this on my Mac without success.
What I need to do is use a self signed certificate and by adding it through the WiFi101Firmware updater in the IDE it says it has been successful but I still can't connect.

Here is the terminal output from running winc1500-uploader-gui on my Mac.

Last login: Sun Sep  9 15:10:16 on ttys000
Glendons-Mac-mini:~ gjt211$ /Users/gjt211/Downloads/Wifi101_FirmwareUpdater/winc1500-uploader-gui ; exit;
failed MSpanList_Insert 0x4db0000 0x824897ffb04 0x0
fatal error: MSpanList_Insert

runtime stack:
runtime.throw(0x4b8f18b)
	/opt/go/src/runtime/panic.go:491 +0xad fp=0x7ffeefbff680 sp=0x7ffeefbff650
runtime.MSpanList_Insert(0x4be3888, 0x4db0000)
	/opt/go/src/runtime/mheap.c:692 +0x8f fp=0x7ffeefbff6a8 sp=0x7ffeefbff680
MHeap_FreeSpanLocked(0x4be0480, 0x4db0000, 0x100)
	/opt/go/src/runtime/mheap.c:583 +0x163 fp=0x7ffeefbff6e8 sp=0x7ffeefbff6a8
MHeap_Grow(0x4be0480, 0x8, 0x0)
	/opt/go/src/runtime/mheap.c:420 +0x1a8 fp=0x7ffeefbff728 sp=0x7ffeefbff6e8
MHeap_AllocSpanLocked(0x4be0480, 0x1, 0x0)
	/opt/go/src/runtime/mheap.c:298 +0x365 fp=0x7ffeefbff768 sp=0x7ffeefbff728
mheap_alloc(0x4be0480, 0x1, 0x12, 0x0)
	/opt/go/src/runtime/mheap.c:190 +0x121 fp=0x7ffeefbff790 sp=0x7ffeefbff768
runtime.MHeap_Alloc(0x4be0480, 0x1, 0x10000000012, 0x40327e9)
	/opt/go/src/runtime/mheap.c:240 +0x66 fp=0x7ffeefbff7c8 sp=0x7ffeefbff790
MCentral_Grow(0x4be81f8, 0x0)
	/opt/go/src/runtime/mcentral.c:197 +0x8b fp=0x7ffeefbff830 sp=0x7ffeefbff7c8
runtime.MCentral_CacheSpan(0x4be81f8, 0x0)
	/opt/go/src/runtime/mcentral.c:85 +0x167 fp=0x7ffeefbff868 sp=0x7ffeefbff830
runtime.MCache_Refill(0x4dac000, 0x12, 0x0)
	/opt/go/src/runtime/mcache.c:90 +0xa0 fp=0x7ffeefbff890 sp=0x7ffeefbff868
runtime.mcacheRefill_m()
	/opt/go/src/runtime/malloc.c:368 +0x57 fp=0x7ffeefbff8b0 sp=0x7ffeefbff890
runtime.onM(0x49d2fb0)
	/opt/go/src/runtime/asm_amd64.s:273 +0x9a fp=0x7ffeefbff8b8 sp=0x7ffeefbff8b0
runtime.mallocgc(0x120, 0x450b3a0, 0x0, 0x0)
	/opt/go/src/runtime/malloc.go:178 +0x849 fp=0x7ffeefbff968 sp=0x7ffeefbff8b8
runtime.newobject(0x450b3a0, 0x4dac000)
	/opt/go/src/runtime/malloc.go:353 +0x49 fp=0x7ffeefbff990 sp=0x7ffeefbff968
runtime.newG(0x404b97a)
	/opt/go/src/runtime/proc.go:233 +0x2a fp=0x7ffeefbff9a8 sp=0x7ffeefbff990
allocg(0x4bd0b60)
	/opt/go/src/runtime/proc.c:925 +0x1f fp=0x7ffeefbff9b8 sp=0x7ffeefbff9a8
runtime.malg(0x8000, 0x4bd0d20)
	/opt/go/src/runtime/proc.c:2106 +0x1f fp=0x7ffeefbff9e8 sp=0x7ffeefbff9b8
runtime.mpreinit(0x4bd10e0)
	/opt/go/src/runtime/os_darwin.c:137 +0x27 fp=0x7ffeefbffa00 sp=0x7ffeefbff9e8
mcommoninit(0x4bd10e0)
	/opt/go/src/runtime/proc.c:201 +0xc9 fp=0x7ffeefbffa28 sp=0x7ffeefbffa00
runtime.schedinit()
	/opt/go/src/runtime/proc.c:138 +0x55 fp=0x7ffeefbffa50 sp=0x7ffeefbffa28
runtime.rt0_go(0x7ffeefbffa90, 0x1, 0x7ffeefbffa90, 0x0, 0x4001d84, 0x0, 0x1, 0x7ffeefbffbd0, 0x0, 0x7ffeefbffc16, ...)
	/opt/go/src/runtime/asm_amd64.s:95 +0x116 fp=0x7ffeefbffa58 sp=0x7ffeefbffa50
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Updating firmware for SARA module do not work

Bug Report

Current behavior

./FirmwareUploader firmware flash --log-level trace -b arduino:samd:mkrnb1500 -a /dev/ttyACM0 -m [email protected]_01_to_99 -v

Apparently, the update of the firmware for the SARA module do not work properly:
This is the output of the command run above:

INFO[0000] FirmwareUploader Version: git-snapshot Commit: 75bffe3 Date: 2021-06-16T13:03:35Z 
INFO[0000] Checking signature                            index=/tmp/5577006791947779410977017813/index.json signatureFile=/tmp/5577006791947779410977017813/index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/package_index.json signatureFile=/tmp/fwuploader/package_index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/module_firmware_index.json signatureFile=/tmp/fwuploader/module_firmware_index.json.sig trusted=true
INFO[0001] Putting board into bootloader mode           
INFO[0003] Found port to upload Loader: %s/dev/ttyACM0  
Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Mar 26 2018 12:29:38
chipId=0x10010005
Connected at 921600 baud
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Atmel SMART device 0x10010005 found
write(addr=0x20004000,size=0x34)
writeWord(addr=0x20004030,value=0x10)
writeWord(addr=0x20004020,value=0x20008000)
Device       : ATSAMD21G18A
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Chip ID      : 10010005
version()=v2.0 [Arduino:XYZ] Mar 26 2018 12:29:38
Version      : v2.0 [Arduino:XYZ] Mar 26 2018 12:29:38
Address      : 8192
Pages        : 3968
Page Size    : 64 bytes
Total Size   : 248KB
Planes       : 1
Lock Regions : 16
Locked       : readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
none
readWord(addr=0x41004018)=0
Security     : false
Boot Flash   : true
readWord(addr=0x40000834)=0
BOD          : false
readWord(addr=0x40000834)=0
BOR          : false
Arduino      : FAST_CHIP_ERASE
Arduino      : FAST_MULTI_PAGE_WRITE
Arduino      : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
chipErase(addr=0x2000)
done in 0.848 seconds
Write 11312 bytes to flash (177 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x2000, size=0x1000)
[==========                    ] 36% (64/177 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0x1000)
[=====================         ] 72% (128/177 pages)write(addr=0x20005000,size=0xc40)
writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0xc40)
[==============================] 100% (177/177 pages)
done in 0.061 seconds
Verify 11312 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = 828f
checksumBuffer(start_addr=0x3000, size=0x1000) = 391
checksumBuffer(start_addr=0x4000, size=0xc30) = fc43
Verify successful
done in 0.010 seconds
CPU reset.
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
writeWord(addr=0xe000ed0c,value=0x5fa0004)
INFO[0007] Opened port /dev/ttyACM0 at 115200           
INFO[0007] Flashing firmware /tmp/fwuploader/firmwares/SARA/5.6A2_01_to_99/5.6A2_01_to_99.pkg 
Flashing firmware /tmp/fwuploader/firmwares/SARA/5.6A2_01_to_99/5.6A2_01_to_99.pkg
DEBU[0007] sending command data 0, 0, 0, [65 84 43 85 76 83 84 70 73 76 69 13 10] 
ERRO[0037] Expected +ULSTFILE:, got                     
ERRO[0037] Expected +ULSTFILE:, got                     
Error during firmware flashing: Expected +ULSTFILE:, got 
ERRO[0037] Error during firmware flashing: Expected +ULSTFILE:, got  

This seems to be broken even before the recent refactoring:

./FirmwareUploader -flasher firmwares/SARA/SerialSARAPassthrough.ino.bin -firmware firmwares/SARA/5.6A2_01/5.6A2_01_to_99.pkg  -address arduino.cc:443 -port /dev/ttyACM0 -programmer ~/.arduino15/packages/arduino/tools/bossac/1.7.0-arduino3/bossac
2021/06/16 16:02:33 Flashing firmware uploader sara
2021/06/16 16:02:33 Entering board into bootloader mode
2021/06/16 16:02:35 Flashing firmwares/SARA/SerialSARAPassthrough.ino.bin
Atmel SMART device 0x10010005 found
Erase flash
done in 0.849 seconds
Write 11312 bytes to flash (177 pages)
[==============================] 100% (177/177 pages)
done in 0.060 seconds
CPU reset.
2021/06/16 16:02:42 Connecting to programmer
2021/06/16 16:02:42 Opened the serial port with baud rate 115200
2021/06/16 16:02:44 Sync with programmer
2021/06/16 16:02:44 Sending ATE0
2021/06/16 16:03:14 
2021/06/16 16:03:14 Sending ATE0
2021/06/16 16:03:44 
2021/06/16 16:03:44 Sending ATE0
2021/06/16 16:04:14 
2021/06/16 16:04:14 Sending AT
2021/06/16 16:04:44 
2021/06/16 16:04:44 Error: Expected OK, got 

Expected behavior

Environment

  • Updater version: pulled from main (e5f422a)
  • OS and platform: linux

Additional context

Remove ill dependency to solve panics during init

Describe the problem

As detailed here, this library relies on a dependency that breaks with go1.19 (more on this can be found at golang/go#54227)
I suggest changing go.rice in favor of go embed package.

To reproduce

Download and install go1.19

rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz

Build and run the project

go build
./arduino-fwuploader

Expected behavior

working command

Arduino Firmware Uploader version

latest

Operating system

Linux

Operating system version

Ubuntu 20.04.4 LTS

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details

19.5.2 firmware download

I need to update my Wifi101 to 19.5.2 - I read that it only works on ATSAMW25H18-MR510PB → WINC1500 Model B which is what I have.

I have been unable to find that firmware anywhere and cannot use the built-in updated on the Arduino editor, I can only use CLI. Can someone point me to where I can download this firmware?

Can't upload firmware to the Arduino Uno WiFi rev.2

Bug Report

Current behavior

I've tried to upload the NINA firmware (1.4.6) to my Arduino Uno WiFi rev2. When it gets to the INFO[0008] Opened port /dev/ttyACM0 at 115200 line, the board resets and sends an RX command to the Uno WiFi rev.2 as expected, but then it gets stuck. I have tried it about ten times and I've also disconnected and reconnected the board, but without success.

I've run the following command:

./FirmwareUploader firmware flash -v -b arduino:megaavr:uno2018 -a /dev/ttyACM0

Expected behavior

The firmware should upgrade without problems.

Environment

  • Updater version: Git, commit d4c7b34
  • OS and platform: Debian Testing x86_64, Linux 5.10.40

Additional context

I also had a similar problem with previous (stable) releases of the tool: When it tries to connect to the programmer (Uno WiFi rev.2) to start uploading the firmware, the upload fails unless it gets an immediate response from the board.

Sketch flashing exits with status 1

Bug Report

Current behavior

./arduino-fwuploader firmware flash -b arduino:mbed_nano:nanorp2040connect -a /dev/ttyACM0 -m [email protected] --retries 2 -v --log-level trace

Flashing of sketch fails with exit status 1.

Expected behavior

I expected to update the firmware to 1.of the WIFI NINA-module on my Arduino Nano RP2040 Connect.

Environment

  • Updater version: arduino-fwuploader Version: 2.1.0 Commit: 144292a Date: 2021-09-30T13:00:05Z
  • OS and platform: Ubuntu 20.04 LTS

Additional context

I have flashed the Arduino board with the Blink sketch.

➜ ./arduino-fwuploader firmware flash -b arduino:mbed_nano:nanorp2040connect -a /dev/ttyACM0 -m [email protected] --retries 2 -v --log-level trace
INFO[0000] arduino-fwuploader Version: 2.1.0 Commit: 144292a Date: 2021-09-30T13:00:05Z 
INFO[0000] Checking signature                            index=/tmp/55770067919477794103263350056/index.json signatureFile=/tmp/55770067919477794103263350056/index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/package_index.json signatureFile=/tmp/fwuploader/package_index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/module_firmware_index.json signatureFile=/tmp/fwuploader/module_firmware_index.json.sig trusted=true
DEBU[0000] fqbn: arduino:mbed_nano:nanorp2040connect, address: /dev/ttyACM0 
DEBU[0000] got board: arduino:mbed_nano:nanorp2040connect 
DEBU[0001] upload tool downloaded in /tmp/fwuploader/tools/rp2040tools/1.0.2 
DEBU[0001] module name: NINA, firmware version: 1.4.8   
DEBU[0001] firmware file downloaded in /tmp/fwuploader/firmwares/NINA/1.4.8/NINA-arduino.mbed_nano.nanorp2040connect.bin 
DEBU[0001] loader sketch downloaded in /tmp/fwuploader/sketch/loader.elf 
INFO[0001] Putting board into bootloader mode           
DEBU[0011] uploading with command: "/tmp/fwuploader/tools/rp2040tools/1.0.2/rp2040load" -v -D "/tmp/fwuploader/sketch/loader.elf" 
rp2040load 1.0.1 - compiled with go1.15.8
.....................
error during sketch flashing: exit status 1
ERRO[0022] error during sketch flashing: exit status 1  
INFO[0022] Waiting 1 second before retrying...          
INFO[0023] Retrying upload (1 of 2)                     
INFO[0023] Putting board into bootloader mode           
DEBU[0033] uploading with command: "/tmp/fwuploader/tools/rp2040tools/1.0.2/rp2040load" -v -D "/tmp/fwuploader/sketch/loader.elf" 
rp2040load 1.0.1 - compiled with go1.15.8
.....................
error during sketch flashing: exit status 1
ERRO[0043] error during sketch flashing: exit status 1  
FATA[0043] Operation failed. :-(        

Suggestion: Add (again) a flash progress indicator

In the previous releases of arduino-fwuploader, there was a firmware flash progress indicator

[...]
2021/06/28 12:45:48 Flashing firmware from 'firmwares/NINA/1.4.7/NINA_W102.bin'
2021/06/28 12:45:48 Erasing 1127424 bytes from address 0x0
Flashing: 75%
[...]

But the latest (rc) versions don't have it, even in verbose mode. It's a great (and useful) feature and I hope that it gets re-added.

Provide step by step guide to show how to add support for more boards

Hello together, this issue is a continuation due to #43 (comment)

Since this project only supports a selection of boards, it would be a great help for all other board owners if you could provide a step by step guide that shows how to modify existing source to implement support for other boards as well. Either just for forks or local builds or to support PRs/contribution to the project. Does that sound any feasable to you :) ?

Thank you anyway!

SSL connection not working after certificate flash on RP2040

Hi,
I'm trying to flash the root CA certificate in order to connect to an FTP server with implicit SSL.
Once i've flashed the .cer file the SSL features don't work anymore, not only I'm not able to connect to the FTPS server, but also, I cannot connect to some test SSL server, as arduino.cc:443, even if i try to upload the arduino certificate using the GUI tool in the IDE.

The only way I can restore the connect SSL functionality (to arduino.cc as a test, not the FTPS server) is to flash again the WifiNina firmware using the tool provided by the Arduino IDE.

The root CA and the FTPS server certificates have been created locally using openssl.

Need help about possibly errors I made flashing the .cer file. I tried also flashing the server certificate, in addition to the root CA.
The board I'm using is the Arduino RP2040 connect.

Thanks for the help.

panic: runtime error: invalid memory address or nil pointer dereference when listing firmwares

Describe the problem

This happened in the Arduino IDE. See the original comment here.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x14bd30e]

goroutine 1 [running]:
github.com/arduino/arduino-fwuploader/cli/firmware.list(0x0, 0x0)
	/home/runner/work/arduino-fwuploader/arduino-fwuploader/cli/firmware/list.go:66 +0x4e
github.com/arduino/arduino-fwuploader/cli/firmware.newListCommand.func1(0xc000492500, 0xc000158ea0, 0x0, 0x2)
	/home/runner/work/arduino-fwuploader/arduino-fwuploader/cli/firmware/list.go:42 +0x39
github.com/spf13/cobra.(*Command).execute(0xc000492500, 0xc000158e80, 0x2, 0x2, 0xc000492500, 0xc000158e80)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xc0001eb900, 0x0, 0x0, 0x1501260)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
main.main()
	/home/runner/work/arduino-fwuploader/arduino-fwuploader/main.go:35 +0x3c Error: Error executing "/Users/a.kitta/dev/git/arduino-ide/arduino-ide-extension/build/arduino-fwuploader" firmware list --format json: unexpected end of JSON input
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x14bd30e]

goroutine 1 [running]:
github.com/arduino/arduino-fwuploader/cli/firmware.list(0x0, 0x0)
	/home/runner/work/arduino-fwuploader/arduino-fwuploader/cli/firmware/list.go:66 +0x4e
github.com/arduino/arduino-fwuploader/cli/firmware.newListCommand.func1(0xc000492500, 0xc000158ea0, 0x0, 0x2)
	/home/runner/work/arduino-fwuploader/arduino-fwuploader/cli/firmware/list.go:42 +0x39
github.com/spf13/cobra.(*Command).execute(0xc000492500, 0xc000158e80, 0x2, 0x2, 0xc000492500, 0xc000158e80)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xc0001eb900, 0x0, 0x0, 0x1501260)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
main.main()
	/home/runner/work/arduino-fwuploader/arduino-fwuploader/main.go:35 +0x3c
    at ChildProcess.<anonymous> (/Users/a.kitta/dev/git/arduino-ide/arduino-ide-extension/lib/node/exec-util.js:53:31)
    at ChildProcess.emit (node:events:394:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
    at Process.callbackTrampoline (node:internal/async_hooks:130:17)

To reproduce

I do not have a straightforward way to reproduce the defect, but as noted here, the firmware updater returns with an invalid JSON occasionally.

Click to expand the invalid JSON
[
  {
    "board_name": "Arduino MKR1000",
    "board_fqbn": "arduino:samd:mkr1000",
    "module": "WINC1500",
    "firmware_version": "19.4.4",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR1000",
    "board_fqbn": "arduino:samd:mkr1000",
    "module": "WINC1500",
    "firmware_version": "19.5.2",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR1000",
    "board_fqbn": "arduino:samd:mkr1000",
    "module": "WINC1500",
    "firmware_version": "19.5.4",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR1000",
    "board_fqbn": "arduino:samd:mkr1000",
    "module": "WINC1500",
    "firmware_version": "19.6.1",
    "Latest": true
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.0.0",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.1.0",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.2.1",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.2.2",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.2.3",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.2.4",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.3.0",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.4.0",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.4.1",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.4.2",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.4.3",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.4.4",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.4.5",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.4.6",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.4.7",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR WiFi 1010",
    "board_fqbn": "arduino:samd:mkrwifi1010",
    "module": "NINA",
    "firmware_version": "1.4.8",
    "Latest": true
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.0.0",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.1.0",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.2.1",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.2.2",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.2.3",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.2.4",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.3.0",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.4.0",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.4.1",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.4.2",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.4.3",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.4.4",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.4.5",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.4.6",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.4.7",
    "Latest": false
  },
  {
    "board_name": "Arduino NANO 33 IoT",
    "board_fqbn": "arduino:samd:nano_33_iot",
    "module": "NINA",
    "firmware_version": "1.4.8",
    "Latest": true
  },
  {
    "board_name": "Arduino MKR Vidor 4000",
    "board_fqbn": "arduino:samd:mkrvidor4000",
    "module": "NINA",
    "firmware_version": "1.0.0",
    "Latest": false
  },
  {
    "board_name": "Arduino MKR Vidor 4000",
    "board_fqbn": "arduino:samd:mkrvidor4000",
    "module": "NINA",
    "firmware_version": "1.1.0",
    "Latest": true
  },
  {
    "board_name": "Arduino Uno WiFi Rev2",
    "board_fqbn": "arduino:megaavr:uno2018",
    "module": "NINA",
    "firmware_version": "1.2.1",
    "Latest": false
  },
  {
    "board_name": "Arduino Uno WiFi Rev2",
    "board_fqbn": "arduino:megaavr:uno2018",
    "module": "NINA",
    "firmware_version": "1.2.2",
    "Latest": false
  },
  {
    "board_name": "Arduino Uno WiFi Rev2",
    "board_fqbn": "arduino:megaavr:uno2018",
    "module": "NINA",
    "firmware_version": "1.2.3",
    "Latest": false
  },
  {
    "board_name": "Arduino Uno WiFi Rev2",
    "board_fqbn": "arduino:megaavr:uno2018",
    "module": "NINA",
    "firmware_version": "1.2.4",
    "Latest": false
  },
  {
    "board_name": "Arduino Uno WiFi Rev2",
    "board_fqbn": "arduino:megaavr:uno2018",
    "module": "NINA",
    "firmware_version": "1.3.0",
    "Latest": false
  },
  {
    "board_name": "Arduino Uno WiFi Rev2",
    "board_fqbn": "arduino:megaavr:uno2018",
    "module": "NINA",
    "firmware_version": "1.4.0",
    "Latest": false
  },
  {
    "board_name": "Arduino Uno WiFi Rev2",
    "board_fqbn": "arduino:megaavr:uno2018",
    "module": "NINA",
    "firmware_version": "1.4.1",
    "Latest": false
  },
  {
    "board_name": "Arduino Uno WiFi Rev2",
    "board_fqbn": "arduino:megaavr:uno2018",
    "module": "NINA",
    "firmware_version": "1.4.2",
    "Latest": false
  },
  {
    "board_name": "Arduino Uno WiFi Rev2",
    "board_fqbn": "arduino:megaavr:uno2018",
    "module": "NINA",
    "firmware_version": "1.4.3",
    "Latest": false
  },
  {
    "board_name": "Arduino Uno WiFi Rev2",
    "board_fqbn": "arduino:megaavr:uno2018",
    "module": "NINA",
    "f

Expected behavior

No error.

Arduino Firmware Uploader version

arduino-fwuploader Version: 2.0.0 Commit: eb51bf2 Date: 2021-07-28T16:19:28Z

Operating system

macOS

Operating system version

12.3.1 (21E258)

Additional context

I could not reproduce the bug. The latest and 2.0.0 versions worked when I executed the following command in a terminal.

./arduino-fwuploader firmware list --format json

But it happened multiple times in the IDE. I do not know where the null pointer exception comes from.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details

MKR Vidor 4000 NINA FW version

Describe the problem

The list command only shows MKR Vidor 4000 NINA firmware up to version 1.1.0. This comes from the global: ModuleFirmwareIndexGZURL = "https://downloads.arduino.cc/arduino-fwuploader/boards/module_firmware_index.json.gz"

However module_firmware_index.json in test data contains versions up to 1.4.5.

Is this an issue with the index file version hosted on arduino.cc or does the Vidor 4000 really not support any newer firmware?

To reproduce

arduino-fwuploader.exe firmware list

scroll down to version listed for the MKR Vidor 4000

compare this to the contents of module_firmware_index.json

Expected behavior

I'd like to be able to update the Vidor 4000 NINA firmware to a newer version.

Arduino Firmware Uploader version

0e0fb39

Operating system

Windows

Operating system version

10

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details

Temporary files are not cleaned up

Describe the problem

Arduino Firmware Uploader creates some temporary folders:

  • Name format: 55770067919477794103602099745
  • Name: fwuploader

These persist even after the process completes.

The class of folder first on that list accumulates over time, which may eventually cause a performance impact.

To reproduce

  1. Take note of the contents of your temporary folder.
    • Windows:
      C:\Users\<user name>\AppData\Local\Temp
      
    • Linux:
      /tmp
      
    • macOS
      $TMPDIR
      
  2. Run the following command:
    arduino-fwuploader firmware list
    
  3. Examine the contents of your temporary folder.

🐛 An additional 55770067919477794103602099745 folder is present.
🐛 The fwuploader folder is still present.

Expected behavior

Temporary files are cleaned up on exit.

Arduino Language Server version

2b1ab09

Operating system

  • Windows
  • Linux
  • macOS

Operating system version

  • Windows 11
  • Ubuntu 22.04
  • macOS Ventura

Additional context

Some operating systems may eventually do a clean-up on the temporary folder, but this is not guaranteed. It is better for the application to take care of clean up of any temporary files once they are no longer needed.


Additional reports:


Related:

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details

Firmware Updater stuck on "Synch with programmer"

I'm trying to add new certificate to my mlk1000. My steps were:

  1. I've uploaded FirmwareUpdater sketch to the MCU with no errors
  2. I ran winc1500-uploader.exe -address=*****.com:443 -port=COM4
  3. The result is:

2016/05/03 17:45:31 Connecting to programmer
2016/05/03 17:45:33 Synch with programmer

The same happens with winc1500-uploader-gui. It stucks on "Synchronizing with the programmer".

My configuration:

  1. IDE selection
  • Board: Arduino/Genuino MKR1000
  • Port: COM4
  1. OS Windows 10
  2. Genuino MKR1000, MR510PB
  3. CheckWifi101FirmwareVersion returns:

WiFi101 firmware check.

WiFi101 shield: DETECTED
Firmware version installed: 19.4.4
Firmware version required : 19.4.4

Check result: PASSED

  1. WiFi 101 version 0.9.1
  2. Board Library: Arduino SAMD boards version 1.6.5

UPDATE: after trying to unsuccessfully update certificates on my MKR1000, it will not handle SSL connections at all. I've tried WiFiSSLClient sketch and it fails to connect to google on port 443. The output is:

Attempting to connect to SSID: ****
Connected to wifi
SSID: ****
IP Address: 192.168.43.18
signal strength (RSSI):-39 dBm

Starting connection to server...

disconnecting from server.


The normal WiFiClient sketch works.

FW Uploader might provide a broken JSON

Describe the problem

From time to time, when I start IDE2, the firmware uploader does not provide a valid JSON when executing ./arduino-fwuploader" firmware list --format json.

IDE2 error is:

Uncaught (in promise) Error: Error executing "/Users/a.kitta/dev/git/arduino-ide/arduino-ide-extension/build/arduino-fwuploader" firmware list --format json: unexpected end of JSON input
    at currentExtensions.<computed> (node.cjs:963)
    at read (node.cjs:403)
    at Array.readObject [as read] (node.cjs:496)
    at recordDefinition (node.cjs:956)
    at read (node.cjs:392)
    at checkedRead (node.cjs:193)
    at Packr.unpack (node.cjs:103)
    at Packr.decode (node.cjs:175)
    at MsgPackMessageDecoder.decode (rpc-message-encoder.ts:181)
    at MsgPackMessageDecoder.parse (rpc-message-encoder.ts:185)

To reproduce

I do not know the exact steps to reproduce, but I see the same error almost weekly in the logs.

Expected behavior

The firmware list --format json command provides a valid JSON.

Arduino Firmware Uploader version

arduino-fwuploader Version: 2.2.2 Commit: 8944d4a Date: 2022-10-17T14:51:09Z

Operating system

macOS

Operating system version

12.6.3

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details

I am completely lost

Bug Report

Current behavior

Expected behavior

Environment

  • Updater version: downloaded yesterday
  • OS and platform:mac catalina

Additional context

Migrate Nina firmwares to the new plugin system

We need to update the generator.py to publish all the 5 4 boards based on nina:

  • arduino:samd:mkrwifi1010
  • arduino:samd:nano_33_iot
  • arduino:samd:mkrvidor4000 (EOL)
  • arduino:megaavr:uno2018
  • arduino:mbed_nano:nanorp2040connect

All the boards uses the same plugin but different loader tools.
The arduino:mbed_nano:nanorp2040connect uses rp2040tools
The arduino:megaavr:uno2018 uses avrdude
The remaining uses bossac.

Uploading ECDSA certificates to WiFi101

Describe the request

Currently, the certificate upload for the WiFI101 based HW does not support ECC-based certificates. This is an issues, as some sites (e.g., make.com) use ECC-based certificates and can thus not be reached.

Note that the WiFinina fwuploader does support these kind of certificates.

Describe the current behavior

Currently, the firmware uploader simply responds with "Upload failed. Please try again", when trying to upload an ECC-based certificate (log output attached below).

More specifically, the following steps were performed:

  • Open Arduino IDE 2.0.3
  • Connect Arduino MKR1000
  • Select Tools > Upload SSL Root Certificates
  • Add hook.eu1.make.com:443 to the list, select it, select the board and click upload
  • After some time, the tool responds with "Upload failed, Please try again"

Arduino Firmware Uploader version

Original report

arduino-fwuploader Version: 2.2.2 Commit: 8944d4a Date: 2022-10-17T14:51:09Z

Last verified with

2.3.0

Operating system

Windows

Operating system version

10

Additional context

The log file shows the following exception:

2022-12-07 14:23:43 2022-12-07T13:23:43.722Z root ERROR Request uploadCertificates failed with error: Error executing "C:\Program Files\Arduino IDE\resources\app\node_modules\arduino-ide-extension\build\arduino-fwuploader.exe" certificates flash -b arduino:samd:mkr1000 -a COM30 -u hook.eu1.make.com:443: panic: interface conversion: interface {} is *ecdsa.PublicKey, not *rsa.PublicKey

goroutine 1 [running]:
github.com/arduino/arduino-fwuploader/flasher.(*WincFlasher).getCertificateData(0x130100010304?, 0xc000348580)
	/home/runner/work/arduino-fwuploader/arduino-fwuploader/flasher/winc.go:182 +0x545
github.com/arduino/arduino-fwuploader/flasher.(*WincFlasher).certificateFromURL(0xc000006018?, {0xc00045cee8, 0x15})
	/home/runner/work/arduino-fwuploader/arduino-fwuploader/flasher/winc.go:162 +0x433
github.com/arduino/arduino-fwuploader/flasher.(*WincFlasher).FlashCertificates(0xc00001e130?, 0xc00065c0c0?, {0xc00005b1e0, 0x1, 0xc00001e130?}, {0x90ee80, 0xc000006018})
	/home/runner/work/arduino-fwuploader/arduino-fwuploader/flasher/winc.go:98 +0x4d2
github.com/arduino/arduino-fwuploader/cli/certificates.runFlash(0xc0001c3400?, {0xc0000666c0?, 0x6?, 0x6?})
	/home/runner/work/arduino-fwuploader/arduino-fwuploader/cli/certificates/flash.go:125 +0x650
github.com/spf13/cobra.(*Command).execute(0xc0001c3400, {0xc000066660, 0x6, 0x6})
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0xc0001c2000)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x39c
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
main.main()
	/home/runner/work/arduino-fwuploader/arduino-fwuploader/main.go:34 +0x45

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest version
  • My request contains all necessary details

Error when using the tool for a SAM D21 based Arduino board with WINC1500 WiFi module attached

Bug Report

Current behavior

FirmwareUploader --model winc --flasher FirmwareUpdater.SenseBoxMcuV2.ino.bin --firmware firmware\19.6.1_m2m_aio_3a0.bin --port COM3 --retries 1

The above command end in this stack trace:

2021/06/06 21:00:36 Flashing firmware uploader winc
2021/06/06 21:00:36 Entering board into bootloader mode
2021/06/06 21:00:46 Flashing FirmwareUpdater.SenseBoxMcuV2.ino.bin
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x2b57ed]

goroutine 1 [running]:
github.com/arduino/go-paths-helper.(*Path).String(...)
        /home/runner/go/pkg/mod/github.com/arduino/[email protected]/paths.go:558
github.com/arduino/arduino-cli/executils.NewProcessFromPath(0x0, 0x1145fea0, 0x6, 0x6, 0x2f, 0x0, 0x0)
        /home/runner/go/pkg/mod/github.com/arduino/[email protected]/executils/process.go:54 +0x1d
github.com/arduino/FirmwareUploader/programmers/bossac.(*Bossac).invoke(0x1145ff04, 0x1145fea0, 0x6, 0x6, 0x25, 0x11490000)
        /home/runner/work/FirmwareUploader/FirmwareUploader/programmers/bossac/bossac.go:45 +0x3f
github.com/arduino/FirmwareUploader/programmers/bossac.(*Bossac).Flash(0x1145ff04, 0x11410240, 0x25, 0x0, 0xffffffff, 0x38)
        /home/runner/work/FirmwareUploader/FirmwareUploader/programmers/bossac/bossac.go:37 +0x1c5
github.com/arduino/FirmwareUploader/modules/winc.Run(0x1145ff70, 0x0, 0x0)
        /home/runner/work/FirmwareUploader/FirmwareUploader/modules/winc/main.go:44 +0x564
main.main()
        /home/runner/work/FirmwareUploader/FirmwareUploader/main.go:72 +0x214

Expected behavior

Flasher file is loaded to the Arduino board

Environment

  • Updater version: latest
  • OS and platform: Win10

Additional context

The board I am using is a senseBox MCU v2 (https://en.docs.sensebox.de/hardware/allgemein-sensebox-mcu/) based on SAM D21. In the Arduino IDE I would use arduino:avrispmkii as a programmer but I do not know if this matters here. Does it seem to you like this is a problem with the compiled sketch? Or do I need to follow a specific folder structure (because of the "Path" mentioned in the stack trace).

The bin file is created using an example sketch from the senseBox repo (attached here:
Winc1500_Updater.zip)

'failed MSpanList_Insert' Error

I can't run it on macOS High Sierra version 10.13.3. I get an error running both the gui and the cli script.

Here's the whole output

failed MSpanList_Insert 0x4db8000 0x98921254ea56 0x0
fatal error: MSpanList_Insert

runtime stack:
runtime.throw(0x4b8f18b)
	/opt/go/src/runtime/panic.go:491 +0xad fp=0x7ffeefbff050 sp=0x7ffeefbff020
runtime.MSpanList_Insert(0x4be3888, 0x4db8000)
	/opt/go/src/runtime/mheap.c:692 +0x8f fp=0x7ffeefbff078 sp=0x7ffeefbff050
MHeap_FreeSpanLocked(0x4be0480, 0x4db8000, 0x100)
	/opt/go/src/runtime/mheap.c:583 +0x163 fp=0x7ffeefbff0b8 sp=0x7ffeefbff078
MHeap_Grow(0x4be0480, 0x8, 0x0)
	/opt/go/src/runtime/mheap.c:420 +0x1a8 fp=0x7ffeefbff0f8 sp=0x7ffeefbff0b8
MHeap_AllocSpanLocked(0x4be0480, 0x1, 0x0)
	/opt/go/src/runtime/mheap.c:298 +0x365 fp=0x7ffeefbff138 sp=0x7ffeefbff0f8
mheap_alloc(0x4be0480, 0x1, 0x12, 0x0)
	/opt/go/src/runtime/mheap.c:190 +0x121 fp=0x7ffeefbff160 sp=0x7ffeefbff138
runtime.MHeap_Alloc(0x4be0480, 0x1, 0x10000000012, 0x40327e9)
	/opt/go/src/runtime/mheap.c:240 +0x66 fp=0x7ffeefbff198 sp=0x7ffeefbff160
MCentral_Grow(0x4be81f8, 0x0)
	/opt/go/src/runtime/mcentral.c:197 +0x8b fp=0x7ffeefbff200 sp=0x7ffeefbff198
runtime.MCentral_CacheSpan(0x4be81f8, 0x0)
	/opt/go/src/runtime/mcentral.c:85 +0x167 fp=0x7ffeefbff238 sp=0x7ffeefbff200
runtime.MCache_Refill(0x4db4000, 0x12, 0x0)
	/opt/go/src/runtime/mcache.c:90 +0xa0 fp=0x7ffeefbff260 sp=0x7ffeefbff238
runtime.mcacheRefill_m()
	/opt/go/src/runtime/malloc.c:368 +0x57 fp=0x7ffeefbff280 sp=0x7ffeefbff260
runtime.onM(0x49d2fb0)
	/opt/go/src/runtime/asm_amd64.s:273 +0x9a fp=0x7ffeefbff288 sp=0x7ffeefbff280
runtime.mallocgc(0x120, 0x450b3a0, 0x0, 0x0)
	/opt/go/src/runtime/malloc.go:178 +0x849 fp=0x7ffeefbff338 sp=0x7ffeefbff288
runtime.newobject(0x450b3a0, 0x4db4000)
	/opt/go/src/runtime/malloc.go:353 +0x49 fp=0x7ffeefbff360 sp=0x7ffeefbff338
runtime.newG(0x404b97a)
	/opt/go/src/runtime/proc.go:233 +0x2a fp=0x7ffeefbff378 sp=0x7ffeefbff360
allocg(0x4bd0b60)
	/opt/go/src/runtime/proc.c:925 +0x1f fp=0x7ffeefbff388 sp=0x7ffeefbff378
runtime.malg(0x8000, 0x4bd0d20)
	/opt/go/src/runtime/proc.c:2106 +0x1f fp=0x7ffeefbff3b8 sp=0x7ffeefbff388
runtime.mpreinit(0x4bd10e0)
	/opt/go/src/runtime/os_darwin.c:137 +0x27 fp=0x7ffeefbff3d0 sp=0x7ffeefbff3b8
mcommoninit(0x4bd10e0)
	/opt/go/src/runtime/proc.c:201 +0xc9 fp=0x7ffeefbff3f8 sp=0x7ffeefbff3d0
runtime.schedinit()
	/opt/go/src/runtime/proc.c:138 +0x55 fp=0x7ffeefbff420 sp=0x7ffeefbff3f8
runtime.rt0_go(0x7ffeefbff468, 0x1, 0x7ffeefbff468, 0x0, 0x4001d84, 0x0, 0x0, 0x1, 0x7ffeefbff628, 0x0, ...)
	/opt/go/src/runtime/asm_amd64.s:95 +0x116 fp=0x7ffeefbff428 sp=0x7ffeefbff420
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Deleting expired sessions...253 completed.

[Process completed]

segmentation violation

I just tried to update the firmware of my nano iot 33 board. The updated failed and left my board unusable (no /dev/ttyACM0 any more). How can I restore my board?

./updater -flasher firmwares/NINA/FirmwareUpdater.mkrwifi1010.ino.bin -firmware firmwares/NINA/1.4.1/NINA_W102.bin -port /dev/ttyACM0 -programmer /home/client/.arduino15/packages/arduino/tools/bossac/1.7.0-arduino3/bossac 
2020/09/25 17:03:14 Flashing firmware uploader nina
2020/09/25 17:03:14 Flashing firmwares/NINA/FirmwareUpdater.mkrwifi1010.ino.bin
2020/09/25 17:03:14 Restarting in bootloader mode
2020/09/25 17:03:14 Get port list before reset
2020/09/25 17:03:14 Touching port /dev/ttyACM0 at 1200bps
2020/09/25 17:03:14 Set DTR off
2020/09/25 17:03:25 Wait for the port to reappear
2020/09/25 17:03:27 Atmel SMART device 0x10010005 found
Unlock all regions

Read 253952 bytes from flash
[==============================] 100% (3968/3968 pages)
done in 1.254 seconds

2020/09/25 17:03:27 Original sketch saved at /tmp/wifiFlasher_dump183132501/dump.bin
2020/09/25 17:03:29 Atmel SMART device 0x10010005 found
Erase flash
done in 0.880 seconds

Write 13688 bytes to flash (214 pages)
[==============================] 100% (214/214 pages)
done in 0.085 seconds
CPU reset.

2020/09/25 17:03:39 Connecting to programmer
2020/09/25 17:03:41 Sync with programmer
panic: runtime error: invalid memory address or nil pointer dereference
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x61d1e9]

goroutine 1 [running]:
github.com/arduino-libraries/FirmwareUpdater/modules/nina.(*Flasher).Close(0xc0002da440, 0x0, 0x0)
        /home/martino/FirmwareUpdater/src/github.com/arduino-libraries/FirmwareUpdater/modules/nina/flasher.go:76 +0x29
panic(0x64ca00, 0x8031d0)
        /usr/lib/go/src/runtime/panic.go:969 +0x175
encoding/binary.Write(0x0, 0x0, 0x6d3100, 0x83e0b0, 0x6411e0, 0x7f5e88, 0x29, 0x14)
        /usr/lib/go/src/encoding/binary/binary.go:375 +0x149
github.com/arduino-libraries/FirmwareUpdater/modules/nina.(*Flasher).sendCommand(0xc0002da440, 0x1122334400068099, 0x55667788, 0x0, 0x0, 0x0, 0x4f120c, 0xc000068050)
        /home/martino/FirmwareUpdater/src/github.com/arduino-libraries/FirmwareUpdater/modules/nina/flasher.go:172 +0x98
github.com/arduino-libraries/FirmwareUpdater/modules/nina.(*Flasher).Hello(0xc0002da440, 0x1, 0x1)
        /home/martino/FirmwareUpdater/src/github.com/arduino-libraries/FirmwareUpdater/modules/nina/flasher.go:48 +0x54
github.com/arduino-libraries/FirmwareUpdater/modules/nina.Run(0x7ffc7ef483a5, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7ffc7ef4837c, 0x22, 0x7ffc7ef4833f, ...)
        /home/martino/FirmwareUpdater/src/github.com/arduino-libraries/FirmwareUpdater/modules/nina/main.go:73 +0x2f5
main.main()
        /home/martino/FirmwareUpdater/src/github.com/arduino-libraries/FirmwareUpdater/cli/main.go:47 +0x218

Allow downloading `module_firmware_index.json` and signature in a single tar.bz2 archive

Similar to arduino/arduino-cli#1734 but for fwuploader and module_firmware_index.json
Originally reported by @kittaakos:

updatableBoards failed with error: Error executing "/Users/a.kitta/dev/git/arduino-ide/arduino-ide-extension/build/arduino-fwuploader" firmware list --format json: openpgp: invalid signature: hash tag doesn't match Error: Error executing "/Users/a.kitta/dev/git/arduino-ide/arduino-ide-extension/build/arduino-fwuploader" firmware list --format json: openpgp: invalid signature: hash tag doesn't match

@cmaglie theory:

the hypothesis is that the cloudflare cache is not aligned for some millisecond and if you download the signature in that instant the signature do not match

probably the most reliable solution is to do what we did with the package_index -> create an tar.bz2 archive with both signature and index, so they are downloaded togherter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.