WiFiNinaFirmwareUpdater Error: "SerialUSB was not declared in this scope"

Good morning everybody,

Without any modification from the original WiFiNINA firmware updater, I got the error message:

"SerialUSB was not declared in this scope"

Hw and sw details:
Arduino:1.8.9 (Windows 7), Scheda:"Arduino Uno WiFi Rev2, ATMEGA328"
WiFiNINA firmware check: Firmware version installed: 1.0.0

Thanks in advance for any actionable help and suggestion.

Andrea


following detail from the error message and related code, I think you should know pretty well :wink:

C:\Users\ThinkPad\Documents\Arduino\libraries\WiFiNINA\examples\Tools\WiFiNINAFirmwareUpdater\WiFiNINAFirmwareUpdater.ino: In function 'void setup()':

WiFiNINAFirmwareUpdater:25:3: error: 'SerialUSB' was not declared in this scope


/*
  WiFiNINAFirmwareUpdater - Firmware Updater for the 
  Arduino MKR WiFi 1010, Arduino MKR Vidor 4000, and Arduino UNO WiFi Rev.2.
  
  Copyright (c) 2018 Arduino SA. All rights reserved.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more 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
*/

unsigned long baud = 115200;

void setup() {
  SerialUSB.begin(baud);
  SerialNina.begin(baud);
  
  pinMode(NINA_GPIO0, OUTPUT);
  pinMode(NINA_RESETN, OUTPUT);
}

void loop() {
  digitalWrite(NINA_RESETN, SerialUSB.rts());
  digitalWrite(NINA_GPIO0, (SerialUSB.dtr() == 0) ? HIGH : LOW);

  while (SerialUSB.available()) {
    uint8_t c = SerialUSB.read();
    SerialNina.write(c);
  }

  while (SerialNina.available()) {
    uint8_t c = SerialNina.read();
    SerialUSB.write(c);
  }

  // check if the USB virtual serial wants a new baud rate
  if (SerialUSB.baud() != baud) {
    baud = SerialUSB.baud();
    SerialNina.begin(baud);
  }
}

The problem is that you're using a very outdated version of the WiFiNINA library. Please do this:

  • Sketch > Include Library > Manage Libraries...
  • Wait for the download to finish
  • In the "Filter your search..." field, type "wifinina".
  • Press Enter.
  • Click on "WiFiNINA by Arduino".
  • Click the "Update" button.
  • Wait for the update to finish.
  • Click the "Close" button.
  • File > Examples > WiFiNINA > Tools > FirmwareUpdater

Hi pert,

crystal clear recovery actions.

It worked perfectly: thanks so much for swing help!

Oustanding support indeed.

Cheers from a deep raining Milan, Italy.

You're welcome. I'm glad to hear it's working now. It's been a rainy day here in Northern California, USA as well. Enjoy!
Per