Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: NEWBIE - How to get started on AT91SAM7S
PostPosted: Sat Sep 12, 2009 8:40 am 
Offline

Joined: Sat Sep 12, 2009 8:16 am
Posts: 2
Hi
Newbie to ARM and first post, so go easy on me!

I've got a project where I was originally going to use a PIC32 processor, but I'm seriously considering moving to the AT91SAM7S256 instead to give my project more street cred with an ARM :->

I have extensive experience with PIC and a bit with 8bit AVR's and others, but have not used ARM before.
I've gotta admit, the ARM solutions look endless and complex compared with my existing PIC solution and I don't really know where to start.
Initial questions that come to mind that I can't really find easy answers for are:

1) What is the best and simplest (Windows) C toolchain and environment to use?
I'm aware of GNU GCC and want to use it, but I really have no idea how to go about it. I tried it once for the 8bit AVR's and it was a horrible experience, I just wasn't software geeky enough to get it to compile anything.
I know that GCC is just a command line thing and you need a shell to go around that to use it.
I just want a toolchain environment I can download as a complete package, install, and write a simple hello world on my LCD and get going without having to muck around with anything technical, edit scripts, command line stuff etc. I'm a hardware guy who can program in plain vanilla C, not a computer science software guy who writes linux scripts in his sleep.
I kinda need to use GCC because I'll be releasing my code to the community and want them to develop upon it, so I figure that's the best solution.
A free solution is best of course.

2) What JTAG programmer hardware is best?
Presumably it would be tied into my first question, with some environments only supporting some JTAG programmers?
And does this JTAG programmer allow simple debugging?
The lower the cost the better, I'm used to my PICkit2 programmer doing everything for $30.

3) Does the GCC or other compiler come with headers/libraries/examples etc for the AT91SAM7S256 device I'm interested in?
I don't want to spend a week figuring out how to write to an I/O port or register etc. I'm so used to just having my PIC GCC compiler automatically define every register as stated in the datasheet (e.g. PORTA=0;), I'd love to be able to do the same thing with the ARM without any hassles (e.g. for the clock register CKGR_MOR=0;).

Any help appreciated.

Thanks
Dave.


Top
 Profile  
 
 Post subject: Re: NEWBIE - How to get started on AT91SAM7S
PostPosted: Sat Sep 12, 2009 11:26 am 
Offline

Joined: Thu Dec 02, 2004 2:28 pm
Posts: 454
altzone wrote:
1) What is the best and simplest (Windows) C toolchain and environment to use?
I'm aware of GNU GCC and want to use it, but I really have no idea how to go about it. I tried it once for the 8bit AVR's and it was a horrible experience, I just wasn't software geeky enough to get it to compile anything.
I know that GCC is just a command line thing and you need a shell to go around that to use it.
I just want a toolchain environment I can download as a complete package, install, and write a simple hello world on my LCD and get going without having to muck around with anything technical, edit scripts, command line stuff etc. I'm a hardware guy who can program in plain vanilla C, not a computer science software guy who writes linux scripts in his sleep.
I kinda need to use GCC because I'll be releasing my code to the community and want them to develop upon it, so I figure that's the best solution.
A free solution is best of course.

there are several packages available based on gcc and eclipse, but from my point of view most of them are not really updated on a regular base.
a good starting point should be yagarto:
http://www.yagarto.de
there is also a tutorial available from James P. Lynch, which should be based on yagarto.

from my experiencies a commercial IDE (like IAR or Keil) is a better starting point.

altzone wrote:
2) What JTAG programmer hardware is best?
Presumably it would be tied into my first question, with some environments only supporting some JTAG programmers?
And does this JTAG programmer allow simple debugging?
The lower the cost the better, I'm used to my PICkit2 programmer doing everything for $30.

arm-usb-ocd (http://www.olimex.com/dev/index.html) is a cheap solution (also supported by yagarto).
j-link (http://www.segger.com) is faster and more reliable, but i'm not sure if it's supported by an open-source-toolchain.

altzone wrote:
3) Does the GCC or other compiler come with headers/libraries/examples etc for the AT91SAM7S256 device I'm interested in?
I don't want to spend a week figuring out how to write to an I/O port or register etc. I'm so used to just having my PIC GCC compiler automatically define every register as stated in the datasheet (e.g. PORTA=0;), I'd love to be able to do the same thing with the ARM without any hassles (e.g. for the clock register CKGR_MOR=0;).

take a look at the software packages provided from atmel. they are offering most of the examples also for gcc:
http://www.atmel.com/dyn/products/tools ... ol_id=4343

regards
gerhard


Top
 Profile  
 
 Post subject: Re: NEWBIE - How to get started on AT91SAM7S
PostPosted: Fri Sep 18, 2009 4:37 pm 
Offline

Joined: Fri Jun 12, 2009 1:54 pm
Posts: 17
Hi, I am a noob myself to this, and come from inferior lines of processors. But since I have just dealt with the same issues, I will give you my $.02:

I got the AT91SAM7S-EK from atmel, its $100 and comes with eval version of a bunch of compilers. Like you I have tried to set up a GCC tool chain for a different processor before and never got it to work right, so this time I tried to use the professional software. None of them worked out of the box, I had to request a key first. So much for a "Quick getting started". Of course it was Friday and I wanted to play with it on the weekend so I decided to give the GNU toolchain one more chance.
Now I am glad I did because its working and using it, I will a) be able to use it at home and at work and on different computers (the other compiler I considered was node locked). And b) it will be easier for me to set up GNU based tool-chains for other MCUs in the future.
Another positive: all Atmel examples in their software pack have zip files which specific GNU versions, so you have access to all examples.

