Go Down

Topic: Arduino UNO Wifi Rev 2 ATMEGA328 vs. ATMEGA4809 (Read 338 times) previous topic - next topic

RICHAristotle

Hello,

    I purchased an Arduino UNO Wifi Rev 2 and I'm having problems checking the firmware version and compiling the firmware updater. I'm using the Arduino 1.8.8 IDE. I also played around with updating the firmware in the web editor and this is where I may have shot myself in the foot. I selected the Arduino UNO Wifi Rev 2 board with registers emulation ATMEGA328 and compiled the firmware updater. The ATMEGA328 was the only option. After that nothing compiles. I get an error of:

Arduino: 1.8.8 (Windows 10), Board: "Arduino Uno WiFi Rev2, None (ATMEGA4809)"

WARNING: library SPI claims to run on (avr) architecture(s) and may be incompatible with your current board which runs on (megaavr) architecture(s).
In function 'global constructors keyed to 65535_0_CheckFirmwareVersion.ino.cpp.o':

lto1.exe: internal compiler error: Segmentation fault

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

lto-wrapper.exe: fatal error: C:\Users\Ricardo\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/users/ricardo/appdata/local/arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino Uno WiFi Rev2.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Anyone know how I can get the correct (megaavr) architecture(s) back?

Juraj

you got it all in one :-) the compiler crash is a separete problem of avr-gcc.
 the Uno WiFi R2 is really not avr architecture.

and I don't think the emulation matters for the updater sketch
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

pert

WARNING: library SPI claims to run on (avr) architecture(s) and may be incompatible with your current board which runs on (megaavr) architecture(s).

Anyone know how I can get the correct (megaavr) architecture(s) back?
This warning indicates you're using an outdated version of Arduino megaAVR Boards. Please do this:
  • Tools > Board > Boards Manager
  • Wait for downloads to finish.
  • Click on "Arduino megaAVR Boards".
  • Click "Update".
  • Wait for the update to finish.
  • Click "Close".

The cause of that particular warning actually is unlikely to cause any problems, though it is annoying. However, there have been additional improvements made to Arduino megaAVR Boards since the version you were using so it's still a good idea to use the newest version.



In function 'global constructors keyed to 65535_0_CheckFirmwareVersion.ino.cpp.o':

lto1.exe: internal compiler error: Segmentation fault

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

lto-wrapper.exe: fatal error: C:\Users\Ricardo\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2/bin/avr-gcc returned 1 exit status

compilation terminated.
This is the real issue, and has nothing to do with the architecture mismatch warning. This is a tricky bug that is very sporadic. It may just go away after you update Arduino megaAVR Boards, though this would be purely by chance, rather than because the cause of the error was fixed.

The error is specific to the avr-gcc 5.4.0 version used by Arduino megaAVR Boards. There is a beta test version of Arduino megaAVR Boards which uses avr-gcc 7.3.0. Use of that version should fix the segmentation fault error. Here's how you can install it:
  • File > Preferences
  • In the "Additional Boards Manager URLs" field, add http://downloads.arduino.cc/packages/package_avr_7.3.0_index.json if you have multiple URLs in this field, you can separate them with commas.
  • Click "OK".
  • Tools > Board > Boards Manager
  • Wait for downloads to finish.
  • Click on "Arduino megaAVR Boards".
  • Click "Update".
  • Wait for the update to finish. You should now have Arduino megaAVR Boards 1.6.210 installed.
  • Click "Close".


Reference: https://github.com/arduino/Arduino/issues/7949

pert

I reported the issue with the missing Registers emulation option in Arduino Web Editor here:
http://forum.arduino.cc/index.php?topic=590843

RICHAristotle

#4
Jan 17, 2019, 07:07 am Last Edit: Jan 17, 2019, 07:10 am by RICHAristotle Reason: One file did not attach (DOCX)!
Thanks! That helped, but I still have a problem. The problem is detailed below. The programmer is not working. The reason I keep missing with the firmware scanner is that keeps saying that the WiFi module is not communicating. I want to ensure that this working.

And, in my example sketches for WiFiNINA there is no Firmware Scanner as before. That was kind of odd.

pert

Thanks!
You're welcome. I'm glad if I was able to be of assistance.

And, in my example sketches for WiFiNINA there is no Firmware Scanner as before. That was kind of odd.
Please do this:
  • Sketch > Include Library > Manage Libraries
  • Wait for the download to finish
  • In the "Filter your search" field, type "wifinina".
  • Next to the "WiFiNINA by Arduino" search result, it should show which version you have installed. That version should be 1.3.0. If not, click the "Update" button, and then the "Close" button after the update finishes.


I'm not familiar with this "Firmware Scanner" example you are missing. I do see that WiFiNINA 1.3.0 has an example named "CheckFirmwareVersion". Could that be the one you're thinking of? It will be under the File > Examples > WiFiNINA > Tools menu.

GoForSmoke

I had to look the board up, the crypto chip took me up to wow. The controller... nice extra flash and RAM, the wifi needs it right?

Quote
Microcontroller    ATMEGA4809
Operating Voltage    5V
Input Voltage (recommended)    7 - 12V
Digital I/O Pins    14 -- 5 Provide PWM Output
PWM Digital I/O Pins    5
Analog Input Pins    6
DC Current per I/O Pin    20 mA
DC Current for 3.3V Pin    50 mA
Flash Memory    48 KB (ATMEGA4809)
SRAM    6,144 Bytes (ATMEGA4809)
EEPROM    256 Bytes (ATMEGA4809)
Clock Speed    16 MHz
LED_BUILTIN    25
Length    68.6 mm
Width    53.4 mm
Weight    25 g
LED_BUILTIN  25  ----- I don't see a pin 25 or 25 leds on that board so huh? 25 what?

The AT90USB1286 on the Teensy++ 2.0 is the chip I'd rather see on that board, more everything. Maybe one gets made, that is the biggest USBAVR I know of.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

westfw

Quote
LED_BUILTIN  25  ----- I don't see a pin 25 or 25 leds on that board so huh? 25 what?
I bunch of the more "modern" boards use bigger processor chips, and dedicate pins to the onboard functions (like LED_BUILTIN) that don't "bother" the actual "normal" 20 pins of "Uno IO."  (also, I2C and SPI become separate instead of "internally connected" to another board pin.)  (The pin numbers are just "labels", and the symbolic names start to make a lot more sense!)

The ATmega4809 has 48pins, so 25 is nothing (there are actually 40 entries in the "digitalPinToXXX[]" tables.  See https://docs.google.com/spreadsheets/d/1bUuwxKd7G1r_SFMM6JxqfG8t5nZKr5snB92dXi-N7kY/edit?usp=sharing.)
Adafruit manages to use up most of the 64 chip pins on a mid-sized SAMD51 on their "M4 Metro" Uno-sized board.  That one's here: https://docs.google.com/spreadsheets/d/1hWHiM1Sk-gxcUmfgm5XQctqf9yaOnkmY66cwd_sRCiY/edit?usp=sharing

Go Up