Newbie Questions

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all, sorry for these beginner questions, but this is my first foray into a few new things and I'm having a surprisingly hard time finding good documentation for how to get started.

 

I am working on a project where I would like to use 802.15.4 integrated into a microcontroller, and the ATSAMR21E18A seems to fit the bill nicely. It has, however, been quite some time since I used an atmel part and none of them ARM cores.

 

I purchased the SAMR21 Xplained Pro, so I have one on hand to work with. It seems that it is programmed by using a second chip, the EDBG, which is attached to one of the two USB ports. Then I program the SAMR21 through that EDBG chip USB port. What I am failing to find any information about is how to do this when I move it into my custom board. The EDBG chip is unfindable on the website, is it even possible to purchase it? Is it no longer possible to purchase a ISP programmer and simply attach it to a header on the board? Can I program the chip directly through it's hardware USB port and bypass the debugger for normal firmware uploading? Can I program it over the wireless interface and do OTA updates?

 

I'm really surprised how hard I'm finding it to get clear answers to these, I do apologize for asking what seem like easy questions.

 

I also noticed that some folks on the forum referenced the Genuino Zero, which seems to have a similar chip (presumably without wireless). But they seem to have gotten a hold of the EDBG chip, so it seems to be just a second example of the same technique as the SAMR21 Xplained Pro. What is best practice if I want to develop future small-run boards based on this chip?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It would be helpful if you could give some info on your background - so we know what level to pitch answers!

It would also be helpful to give the thread a more descriptive title than just "newbie question".

 

neltnerb wrote:
It seems that it is programmed by using a second chip, the EDBG

Yes. The EDBG is, effectively, an Atmel-ICE mounted on the board - so it saves you having to separately buy, configure and connect an Atmel-ICE.

 

neltnerb wrote:
The EDBG chip is unfindable on the website, is it even possible to purchase it?

No.

For a custom board, you would need to obtain a separate debugger/programmer - such as an Atmel-ICE or Segger J-Link

ATMEL-ICE Basic Kit with USB/IDC Cable, ATATMEL-ICE-BASIC SEGGER J-Link BASE Debugging Emulator for use with Flash microcontrollers

 

The programming and debugging is done via the standard ARM SWD interface.

 

Look at section 34, "Application Schematic" in the datasheet.

Also section 45.7, "Programming and Debug Ports"

 

http://ww1.microchip.com/downloads/en/DeviceDoc/SAM-R21_Datasheet.pdf

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

neltnerb wrote:

The EDBG chip is unfindable on the website, is it even possible to purchase it?

awneil wrote:
No.

See: https://www.avrfreaks.net/comment...

 

EDIT

 

FYI -  EDBG User Guide: http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42096-Microcontrollers-Embedded-Debugger_User-Guide.pdf

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. Feb 21, 2018 - 10:23 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Many ARM chips come with a pre-programmed Bootloader.   It does not look as if the SAMD21 has a factory Bootloader.   You will have to check your SAMR datasheet.

Regarding programmers.    A $3 STLINK dongle should be able to program your SAMR via SWD but only if your IDE provides software support e.g. Keil or Rowley.

Microchip/Atmel only support their own ARM chips and programmers in Atmel Studio.

Untested.   I might try using an STLINK with the SAM3X chip in an Arduino Due (instead of ATMEL-ICE)

 

The simple answer is.    Develop your SAMR programs with the XPRO kit.   Atmel Studio will provide Start examples and support debugging.

Production programming can be done with a standard SWD debugger.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
  It does not look as if the SAMD21 has a factory Bootloader.  

It doesn't.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
Microchip/Atmel only support their own ARM chips and programmers in Atmel Studio

Atmel Studio does also support the Segger J-Link.

 

And Segger have firmware to convert an EDBG to a J-Link: https://www.segger.com/products/debug-probes/j-link/models/other-j-links/j-link-edbg/

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

neltnerb wrote:
Genuino Zero, which seems to have a similar chip (presumably without wireless). 

It's a SAM D21.

 

The SAMR21 is just a SAMD21 chip and an AT86RF233 chip together in a single package: https://community.atmel.com/comm...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is an alternative way to program and update Arduino remotely which perhaps can be a valuable for some.

 

You can wire an ESP32-based board or module to your Arduino, and use https://vcon.io for a remote Arduino OTA update.

VCON firmware can act as an AVR (and not just AVR) programmer, and reflash the Arduino remotely.

 

Also you the get remote control capability for your Arduino. https://dash.vcon.io cloud service 

gives you device dashboard and an API for remote control and OTA.

 

Disclaimer: I do represent vcon.io.