Arduino Genuino Zero Atmel Studio Can Not Upgrade Firmware

Arduino Genuino Zero Atmel Studio can not upgrade firmware after trying to connect to target microcontroller using device programming dialog box or start without debugging icon. How to fix the firmware upgrade problem when the firmware won’t upgrade. A failed firmware upgrade prevents the use of the target board with Atmel Studio 7. The firmware appears to upgrade, but does not, as described below.

Genuino Zero Atmel Studio can’t Upgrade Firmware Problem

After opening the Programming Dialog box in Atmel Studio 7, or trying to program or debug the board, the Firmware Upgrade dialog box opens. After clicking the Upgrade button in the dialog box, the firmware appears to upgrade immediately. When trying to connect to the board again with Atmel Studio, the Firmware Upgrade dialog box appears again saying that the firmware needs upgrading. The dialog box appears as follows after the attempted upgrade that does not work. Here the Firmware Upgrade dialog box appears after the Apply button was clicked in the Device Programming dialog box.

Arduino Genuino Zero Atmel Studio Can Not Upgrade Firmware

Arduino Genuino Zero Atmel Studio Can Not Upgrade Firmware

This problem occurred on my Genuino Zero board, but I have read reports of it happening on Arduino M0 Pro boards and Atmel SAMD21 Xplained boards as well. The firmware that Atmel Studio is attempting to upgrade is the firmware in the embedded debugger (EDBG) chip found on Arduino Genuino Zero, Arduino M0 Pro and SAMD21 Xplained Pro boards.

Arduino Genuino Zero Atmel Studio Can Not Upgrade Firmware Solution

This solution simply stops stops Atmel Studio from automatically checking if the firmware needs upgrading. It does not actually upgrade the firmware on the EDBG chip.

The following steps describe how to bypass the firmware upgrade in Atmel Studio.

1. Open the Device Programming Dialog Box

Start Atmel Studio and then click the Device Programming icon as shown in the image below. The icon is found on the top toolbar. This opens the Device Programming dialog box.

Atmel Studio Device Programming Icon

Atmel Studio Device Programming Icon

2. Open the Device Programming Settings

In the Device Programming dialog box, select EDBG as the tool and SWD for the interface. In the Device field, select the target microcontroller on the board. For Arduino / Genuino Zero / M0 Pro boards this is ATSAMD21G18A. For the Atmel SAMD21 Xplained Pro, it is ATSAMD21J18A.

When clicking the Apply button in the Device Programming dialog box, the Firmware Upgrade dialog box appears and then fails to properly upgrade the firmware. Instead of clicking the Apply button, click the Settings icon at the right of the Device Programming dialog box as shown in the image below.

Device Programming Settings

Device Programming Settings

3. Disable the Check Firmware Setting

In the Options dialog box, find Tools near the bottom of the left pane and expand it. Click the Tool settings item to select it. In the right pane, double click True at the right of Check firmware to change it to False. These steps are shown in the image below.

Disable Check Firmware

Disable Check Firmware

Click the OK button to close the dialog box.

4. Test the Changes

Finally test the changes. Back in the Device Programming dialog box, with the correct tool, device and interface selected, click the Apply button. This time the Firmware Upgrade dialog box should not appear and it should be possible to program and debug the target microcontroller. Click the Read button next to Device Signature to make sure that the communications with the target microcontroller is working. These steps are shown in the image below.

Read Device Signature

Read Device Signature

Conclusion

After completing the above steps, I was able to program my Arduino Genuino Zero board using Atmel Studio. I first backed up the bootloader using the Device Programming dialog box and then loaded a C program that blinks the on-board LED. This proved that the EDBG interface could be used to read and write without upgrading the firmware.

Although this solution may not be ideal because the EDBG firmware is not updated to the latest version, it still solved the problem of having an endless firmware upgrade loop that fails to upgrade the firmware and then prevents use of the target board with Atmel Studio.

 

Wemos SAMD21 M0 Arduino M0 Compatible Board

An Arduino M0 compatible board called Wemos SAMD21 M0 is available from several online shops such as Banggood, AliExpress and Amazon, and also appears from several sellers on eBay. What appears to be the same board is also marketed as RobotDyn SAMD21M0. This blog post provides more information on the board.