To test your program you can either upload it through serial port, USB, or JTAG. If you use serial or USB, you won't be able to use debugging e.g. break points (at least to my knowledge). If you use JTAG, you will have to buy an extra device (like JLINK / SAMICE). I did that because I wanted the breakpoints, and it cost me $100. What I didn't like is that I bought the SAMICE because in Atmel's tutorial it states that it has an unrestricted license for use, but then it turns out the flash debugging costs extra (and I have yet to see the price tag for that).

Atmel has an extensive peripheral library and header files for many boards and processors, so yes you will be able to use #defines for almost everything there is (search for board.h). In fact the code I have been writing on this platform has been a lot simpler and more descriptive than on any other embedded platform I have used so far.

When using GNU toolchain you will use Eclipse as an IDE, I don't think I have done a single thing in the shell so far. This is another huge plus in my opinion because you are using a standard development system that you either already know, or if not (like in my case) you can benefit from learning it.

Now the negative: Finding out how to set up the tool chain is a PITA. There are several tutorials and none of them work correctly, mainly because things get updated independently, but the tutorials do not. Also Atmel's "getting started" project seems to have changed over time as well. I documented everything I did when I installed this, then I installed it on a successfully second machine. So here are the main steps on how I got the "hello-world" program (Or rather "flashing LED getting started" project) to work:

install the environment
=================
-follow instructions on Yagato website, which means installing yagato, eclipse, eclipse zylin plugin, GNU make.
-put the GNU make BIN folder into your machine's environment PATH

create a project for "getting started"
===========================
- unzip the getting-started-project for GNU edition to some folder on your HD (if the ZIP seems to be corrupted, use WINRAR)
- copy the at91lib folder into your eclipse workspace folder
- create an empty make project in eclipse (this should create a new folder in the workspace folder, at the same level where you copied at91lib to)
- import the main.c and makefile into this project
- in project/properties - builds check CDT-Builder
- in project/properties - C/C++ Build / Settings check GNU ELF Parser
- edit the make file: set CROSS_COMPILE to arm-elf-
- edit the make file: set CHIP = at91sam7s256
- edit the make file: set BOARD = at91sam7s-ek
- build ! you should get no error and it should produce a BIN file. You can use SAMBA to upload the BIN file, or use the JTAG debugger:

use JTAG debugger
==============
- purchase JLINK/SAMICE or whatever
- install segger gdb server
- in eclipse go to window/open perspective/debug
- go to "Debug Configurations..."
- create a new configuration under "Zylin ...(native)"
- in new configuration on main tab: select your project
- in new configuration on main tab: select your application
- in new configuration on debugger tab: set GDB debugger = C:\Program Files\yagarto\bin\arm-elf-gdb.exe (or whereever you got it)
- on commands tab:
initialize commands:
target remote localhost:2331
run commands:
monitor reset 4
monitor speed auto
load
break main
continue

- click DEBUG to upload and debug the program. It will have a breakpoint in the first line, click F8 when it hits it so the program will continue to run
- after that if you want to debug again, you can just click on the bug symbol in the upper left corner of eclipse.

with what I described above I was able to compile the Atmel examples. This was about a month or two ago. Maybe you want to give it a shot, I think its worth it.


Top
 Profile  
 
 Post subject: Re: NEWBIE - How to get started on AT91SAM7S
PostPosted: Sat Sep 19, 2009 3:59 am 
Offline

Joined: Sat Sep 12, 2009 8:16 am
Posts: 2
Thanks for the reply guys.
Sounds as though it's pretty much what I expected, difficult to get up and running initially.
That's a difficult pill to swallow, especially when my present PIC Toolchain solution works nicely for me and others out of the box.
If I go forward I'm going to have to stick with the GNU stuff even though it's more difficult, as people are going to want to much around with my product and develop their own stuff.
Guess I'll have to just jump in and see how hard it actually is to get a Hello World working...

Thanks
Dave.


Top
 Profile  
 
 Post subject: Re: NEWBIE - How to get started on AT91SAM7S
PostPosted: Fri Sep 25, 2009 5:26 pm 
Offline

Joined: Thu Mar 02, 2006 1:32 pm
Posts: 127
Location: Switzerland
Hi

Take a look at the uTasker project. This will allow you to start with powerful projects (USB, Ethernet etc.) with dedicated tutorial http://www.utasker.com/docs/SAM7X/uTaskerV1-4_SAM7X.PDF and other supporting documents and forum. It also allows you to simulate the chip (SAM7X) within VisualStudio (Express version from Microsoft is free) - the chip runs in real time on your PC and allows you to simply investigate its workings and learn about it, the peripherals and important protocols.

Note that the SAM7S is a sub-set of the SAM7X, without Ethernet, so should be otherwise compatible.

Regards

Mark

http://www.uTasker.com
http://www.utasker.com/forum


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: