EEVblog Electronics Community Forum

Electronics => Microcontrollers & FPGAs => Topic started by: CM800 on May 20, 2015, 05:16:12 am

Title: Getting started with SAM4S-EK2
Post by: CM800 on May 20, 2015, 05:16:12 am
I recently brought this:

http://uk.farnell.com/atmel/atsam4s-ek2/eval-sam4s8-sam4s16-cortex-m4/dp/2215340 (http://uk.farnell.com/atmel/atsam4s-ek2/eval-sam4s8-sam4s16-cortex-m4/dp/2215340)


I only just figured out I have no clue how to get started or programming it...


Do I need this JTAG programmer as well? I was thinking that it could be programmed through the USB plug however it seems to just act like a memory stick as of now.


Does anyone have any ideas on how I can get started and begin to make things?

Thanks!
Title: Re: Getting started with SAM4S-EK2
Post by: andersm on May 20, 2015, 05:29:56 am
Looking at the demo release notes (http://www.atmel.com/Images/SAM4S_EK2_demo_release_note.txt) it seems you can program it without external tools. The chip also has a ROM bootloader on the UART port (see section 6 of the kit's user guide). For debugging you'll still want a JTAG interface.
Title: Re: Getting started with SAM4S-EK2
Post by: CM800 on May 20, 2015, 05:46:56 am
Looking at the demo release notes (http://www.atmel.com/Images/SAM4S_EK2_demo_release_note.txt) it seems you can program it without external tools. The chip also has a ROM bootloader on the UART port (see section 6 of the kit's user guide). For debugging you'll still want a JTAG interface.

Thanks for that information.

What is the best JTAG connector / tool to get? and are they all the same? I mean, could I use the JTAG tool for FPGAs as well or is it locked to a specific product?
Title: Re: Getting started with SAM4S-EK2
Post by: andersm on May 20, 2015, 05:58:21 am
Tools usually only support a small number of interfaces, and there's manufacturer-specific pinouts etc. JLink is almost the industry-standard for ARM microcontroller development. If you're going to stick with Atmel, you might want to check out their Atmel-ICE which is pretty cheap.
Title: Re: Getting started with SAM4S-EK2
Post by: ataradov on May 20, 2015, 06:01:13 am
SAM-ICE will be the most supported and easiest to use. But virtually any Segger j-link product should work. Atmel-ICE may be a cheaper option, but you will have to make an adapter cable or use a squid cable, which is painful really.

You can program the board without the programmer using SAM-BA in the ROM, but there is no way to debug your program this way. I have a command line script that can be used for programming the chip https://github.com/ataradov/embedded/tree/master/sam-ba .
Title: Re: Getting started with SAM4S-EK2
Post by: Asmyldof on May 20, 2015, 10:36:20 am
Atmel's SAM-ICE will plug right into the JTAG header, no conversions needed at all. The J-Link universal JTAG will also work, but is much more expensive.

The SAM-ICE is in fact just a J-Link universal device, but locked to just linking and emulating Atmel chips, to allow a lower product price under contract. That's why they also say "J-Link" or "Powered by J-Link".

So whether you want the universal or the Atmel one is mainly down to: Will you possibly or probably also want to sample other brand ARMs in the near future?

On the other hand "If you want to debug, you want a JTAG" is simplified. You can also very comfortably use the Serial connector to pump out std-err, std-out, etc and read those with a terminal program, in effect letting you debug your code just like you'd debug test code on your computer. A very common and doable practise for many low-budget projects, with the added benefit that such constructs will allow you to keep the debugging option in anything you build upon it, wherever it is in the world without that location also needing any special hardware.
If you want to be able to dig into pin-states, add break-points, inspect registers and such without actually modifying your code, THEN you need a JTAG device.

The chip itself has a factory set bootloader section that allows connecting through the first serial hardware block (true for most, if not all larger SAMs) - usually UART0, or an internal USB to be used with a program called SAMBA, which can be downloaded for free from the Atmel website.
Title: Re: Getting started with SAM4S-EK2
Post by: andersm on May 20, 2015, 02:30:00 pm
The SAM-ICE is in fact just a J-Link universal device, but locked to just linking and emulating Atmel chips, to allow a lower product price under contract. That's why they also say "J-Link" or "Powered by J-Link".
SAM-ICE (http://www.atmel.com/tools/atmelsam-ice.aspx) is a different device from the Atmel-ICE (http://www.atmel.com/tools/atatmel-ice.aspx).
Title: Re: Getting started with SAM4S-EK2
Post by: CM800 on May 22, 2015, 03:07:26 am
Thank you for all your feedback.

I am very much trying to get into the whole area, expanding beyond arduino and I am unsure as how to proceed. As I do not have much experience with micro controllers I need to get going in a fairly simple way (not over complicated) before I move onto attempting more complex things and more error prone methods.
Title: Re: Getting started with SAM4S-EK2
Post by: Asmyldof on May 22, 2015, 04:54:48 am
The SAM-ICE is in fact just a J-Link universal device, but locked to just linking and emulating Atmel chips, to allow a lower product price under contract. That's why they also say "J-Link" or "Powered by J-Link".
SAM-ICE (http://www.atmel.com/tools/atmelsam-ice.aspx) is a different device from the Atmel-ICE (http://www.atmel.com/tools/atatmel-ice.aspx).
When did I speak about Atmel-ICE? I was talking about Atmel SAM-ICE, maybe your eyes accidentally skipped the SAM part?
The SAM-ICE is licensed to Atmel AFAIK, so I feel legitimised in writing Atmel SAM-ICE.
I'm just missing your point, but that might be entirely my problem? Maybe I should stop working and go eat, could help.
Title: Re: Getting started with SAM4S-EK2
Post by: andersm on May 25, 2015, 07:35:19 am
When did I speak about Atmel-ICE?
You didn't. I somehow completely missed ataradov's post and thought you were commenting on mine. The names of all these interfaces are so similar that people sometimes get them mixed up.

IMO if you're going to spend the money on a J-Link, it's worth paying the extra for the full version and not be tied down to a single chip vendor or toolchain.
Title: Re: Getting started with SAM4S-EK2
Post by: Asmyldof on May 25, 2015, 09:44:48 am
That depends on the work you are doing.

I have never tried a real J-Link with Atmel Studio, but I expect that should work.
As most of my contract work centers around either:
1- Chips & Tools supplied by the client
2- Atmels, because the thing needs to be done quickly and I stock a very great variety of them.
3- Non-Atmel, but running vendor supplied OS
I own an AVR-ICE, SAM-ICE and Dragon. The linux systems never really required a JTAG/ICE interface up to this point and, well, all those other tools aren't ever mine :-)