Serial Downloading

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

AVR datasheets include Serial Downloading section that define a way to reprogram flash/EEPROM/fuses. Is there something similar for SAMD's?

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

Not quite sure what you mean?

 

Are you talking about the ISP (In-System Programming) on the AVRs?

If so, that's done via the SWD on SAMD.

 

 

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

Yes, I meant SWD. In SAMD's datasheets I see only "SWD Timing" and not much else.

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

So the answer to your question is, "yes".

 

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

Yes what? That there is a way to reprogram flash over SWD? I knew that. I need details as to do that, exactly. I.e., I need something similar to "Serial Programming Instruction Set" from AVR datasheets.

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

ezharkov wrote:
Yes what?

Yes to the question you asked in your opening post:

 

you wrote:
AVR datasheets include Serial Downloading section that define a way to reprogram flash/EEPROM/fuses. Is there something similar for SAMD's?

The answer to that is: "Yes - SWD in SAMD is the equivalent of ISP in AVR".

 

 

 I need details as to do that, exactly.

Ah - well that wasn't what you asked.

 

 I need something similar to "Serial Programming Instruction Set" from AVR datasheets.

I'm not sure that it's published?

 

But why do you need it?

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

Sorry, my question was not very clear. I need it because I want to develop my own flash programmer with an RS232 interface. An off-the-shelf third party programmer would do it too, I guess (provided that it has an RS232 interface, a documented comm protocol, and reasonably priced).
(I know, the next question is why it has to be RS232. I don't want to go there. Just because.)

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

Why not just use a conventional bootloader?

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

I need this for initial programming, not for field updates. The initial programming is done in a test fixture that doesn't have USB.

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

If I understand it correctly SWD as such is something that came from ARM, not Atmel/Microchip.

 

Have you had a look over at the ARM web site?

 

Also, isn't SAM-BA a bootloader that will do serial?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

JohanEkdahl wrote:
SWD as such is something that came from ARM, not Atmel/Microchip.

But, AIUI, the programming of Flash is proprietary - so that bit does come from Atmochip.

 

Also, isn't SAM-BA a bootloader that will do serial?

(S)He said (s)he doesn't want a bootloader - and (some) SAM Ds don't come factory-fitted with a bootloader.

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

ezharkov wrote:
The initial programming is done in a test fixture that doesn't have USB

Eh?

 

Surely, the test fixture just brings out the SWD connections, and you connect a suitable programmer to that?

 

 

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

"you connect a suitable programmer" - we are running in circles already. That is basically what I want. The problem is that I do not have "a suitable" programmer (with RS232 and a documented protocol (see #7)).

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

ezharkov wrote:
a suitable programmer

So - Atmel ICE; Segger J-Link; etc, etc.

 

Any competent manufacturer should have the wherewithal to program chips!

 

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

OK, I think I'm starting to get it. There is no special "Serial Programming Instruction set" like AVR ISP. And there is no need for it. You just use SWD to access the whole SAMD address space, which includes NVMCTRL ...

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

ezharkov wrote:
OK, I think I'm starting to get it. There is no special "Serial Programming Instruction set" like AVR ISP. And there is no need for it. You just use SWD to access the whole SAMD address space, which includes NVMCTRL ...

As Awneil and Johan have already explained clearly, SWD is the goto method to program Arm Cortex-M microcontrollers. You can also use JTAG but you probably don't want to use too many pins.

 

If you order an Atmel-ICE or J-Link then it would work seamlessly with Atmel Studio IDE. It will be easy to debug, use breakpoints, etc. Alternate and imho, a temporary solution would be use a Raspberry PI or a Beagle Bone and it's GPIO pins to program your SAMD microcontroller using OpenOCD. You'll need to familiarize yourself with GDB in case you aren't familiar with it.

 

Here is a link to using OpenOCD on RPi or BBB: https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi/overview 

 

Regards,

Jenson

Newbie to the world of Atmel SAM D microcontrollers.

Last Edited: Thu. Dec 14, 2017 - 04:41 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the feedback, guys. Let me summarize/clarify a few things.
- I know what Atmel-ICE is; I have a bunch of them
- I cannot use it in this particular case because my fixture doesn't have USB
- I thought about the Pi, in a (rather distant) past, when it became impossible to get AVRISP mk1 or compatibles
- But back then decided to do my own programmer for Megas and Tinys
- Later I went the same route with Xmegas
- Now that I needed to program SAMDs, it seemed natural for me to do the same thing again (i.e., program them using my own programmer)
- But I couldn't find that missing piece of how to use the standard ARM's SWD to program proprietary Atmel's flash
- Now that I understand how this is done, that is probably the route that I'm taking
- Speaking of OpenOCD, I see that they have an at91samd.c driver; that is good, I can use it as an example; because for some reason Atmel doesn't have any examples, unlike other vendors