Getting started with SAM4S-EK2  - Page 1
Forum section: electronics / general

author: CM800
author_rank: Frequent Contributor
timestamp: May 19, 2015, 07:16:12 pm
content: I recently brought this:http://uk.farnell.com/atmel/atsam4s-ek2/eval-sam4s8-sam4s16-cortex-m4/dp/2215340I 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!

author: andersm
author_rank: Super Contributor
timestamp: May 19, 2015, 07:29:56 pm
content: Looking at thedemo release notesit 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.

author: CM800
author_rank: Frequent Contributor
timestamp: May 19, 2015, 07:46:56 pm
content: Quote from: andersm on May 19, 2015, 07:29:56 pmThanks 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?

author: andersm
author_rank: Super Contributor
timestamp: May 19, 2015, 07:58:21 pm
content: 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.

author: ataradov
author_rank: Super Contributor
timestamp: May 19, 2015, 08:01:13 pm
content: 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 chiphttps://github.com/ataradov/embedded/tree/master/sam-ba.

author: Asmyldof
author_rank: Regular Contributor
timestamp: May 20, 2015, 12:36:20 am
content: 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.

author: andersm
author_rank: Super Contributor
timestamp: May 20, 2015, 04:30:00 am
content: Quote from: Asmyldof on May 20, 2015, 12:36:20 amSAM-ICEis a different device from theAtmel-ICE.

author: CM800
author_rank: Frequent Contributor
timestamp: May 21, 2015, 05:07:26 pm
content: 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.

author: Asmyldof
author_rank: Regular Contributor
timestamp: May 21, 2015, 06:54:48 pm
content: Quote from: andersm on May 20, 2015, 04:30:00 amWhen 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.

author: andersm
author_rank: Super Contributor
timestamp: May 24, 2015, 09:35:19 pm
content: Quote from: Asmyldof on May 21, 2015, 06:54:48 pmYou 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.

author: Asmyldof
author_rank: Regular Contributor
timestamp: May 24, 2015, 11:44:48 pm
content: 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 client2- 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 OSI 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 :-)