Pages: [1]   Go Down
Author Topic: Why not use on-chip USB bootloader?  (Read 1154 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I do understand that the ATMEGA16U2-MU on Due is used to provide USB-JTAG support for the ATSAM3X8EA but what if we do not need JTAG/Debug support? Instead, I would like to just flash the sketch to ATSAM. Can't we just use ATSAM's onchip USB bootloader? If yes, where do I start?

Thanks
uCFreak
Logged

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2066
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would start reading datasheet, whether such option is even available with the chip..
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would start reading datasheet, whether such option is even available with the chip..

Pito,
The ATSAM3S series datasheet states "16 Kbytes ROM with embedded bootloader routines (UART, USB) and IAP routines". The SAM3S series chipsets do support UART and USB bootloading, it's just a matter of supporting this bootloader in the Arduino IDE.

I have worked with uCs for quite a while but I am new to Arduino, can someone please point me in the right direction?

Thanks
uCFreak
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8474
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The 16U2 has nothing to do with JTAG, it's simply a USB to Serial converter that connects to the inbuilt UART bootloader with the added function of "pressing" the Erase button for you.

You can still use the USB bootloader but you will have to manually press the erase button.

If you look in the Tools>Board menu you'll see options for both.

So, I haven't done it but AFAIK you press "Erase" then download from the IDE to the "Native USB port".

_____
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can still use the USB bootloader but you will have to manually press the erase button.
_____
Rob

Hi Rob,
Thanks for the reply, it helped. I looked into the schematics and it looks like the ATMEGA16U2-MU is used to assert NRSTB which is the Asynchronous Microcontroller Reset (equivalent to power-on reset). The ATSAM3X8 USB/UART bootloader starts at 0x00 which means that the controller enters bootloader after power-up and switches either to SAM-BA monitor or user application depending on conditions described in "SAM3X/A Boot Program" section of the datasheet.

Thanks
uCFreak
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8474
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

AFAIK despite being connected to NRSTB it never actually controls that pin, I think someone removed the series resistor and it made no difference and in the 16U2 code there is a note to that effect as well.

It does however control the erase signal.

Quote
switches either to SAM-BA monitor or user application depending on conditions described in "SAM3X/A Boot Program" section of the datasheet.
The main condition is I think the presence or not of any user code, hence asserting the erase before loading a new program.


_____
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Pages: [1]   Go Up
Jump to: