Arduino DUE's ATSAM3X8EA direct to USB for uploading code in custom Board

Hello I am making a pretty ambitious project. I would like to design my own board. Looking at the arduino DUE seems to have eveything i need, and more that i dont need

What i only need from this chip is:

  • SPI

  • 40 GPIO pins

  • its faster clock compared to mega

I already have most of the power management circuit, protection circuit, and USB circuit from my previous project that was straight taken out from the Arduino Zero schematics. In this project i plan on just using the same circuit and just replacing the SAMD21. The SAMD21 was a bit more straight forward since it already has USB data pins, and since the zero uses those pins directly to the usb port, the IDE can straight up detect the board (after burning the bootloader)

I would like to know if the ATMEGA chip on the DUE's schematic can be remove and the usb be directly connected to the SAM3x chip for uploading code using Arduino IDE. I have read that this is possible, but they pretty much skipped the fact on how they did it, was as simple as connecting the lines or you have to tinker with some files in the IDE

I assume that as long as i give it the proper power of 3.3v ( and its accompanying capacitor passives) and a direct connection to the usb D+ D- . i can easily begin coding no problem

The DUE Core, a DUE compatible board, has all Sam3x pins broken out (including ethernet pins) plus an EEPROM:

These links might help you out (or not) if you want to make your own board:

https://forum.arduino.cc/index.php?topic=653352.msg4403504#msg4403504

Plus of course the DUE schematic available in the doc folder of the DUE product page, plus the DUE Core schematic available I don't remind where...

update after copying the scematics there is a D- and D+ port pin 38 (DHSDM) and pin 37 (DHSDM) apologies since Acrobat didnt find it in its image search. So the question now is what is the use of the ATMEGA16?

ard_newbie:
The DUE Core, a DUE compatible board, has all Sam3x pins broken out (including ethernet pins) plus an EEPROM:

Due Core - Arduino Compatible SAM3X8E 32bit ARM Cortex M3 Module

These links might help you out (or not) if you want to make your own board:

http://ww1.microchip.com/downloads/en/AppNotes/Atmel-42187-ATSAM3X-and-ATSAM3A-Series-Checklist_AP-Note_AT03462.pdf

http://ww1.microchip.com/downloads/en/AppNotes/Atmel-42141-SAM-AT02333-Safe-and-Secure-Bootloader-Implementation-for-SAM3-4_Application-Note.pdf

Simulating USB Firmware upload to Arduino DUE - #2 by ard_newbie - Project Guidance - Arduino Forum

Plus of course the DUE schematic available in the doc folder of the DUE product page, plus the DUE Core schematic available I don't remind where...

Thank you this really helps especially the checklist and the mention of the due core, i will try to look for its schematics

ard_newbie:
https://www.arduino.cc/en/Hacking/Upgrading16U2Due

Reading from the arduino due documentation in the store there is a way to upload codes using the direct line to the sam

Opening and closing the Native port at 1200bps triggers a 'soft erase' procedure: the flash memory is erased and the board is restarted with the bootloader. If the MCU crashed for some reason it is likely that the soft erase procedure won't work as this procedure happens entirely in software on the SAM3X. Opening and closing the native port at a different baudrate will not reset the SAM3X.

to upload using the native port that is directly connected to the chip, i need to open and close the native port at 1200bps, is this just an explination or is it telling me to find a way to do this via hardware?

Tha Native Port is a USB 2.0 peripheral, hence I doubt that 1200 bauds is meaningful. 1200 bauds is the baud rate to select when you choose to upload a binary file thru the UART.

Some pages of interest in Sam3x datasheet:

Sam3x datasheet pages 2 , 34, 308, 318, 322.

And these links:

https://forum.arduino.cc/index.php?topic=363603.0

This .pdf for Sam E7-V7-S7 might be more detailed than the one for Sam3-4:

http://ww1.microchip.com/downloads/en/AppNotes/Atmel-42725-Safe-and-Secure-Bootloader-for-SAM-V7-E7-S7-MCUs_AT16743_ApplicationNote.pdf

With the bossac.exe (free) software, you can upload a binary code (result of a compiled code....) either thru the Native or the Programming port from your PC.

https://forum.arduino.cc/index.php?topic=588934.0

To upload to the DUE a .bin file:

Firstly, push the Erase button for 3 seconds, then the Reset button for 3 seconds, then:

Thru the programming port:
AppData\Local\Arduino15\packages\arduino\tools\bossac\1.6.1-arduino\bossac.exe --port=COM9 -U true -e -w -u -b image.bin

Thru the Native USB port:
AppData\Local\Arduino15\packages\arduino\tools\bossac\1.6.1-arduino\bossac.exe -U true -e -w -u -b -R image.bin