An image of the Wemos SAMD21 M0 is shown below. As can be seen in the image, the Wemos logo appears on the board near the SAMD21G18A microcontroller chip. This board is not an exact copy or clone of the Arduino M0, but has a few differences such as the extra TXD and RXD pins found at the end of the board.

WeMos SAMD21 M0 Arduino M0 Compatible

WeMos SAMD21 M0 Arduino M0 Compatible

Wemos SAMD21 M0 Board Logo

Apparently this board is not actually made by the Wemos company, but the board is silk-screened with the Wemos logo. This has been mentioned on the Arduino forum in a few places. Here are a couple of examples:

Arduino forum message mentioning that the Wemos board does not appear on the official Wemos website.

An Arduino forum user mentions that Wemos does not admit the existence of this board.

Arduino M0 Compatible

The Wemos SAMD21 M0 board is compatible with the Arduino M0 which was originally from arduino.org when arduino.org and arduino.cc were having their fight. Now that the two companies have finished fighting and merged back together, the Arduino M0 board is listed on the arduino.cc website.

Circuit Diagram

I have not found a circuit diagram for the Wemos SAMD21 M0 after extensive searching. As the board is compatible with the Arduino M0, the Arduino M0 information page will be useful. A circuit diagram or schematic for the Arduino M0 can be found under the DOCUMENTATION tab on this page.

Wrong Information

On many of the sellers web pages for the Wemos SAMD21 M0, there is incorrect information about the board that describes it as an Arduino Zero or Arduino M0 Pro. The information also mentions that it has Atmel’s embedded debugger (EDBG) on the board – this is not true. Only the Genuino Zero and Arduino M0 Pro have the EDBG.

Older Boards

Some users of earlier boards complained about the power LED being too bright. There were also complaints about the board not working with the Arduino IDE. This has changed with the newer boards. I have not had these problems with boards ordered in 2018.

Hardware Differences

Although the Wemos SAMD21 M0 board is compatible with the Arduino M0, it is not a clone or exact copy of the Arduino M0, but rather a variant of it.

Two extra serial port pins can be seen at the end of the board. These pins are labeled TXD and RXD. The power supply looks different between the boards and some of the components such as LEDs are in slightly different locations on the boards.

Wemos SAMD21 M0 Quick Start Tutorial

A Wemos SAMD21 M0 quick start tutorial can be found on the Starting Electronics website. This tutorial shows how to install the programming tools to program the Arduino M0 and compatible boards in the Arduino IDE. It shows how to blink the on-board LED as a quick test to see that the board is working and then shows how to use the serial ports to communicate with the Arduino IDE Serial Monitor.

Go to the Wemos SAMD21 M0 tutorial →

Unpacking a Atmel SAM4N Xplained Pro Evaluation Board

The Atmel SAM4N Xplained Pro evaluation board contains a ATSAM4N16C microcontroller. The board itself is rather basic with only one user programmable LED and one user programmable push-button switch (the second switch is a reset switch). Pins of the microcontroller are available on headers on the board.

An on-board Embedded Debugger is included on the board, so that no external tools are required to program or debug the ATSAM4N16C.

The video below shows the evaluation board being unpacked.

Some features of the ATSAM4N16C microcontroller are:

  • ARM Cortex-M4 that can run up to 100MHz
  • 3 USARTs and 4 UARTS
  • Real Time Clock (RTC) with calendar and alarm features
  • 10 bit ADC and DAC
  • 1Mb Flash memory
  • 80kb SRAM
  • The usual SPI, TWI, timers, PWM, etc.

The ATSAM4N16C does not contain any USB ports, Ethernet or external bus.

Resources from Atmel

Large PLC – Open Source Hardware

The large brick-type open source PLC has 22 digital inputs, 6 analog inputs and 16 transistor outputs. It also features a SD card socket, 2 RS-232 ports, 1 RS-485 port, 1 USB device port and a JTAG port for programming and debugging.

Large Open Source PLC

Large Open Source PLC

All the source files including circuit diagrams for building the large open source PLC are available for download at the above link.

Small PLC – Open Source Hardware Project

This small brick-type PLC open source hardware project is based on an ARM7 microcontroller from Atmel. The PLC has 10 digital inputs, 8 digital outputs, 4 analog inputs, a real time clock, RS232 port, RS485 port, USB port and JTAG port.

More information and circuit diagrams are available at the above link.

Small Open Source PLC

Small Open Source PLC