[closed,answer inside]How to burn firmware for Nano every from bare PCBA board

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I want to make a PCBA based on Nano every(Arduino IDE can still identify it as Nano every).

I have studied the documentation :  https://www.arduino.cc/en/Guide/NANOEvery, but I'm still not sure how to finish it.

This is my understanding:

1)burn ATSAMD11D14A firmware; 

    /ArduinoCore-samd    sam_ba_Generic_D11D14AM_SAMD11D14AM.bin

    Arduino use this as the default firmware?

    Do we need to burn it before assmbled?

    Can we burn it after assembled? It said we can reprogramme through IDE, I did not understand what they wrote.

2)burn atmega4809 through Arduino IDE

    There is a menu named "Burn Bootloader" ,I think it is used to do that after select board & programmer.

    Which one is the version for nano every? ( ArduinoCore-avr/bootloaders/atmega8/ ATmegaBOOT-prod-firmware-2009-11-07.hex ?)

Anyone can explain in detail?

Thank you.

 

Last Edited: Mon. Jan 20, 2020 - 01:32 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Xiao wrote:
Arduino use this as the default firmware?
No; Arduino software from Arduino repositories.

Nano Every is stated in MuxTO.

Xiao wrote:
Can we burn it after assembled?
Yes

Xiao wrote:
Which one is the version for nano every?
The repository for unified-memory AVR.

https://github.com/arduino/ArduinoCore-megaavr#arduino-core-for-atmega4809-cpu

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The important thing is that you need to get the MuxTO firmware inside the SAMD11. This is what does the actual work of programming the mega4809. How you do it doesn't matter, either via bootloader or via a programmer.

 

Since MuxTO is an Arduino program, to compile it you need some type of Arduino framework that supports the SAMD11. This is where the unofficial support comes in as mentioned in the document on the Arduino site:

Since we don't ufficially support SAMD11 in our SAMD core, the core to be used is the awesome fork by MattairTech. Once you install it you'll be able to compile a basic firmware for MuxTO.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The actual SAMD11 firmware seems to include a bootloader as well as the MuxTO.   https://www.arduino.cc/en/Guide/NANOEvery#toc11

I assume that the bootloader is the mattairtech bootloader, but I don't see much.

You should be able to program the bootloader and/or the MuxTO firmware using an SWD debugger.  If you put only the bootloader in it, you should be able to upload MuxTO using the bootloader.

 

 

2)burn atmega4809 through Arduino IDE

    There is a menu named "Burn Bootloader" ,I think it is used to do that after select board & programmer.

    Which one is the version for nano every? ( ArduinoCore-avr/bootloaders/atmega8/ ATmegaBOOT-prod-firmware-2009-11-07.hex ?)

The 4809 Arduino boards don't use any bootloader; they all have the USB chip act as an UPDI programmer.

You may want a "burn bootloader" to make sure the fuses of the 4809 are set properly.  The "upload sketch" process sets some, but not all, of the fuses.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you,Tangas.

We have to programme the SAMD11 after assembled without huge amount.

 

The simplest and directive way is to burn with programmer, and I have the Atmel-ICE to try.

we should:

1)reseve the pins to connect Atmel-ICE for SAMD11 & ATMEGA4809;

2)make PCBA;

3)burn firmware for both.

 

For both chips provide UPDI, we can use it to programme: + /- / UPDI-avr / UPDI-D11 。

 

And get the firmware binary files:

1)MuxTO for D11.

use arduino IDE to create binary :  https://github.com/arduino/ArduinoCore-megaavr/tree/master/firmwares/MuxTO

Or just use this file: MuxTO.hex .

2)bootloader for 4809.

compile the boot.c to hex file:  https://github.com/arduino/ArduinoCore-megaavr/tree/master/bootloaders

Or use this file: atmega4809_uart_bl.hex

 

Is that right?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How to programme D11 through USB port?

 

The 4809 & D11 are all bare,no firmware to interact with host.

I don't know how can we programme the D11.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Xiao wrote:

How to programme D11 through USB port?

 

The 4809 & D11 are all bare,no firmware to interact with host.

I don't know how can we programme the D11.

 

From a bare SAMD11 chip, you can either (a) burn the bootloader using a hardware programmer and then subsequently upload sketches over USB, or (b) burn the sketch/program directly using a hardware programmer.

 

Unless you need to constantly upload new sketches, I would avoid using the bootloader.

 

Note that the Mattair bootloader takes 4K of the SAMD11's 16K flash, and may not have room for the MuxTO code (depending on which version of the Mattair core you are using).

 

I use a Segger J-link on my SAMD11 projects. Your board needs to expose the following SAMD11 pins for programming:  VDD, GND, SWDCLK (PA30), and SWDIO (PA31). Reset (PA28) doesn't seem to be required. You could use a 'proper' Cortex debug header (Samtech FTSH-105-01 5x2 0.05") but I usually use a standard 0.1" header and cables, as they're cheaper and more robust.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You make me chaos :)

I thought MuxTO.hex is the firmware of SAMD11 &  ATmegaBOOT-prod-firmware-2009-11-07.hex is the firmware of ATMEGA4809.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

According to your explain, the MuxTO.hex is the code to simulate USB function?

And the bootloader of SAMD11 is used to refresh MuxTO.hex?

If so, just burn MuxTO is enough indeed.

Do we need to configure the fuse? or leave them with default.

 

 

I did not notice the difference of bootloader & firmware before.

Bootloader is used to refresh firmware or application more easy.

Firmware is the application to realise functions.

Last Edited: Fri. Jan 17, 2020 - 07:02 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you guys,I nearly understand the concept and method to burn.

