Go Down

Topic: Programming Custom SAMD21 board through Native USB (Read 2443 times) previous topic - next topic

halfroboprince

Jun 11, 2019, 12:46 pm Last Edit: Jun 11, 2019, 12:50 pm by halfroboprince
Hello to the community,

I have built a custom board based on Arduino Zero (using same MCU SAMD21G18A). I am able to program the board using the J-Link Edu debugger and using Atmel Studio 7. However, My aim is to do the programming using Arduino IDE and Native USB port and bootloader (do not want to use debugger and EDBG chip). I read other similar questions but couldn't solve the problem.

Here is what I did:

1. Open Atmel Studio 7 and choose device programming. Got the correct device signature and voltage=3.2v (I don't get 3.3V but should be fine I guess)

2. Download this bootloader: https://github.com/arduino/ArduinoCore-samd/blob/master/bootloaders/zero/samd21_sam_ba.bin

3. Changed the BOOTPROT fuse to 0x07 so that I can program the bootloader.

4. Programmed the bootloader and changed the fuse to 0x02.

5. Not I connect the USB_P and USB_N of SAMD21 directly to the D+ and D- of micro USB port and GND is common.

6. Let the Vbus and Id pin not connected. I am powering the MCU separately through the FTDI chip from the laptop.

7. Connected the micro USB to the laptop.

8. Now the Windows 10 OS says not able to identify the USB device. No port is coming in the device manager.

Is there something I am missing? I will be very thankful if anyone can help me out.


These are the things which I feel could be the issue:
1. My reset is pulled up but I do not use any button to connect it to ground.

2. I read this this in the arduino-core github: SAM_BA_BOTH_INTERFACES for enabling both USB and USART interfaces.

I am not sure if the bootloader I am using has enabled both interfaces.

Thank you. I will be happy to answer any other queries.

westfw

Try using the bootloader from one of the SAMD21 boards that doesn't have an EDBG interface, like the mkrzero or M0:
.../zero/samd21_sam_ba_genuino.bin
.../mkrzero/samd21_sam_ba_arduino_mkrzero.bin

halfroboprince

Thank you for the response! I tried both the bootloaders without the EDBG, but sadly same results.
Could reset be the issue? Do I need to pull it up externally through a resistor?

Rudeldi

#3
Jun 25, 2019, 04:15 pm Last Edit: Jun 25, 2019, 04:17 pm by Rudeldi Reason: picture wasn't there
Do you have some schematics of your board?
On the reset should be a 10k pullup resistor.
Like the MKR Zero:

Go Up