ATSAM3X8E upon upload does not change BOSSA to ARduino DUE in device manager

Bringing up the topic again..

I have designed a custom ATSAM3x8E baord.

On Powering, The baord shows up in device manager as BOSSA PROGRAMMING PORT only after pressing both RESET & ERASE Button and removing the RESET button first.

Then I go to Arduino IDE, upload my program, all well. but hey!! now the program doesn't works.

I checked it out with a ready made Arduino Due. Found out that in this case the BOSSA PROGRAMMING PORT in device manager resets to ARDUINO DUE NATIVe PORT upon upload of codel

This behaviour does no thappen with mine custom ATSAM3x8E board. I think this is the reason my firmware never works( even LED blinking or Serial USB)

Please HELP !!!!

Guys please help.. I have tried a lot resolving it.

Thanks

Have you tried uploading the bin file using SAM-BA? I got this to work as per this thread:
http://forum.arduino.cc/index.php?topic=455702.0

I would have thought the IDE should work, when I eventually get my custom board I'll let you know :slight_smile:

Well, I have my custom board, I have exactly the same problem. SAM-BA doesn't make it work either :frowning:
Actually, my situation is slightly worse as it changes the device to a USB Composite Device which cannot start (code 10).

Have you loaded the due bootloader?

The Sam3x has a bootloader ROM. Note that there is no 16u2 on the custom board, Native USB only :slight_smile:

Yes, but I think the arduino has a separate bootloader, and sketches are compiled assuming that it is present...

Hmm, if that were the case, hitting the erase button on a real Due would cause similar issues. I admit, I have had issues with Dues and the native port, but it usually turns out to be a slightly defective cable or windows getting confused with drivers.
I shall have another play tomorrow :slight_smile:

Hello weird_dave,

As westfw mentioned, you are going to need the bootloader. Here a link of a bootloader that works with Arduino Due.

https://www.feaser.com/openblt/doku.php?id=homepage

Also, extra info (experimental SAM core) posted by Thibaut Viard-former Atmel team member during the Arduino Due development.

And indtructions/direction of the SAM-core:

-p

(after reading more in the datasheet, I am LESS confident that there is a "Due bootloader" that is needed. You will need Due-specific USB code in your sketch, even if it doesn't use USB communications (just to support the auto-reset function, I guess.) But that should happen with all of the normal Due board types...

Yeah, the Burn Bootloader functions says:
Please select a programmer from Tools->Programmer menu
but that doesn't make much sense for the sam3x.

I went back a step and uploaded a simple pin toggle program, this is actually running!
The same code on a Due still sets Bossa port until I hit the reset, then it turns into an Arduino. my board goes doesn't.

However, it seems I have missed off the Xtal caps. I will be adding some tomorrow if they arrive, I've also ordered a 'proper' oscillator to see if that's more reliable as well.

My board will need layout changes anyway as there was a terminal mistake made, 3v3 on VddCore does not a happy micro make! I've managed to bodge a lower core (on a 2nd board, I reckon the first might be fried) but the IO is now limited to the core V which just isn't practical and there is a 2nd bodge to get 3v3 on VddUTMI, the power plane is 3v3 and everything is via'd through to it, I'm using the BGA144 package so I can't even cut tracks and put mod wire down.

There is no bootloader required for the SAM3X8E to run as Arduino Due Native Port. It is downloaded automatically by the Arduino IDE with your Arduino sketch. The code is in the Arduino USB core.

Here is the rundown I posted a while back on the Adafruit forums:

No matter what may have been loaded by the Arduino IDE, bootloader or otherwise, it is all blown away upon ERASE. Also, this clears the GPNVM bit(s) which will result in the native port running in CDC mode provided you have an external oscillator on your prototype. SAM-BA in ROM is responsible for this, and it uses VID 03eb and PID 6124. The BOSSA drivers installed with the Arduino IDE recognize this combination, and allow the IDE to connect and download. When this happens, the Arduino IDE also installs its bootloader along with the sketch. This puts the native port in CDC mode with the Arduino Due VID and PID. From this point forward, subsequent downloads from the Arduino IDE invoke this bootloader and save the developer from needing to hit erase. However, if you do hit ERASE again, the whole process starts over, and again the USB port will be running in CDC mode with the BOSSA VID and PID.

Note that bungled up interrupts or a crashed sketch will stall the USB functionality downloaded with your sketch. So if you are having trouble, at least try a simple sketch.

weird_dave:
The same code on a Due still sets Bossa port until I hit the reset, then it turns into an Arduino. my board doesn't.

This has to do with the chipid reported by your processor. You can view the chipid using bossa
http://www.shumatech.com/web/products/bossa

If the chipid is not recognized by the bossa program, then you will get "Reset not supported by this CPU" after your sketch downloads (run the IDE in verbose mode). So you have to manually reset (or power cycle) after every download. That said, I am not sure why your chipid would not be the same as the DUE.

Thanks
Doug

Thanks Doug, that definitely clears up any doubts I had.
I suspect I have an issue with the Xtal, missing the shunt caps. They turned up last night so I will shortly be soldering some huge 0603 caps on (I wanted 0402!). I will also be testing an oscillator, I generally prefer them to Xtals anyway, but in my haste I just attempted to copy the relevant bits of the Due circuit.

Well, not really sure where to go from here. I added the shunt caps, no difference. I swapped the Xtal for an oscillator, no difference, however, comparing the hardware IDs:

Real Due:
USB\VID_2341&PID_003E&REV_0100&MI_00
USB\VID_2341&PID_003E&MI_00

My PCB:
USB\VID_2341&PID_003E&REV_0100
USB\VID_2341&PID_003E

The code I uploaded is identical:

const int TestPin = 2;

void setup() {
  pinMode(TestPin, OUTPUT);
}


void loop() {
  digitalWrite(TestPin, HIGH);
  delay(100);
  digitalWrite(TestPin, LOW);
  delay(100);
}

I don't understand why the IDs are different :frowning:

I found this thread:
http://forum.arduino.cc/index.php?topic=131100.0
which suggests appending the IDs in the .inf and reinstalling the drivers.
After much fiddling and going through the "Have Disk" procedure to install unsigned drivers, I finally have it recognising my board as an Arduino Due, however,

"This device cannot start. (Code 10)"

I'm lost as to where I can go with this now :frowning:

For reasons I won't go into, I just plugged an unmodified board (with 3v3 on vcore and other places it shouldn't be) and guess what, with my modified drivers, it seems happy! (a bit toasty though)

This doesn't explain why the modified board doesn't work. I lowered the voltage to 1.8 (the IO and other stuff should be fine with this) and just connected VDDUTMI to 3v3 (by removing the inductor and feeding 3v3 onto the inductor pad). I'm worried that if I simply correct the mistake on the circuit and modify the artwork, it's not going to work.

Any ideas?