Go Down

Topic: Arduino Zero Standalone board - Serial communication issue (Read 3414 times) previous topic - next topic

dmreis

Hi,

I bought a ATSAMD21G18A chip and soldered it in a breadboard to make my Arduino Zero standalone. Then I made the circuit and burned the arduino zero bootloader using ATMEL-ICE and ATMEL Studio 7 successfully.
Now I'm facing two issues.

1) Burning the Adafruit Feather bootloader, I'm able to upload the arduino code using Arduino IDE. After uploading the sketch, the board is not recognized by Windows nor Arduino IDE anymore, and I'm not able to communicate my board with the PC.
To establish the communication again, I need to load the bootloader again using Atmel Studio, but doing this, the arduino sketch is erased and I need to upload the sketch again, falling in the same problem.
My initial guess was that the program was overwriting the bootloader, but I read the ATSAMD21 memory using AS7 right after burning the bootloader, and after uploading the arduino sketch, and the bootloader section is not being overwrited, so I have no idea what is happening.


2) Also, if I burn the zero bootloader, When I connect the USB cable to PC, I get an "Unrecognized Device" from Windows, and I'm not able to select the COM Port in Arduino IDE. I already tried to upload the program in Arduino IDE even with no port selected, but I always got the message that no board was identified. I also tried to press reset button twice to get in or out of bootloader mode, but nothing happens.

I'm stuck in this problem for a long time, any help would be appreciated.

Thanks in advance,
Daniel Reis

AloyseTech

Hi,

Could you please share your hardware design? This is necessary to ensure it not an hardware related issue.

Thanks :)

choncba

Hi, I'm working with a ATSAMW25 module on a custom board, the same as used in the MKR1000, this module include the ATSAMD21G18A too.
I don't have an Atmel ICE programmer, so I'm using OpenOCD installed in a Raspberry Pi 2 and use them with the GPIO from the raspi to load the bootloader in the ATSAMW25 with no problems.
In my case, I use the MKR1000 bootloader (from .bin file), (I don't try the Adafruit Feather bootloader).
But, same as you, I get "Unrecognized Device" when connect to PC.
Could be a problem with the USB ID PIN? Can't find anything about this in the board definition file.

Regards.-

dmreis

Hi Aloyse,

Attached you have the hardware design.

choncba

Hi dmreis, looks that you have a RESET problem, you need to pull-up the Reset pin to VDD with a 10K resistor, watch for example https://www.arduino.cc/en/uploads/Main/MKR1000-schematic.pdf

Regards.

choncba

I check again in W10, and I get "unrecognized device" (descriptor request error), I add a 330 ohm resistor to gnd in P11 pin too, just like the MKR1000 schematic, but without usb ID pin.

dmreis

Hi choncba, thanks for your input.

We already tried to pull up the reset pin, but it didn't solve the problem.

dlabun

Just from personal experience, the unknown USB error messages always meant the bootloader was corrupt or I didn't configure a clock properly. It may be worth verifying the bootloader is working correctly.

AloyseTech

Are you sure the code is correctly uploaded using the Arduino IDE?
Like dlabun, I suspect a clocking issue( USB needs very tight timing)

choncba

I opened an issue about it https://github.com/arduino/ArduinoCore-samd/issues/218
I'm going to try what they recommended (possible BUG in OpenOCD) and then report the results.
Anyway, if dmreis has the same problem using the Atmel-ICE, surely there is some additional configuration that should be done to the clock of the factory chips.

AloyseTech

If you burn the latest bootloader binary and use the Arduino IDE with the latest samd core, I see no software reason for bad clock configuration, if the hardware is correct of course...

dmreis

First of all, thanks everyone for your help, I really appreciate it.

Are you sure the code is correctly uploaded using the Arduino IDE?
Like dlabun, I suspect a clocking issue( USB needs very tight timing)
When you say that it can be a clocking issue, is there anyway to deep check/test this? Or is there something I can do to eliminate this possible issue?
Yes, I'm uploading the code correctly using the Arduino IDE.

Trying to clarify how the issue is happening and to check if I'm doing something wrong, I'm attaching some print screens of the whole process I'm doing:
1) Burning the Adafruit Feather M0 Bootloader* using Atmel Studio 7 succesfully
2) Windows recognizes the board
3) Sketch succesfully uploaded using Arduino IDE
4) Right after step 3, Windows stops recognizing the board, and Arduino IDE don't find any board in any COM Port
5) The only way to 'recover' the Serial communication is burning the bootloader again using ATMEL Studio (Step 1)

- I'm also attaching the bootloader parameters (fuses) and
- Memory export right after Step 1
- Memory export right after Step 3
- Log from Arduino IDE during the sketch upload

From the memory export is possible to see that the bootloader occupies from address 0 until address 405, and the bootloader reserved space is until address 512.
In memory export after step 1, we have nothing in memory after the bootloader, and in memory export after step 3 we have the uploaded sketch from addresses 513 to 1080.


*I'm burning Adafruit Feather M0 Bootloader instead of Arduino Zero because when I burn the Arduino Zero bootloader, Windows does not recognize the board and I'm not able to upload a sketch using Arduino IDE.

AloyseTech

Please change the following fuses using Atmel Studio, then power cycle your board and reburn the bootloader (.cc one at first, other if this doesn't work).
USER_WORD_0 => 0xD9FEC7FF
USER_WORD_1 => 0xFFFFFE5D

Let me know if this works :)

dmreis

Aloyse,
Thanks for your reply. I'm traveling today so I'll test this tomorrow and will post here the result.
Hope it works!!!  :)

AloyseTech


Go Up