There is a last question to clarify , I hope someone can confirm for me.
I am not a hardware engineer, I don’t know if we can burn samd11 & atmega4809 without interfering each other based on current design of nano every?(Through UPDI)
Can samd11&4809 can share the vdd pin?acturally they’re different:3v/5v.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

I assume you are using the Nano Every schematic as the basis of your design ? https://content.arduino.cc/asset...

 

>> Can samd11&4809 can share the vdd pin?acturally they’re different:3v/5v

 

No. The power design is:

 

 - a buck regulator circuit around IC1, which steps down the input voltage to 5V

 - a USB connector which also provides 5V

 - a 3.3V regulator

 

The SAMD11 is powered from 3.3V

The 4809 is powered from 5V

 

 

There are voltage-level shift circuits between the SAMD11 and the 4809, on the RX0, TX0 and UPDI signals, using Q1 and Q2.

 

>> I don’t know if we can burn samd11 & atmega4809 without interfering each other based on current design of nano every?(Through UPDI)

 

Connector J2 is the SWD hardware programming interface for the SAMD11. You can use this to upload the MuxTo program. Or you could upload a bootloader and then use the USB connection to upload the MuxTO program. Your choice.

 

Once programmed, the SAMD11 then acts as a hardware programmer for the 4809.

 

It may be easier to imagine the SAMD11 as a completely separate circuit that just happens to be integrated on the same board as the 4809.

 

Make sense ?

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  1. Program SAMD11 bootloader using SWD debugger, test points, and AS7 or openocd or something.
  2. upload SAMD11 "firmware" over USB using Arduino IDE or bossac  https://www.arduino.cc/en/Guide/...
  3. Set initial ATmega4809 fuses, probably using IDE, but maybe avrdude directly.
  4. Upload ATmega4809 "sketches" using UPDI (via the Arduino IDE.)

 

All of those might be possible from within the Arduino IDE.

 

Note that on the Every, the SAMD11 performs TWO function - it is a UPDI programmer for uploading sketches to the 4809, AND it is a USB/Serial converter for providing serial connectivity from the 4809 to the host computer.
 

This does assume that you've done a full "clone" of the Every, rather than some modification.  You CAN replace the SAMD11 with a random USB/Serial converter, and use a serial bootloader in the 4809.
Optiboot was recently modified (well, more like re-written) to support 4809 and similar chips.  https://github.com/Optiboot/opti...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Arduino's mega4809 bootloader is from Microchip for Arduino Uno WiFi Rev2; its ESP32 has the UPDI signal though don't know if UPDI programming software exists for ESP32.

https://github.com/arduino/ArduinoCore-megaavr/blob/master/bootloaders/boot.c#L31

it's on sale :

ARDUINO UNO WiFi REV2

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Xiao wrote:
Can samd11&4809 can share the vdd pin?acturally they’re different:3v/5v.

 

They can, but you would need to run both at 3V, because 5V would burn the SAMD11. However, at 3V the mega4809 can only run at about half speed (10 MHz).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Acoording to the advices of obevel、westfw & Tangas,

I think it is better to provide independent UPDI programme interface for SAMD11 & 4809 if we want to make a mass of PCBA, 

For we can burn the MuxTO & bootloader through UPDI faster.

 

  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:

  1. Program SAMD11 bootloader using SWD debugger, test points, and AS7 or openocd or something.
  2. upload SAMD11 "firmware" over USB using Arduino IDE or bossac  https://www.arduino.cc/en/Guide/...
  3. Set initial ATmega4809 fuses, probably using IDE, but maybe avrdude directly.
  4. Upload ATmega4809 "sketches" using UPDI (via the Arduino IDE.)

 

All of those might be possible from within the Arduino IDE.

 

Note that on the Every, the SAMD11 performs TWO function - it is a UPDI programmer for uploading sketches to the 4809, AND it is a USB/Serial converter for providing serial connectivity from the 4809 to the host computer.
 

This does assume that you've done a full "clone" of the Every, rather than some modification.  You CAN replace the SAMD11 with a random USB/Serial converter, and use a serial bootloader in the 4809.
Optiboot was recently modified (well, more like re-written) to support 4809 and similar chips.  https://github.com/Optiboot/opti...

 

You clarified my questions quiet clearly, you should post earlier:) 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes,I get it,thank you!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For the benefit of future searchers, here's the quick route to burning the MuxTO code onto a SAMD11 (on Linux):

 

1. install the Mattair core for the D11

a. in the Arduino IDE Preferences dialog, add an Additional Boards Manager URL: https://www.mattairtech.com/soft...

b. in the Arduino IDE Boards Manager, install "MattairTech SAM D|L|C core for Arduino - Beta build" version 1.6.18-beta-b1

2. download the bootloader binary: https://github.com/arduino/Ardui...

3. burn the bootloader to the D11 using your preferred hardware programmer, e.g. a J-Link

4. you should now see a new USB device (lsusb displays "Bus 002 Device 013: ID 2341:5058 Arduino SA", macOS displays "MuxTO BL")

5. using the Arduino IDE Boards Manager, install the MegaAVR board support package

6. use the bossac command line to upload the MuxTO binary:

~/.arduino15/packages/MattairTech_Arduino/tools/bossac/1.7.0-mattairtech-3/bossac -i -d --port=ttyACM0 -U true -i -e -w -v ~/.arduino15/packages/arduino/hardware/megaavr/1.8.5/firmwares/MuxTO
 

You can build both components from source but you'll have to patch the Mattair source with the many Arduino changes: https://github.com/arduino/Ardui...

 

To upload a sketch to e.g. a 4809:

 

1. wire up the SAMD11 board to the 4809 board (TX, RX and UPDI, GND and maybe +V)

2. in the Arduino IDE, select:

Tools->Board->Arduino Nano Every

Tools->Port->/dev/ttyACM0 (Arduino Nano Every)