ARM Cross Development with Eclipse GNUARM Cygwin and AT91ISP

Discussion about SAM7 Series and ARM7TDMI based products.

Moderator: nferre

User avatar
Fredo_Boyer
Contact:
Location: ATMEL Rousset FRANCE
Posts: 145
Joined: Mon Mar 22, 2004 12:29 pm

ARM Cross Development with Eclipse GNUARM Cygwin and AT91ISP

Tue Jan 10, 2006 3:18 pm

Hi all,

Here is a complete and free solution for compiling and debugging your applications on the AT91SAM microcontrollers !!!

This solution is based on:
:arrow: Eclipse open-source Integrated Development Environment (IDE) SDK 3.1.1: http://www.eclipse.org
:idea: you will need to install Java 2 Standard Edition http://www.sun.com

:arrow: Zylin CDT plugin for Eclipse allowing to edit and build C programs using the GNU compiler toolkit http://www.zylin.com/embeddedcdt.html

:arrow: CYGWIN GNU C++/C Compiler and Toolset for Windows (only Archive, Devel, Libs and Web packages to install) http://www.cygwin.com

:arrow: GNUARM GNU C++/C Compiler for ARM Targets GCC 4.x binaries http://www.gnuarm.com

:arrow: ATMEL AT91 ISP Flash Programming Solutions v1.1 www/phpBB2/viewtopic.php4?t=1432

:arrow: GDB Server for JTAG debugging: Files section of GNUARM Yahoo groups (JLINK_ARM_GDBServer_V100.zip ) http://groups.yahoo.com/group/gnuarm/
:!: This free gdbserver works with J-Link and SAM-ICE

You will need a good internet broadband connection to download all these free software tools.

Find attached a Basic Example (print on the DBGU) which was compiled, debug and run on the AT91SAM7X256 chip.
Satanic
Contact:
Location: Spain
Posts: 73
Joined: Wed Jul 06, 2005 6:42 pm

Fri Feb 24, 2006 1:18 pm

Stick this post?
A good friend told me that he would love to live in a nordic country to have a faster inet connection, I told him that i would never change my 250 sunny days / year for a gbit inet.

Who is wrong?
User avatar
pfilippi
Contact:
Posts: 326
Joined: Fri Feb 13, 2004 7:53 pm

Mon Feb 27, 2006 4:39 pm

Done ;-)
james.k
Location: melbourne
Posts: 12
Joined: Thu Oct 13, 2005 8:06 am

Thu Mar 09, 2006 2:58 am

This link appears to be broken. Can you please post an alternative?

ATMEL AT91 ISP Flash Programming Solutions v1.1 www/phpBB2/viewtopic.php4?t=1432
User avatar
Fredo_Boyer
Contact:
Location: ATMEL Rousset FRANCE
Posts: 145
Joined: Mon Mar 22, 2004 12:29 pm

Thu Mar 09, 2006 10:41 am

Hi james.k,

Go to the Flash Programmation section for all related topics about the AT91ISP and SAM-BA...

For the AT91ISP:
www/phpBB2_mirror/viewtopic.php4?t=1432 ... highlight=
jdupre
Location: Petaluma, California
Posts: 44
Joined: Sat Apr 16, 2005 12:47 am

Sat Mar 11, 2006 3:16 am

I can't get the 'bugger to work with the "BasicGNU" sample code and the toolchain described above.

I have compiled using "make debug" to make a ram based executable.
I start the GDB server.
I start the debugger and type in:
target remote local:2331

I get a bunch of warnings from GDB:
internal error pc 0x0 in read in psymtab, but not in sysmtab

When I type "load", GDB responds:
invalid download offset: ...path/to/project/a.out

Any hints as to what I am not doing correctly?

- joe
User avatar
Fredo_Boyer
Contact:
Location: ATMEL Rousset FRANCE
Posts: 145
Joined: Mon Mar 22, 2004 12:29 pm

Mon Mar 13, 2006 10:25 am

I get a bunch of warnings from GDB:
internal error pc 0x0 in read in psymtab, but not in sysmtab
Don't take care about these warnings...

Here is what I use as Commands in my debug session configuration:
target remote localhost:2331
monitor endian little
monitor reset
break main
monitor long 0xFFFFFF00 = 0x01
set $pc=0
load
continue

Take care to have correctly in this debug session referenced the good location for your *.out file
jdupre
Location: Petaluma, California
Posts: 44
Joined: Sat Apr 16, 2005 12:47 am

Tue Mar 14, 2006 3:15 am

OK, I have tried this again. Here is my result:

Code: Select all

(gdb) target remote localhost:2331
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

_vec_reset () at crt.S:52
52	                b           _init_reset
Current language:  auto; currently asm
(gdb) warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

mnitor endian little
Undefined command: "mnitor".  Try "help".
(gdb) monitor endian little
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

(gdb) monitor reset
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

(gdb) break main
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

Breakpoint 7 at 0x22c: file main.c, line 40.
(gdb) warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

monitor long 0xffffff00 = 0x01
Writing 0x00000001 @ addr 0xFFFFFF00
(gdb) warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

set $pc=0
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

Value being assigned to is no longer active.
(gdb) load
Invalid download offset: and Settings/jmd.XPTESTSYS/workspace/FirstTest/a.out
My eclipse project is in the default location, so I thought that may cause a problem with the long path. I moved a.out to c:\temp\a.out and tried again. This time I got this message:

Code: Select all

(gdb) load
Loading section .text, size 0x31c lma 0x0
Memory access error while loading section .text.
This is still indicating some problem with the memory configuration.
output of objdump -p a.out is:

Code: Select all

jmd@xptestsys /home/jmd.xptestsys/workspace/firsttest
$ objdump -x a.out

a.out:     file format elf32-little
a.out
architecture: UNKNOWN!, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00000000

Program Header:
    LOAD off    0x00008000 vaddr 0x00000000 paddr 0x00000000 align 2**15
         filesz 0x00000340 memsz 0x00000348 flags rwx

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         0000031c  00000000  00000000  00008000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .rodata       00000024  0000031c  0000031c  0000831c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .data         00000000  00000340  00000340  00008340  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  3 .bss          00000008  00000340  00000340  00008340  2**2
                  ALLOC
  4 .debug_line   00000137  00000000  00000000  00008340  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_info   00000b4d  00000000  00000000  00008477  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_abbrev 00000187  00000000  00000000  00008fc4  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_aranges 00000060  00000000  00000000  00009150  2**3
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_frame  000000c8  00000000  00000000  000091b0  2**2
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_pubnames 0000006c  00000000  00000000  00009278  2**0
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_str    00000030  00000000  00000000  000092e4  2**0
                  CONTENTS, READONLY, DEBUGGING
 11 .comment      00000024  00000000  00000000  00009314  2**0
                  CONTENTS, READONLY
SYMBOL TABLE:
00000000 l    d  .text  00000000 .text
0000031c l    d  .rodata        00000000 .rodata
00000340 l    d  .data  00000000 .data
00000340 l    d  .bss   00000000 .bss
00000000 l    d  .debug_line    00000000 .debug_line
00000000 l    d  .debug_info    00000000 .debug_info
00000000 l    d  .debug_abbrev  00000000 .debug_abbrev
00000000 l    d  .debug_aranges 00000000 .debug_aranges
00000000 l    d  .debug_frame   00000000 .debug_frame
00000000 l    d  .debug_pubnames        00000000 .debug_pubnames
00000000 l    d  .debug_str     00000000 .debug_str
00000000 l    d  .comment       00000000 .comment
00000000 l    d  *ABS*  00000000 .shstrtab
00000000 l    d  *ABS*  00000000 .symtab
00000000 l    d  *ABS*  00000000 .strtab
00000000 l    df *ABS*  00000000 crt.S
000000d0 l     F .text  00000000 $a
00000020 l       .text  00000000 _init_reset
00000020 l       .text  00000000 _init_stack
00000038 l       .text  00000000 _init_lowlevelinit
00000044 l       .text  00000000 _init_bss
0000006c l       .text  00000000 _lp_bss
00000068 l       .text  00000000 exit
0000006c l     O .text  00000000 $d
00000074 l     F .text  00000000 $a
000000c0 l     O .text  00000000 $d
00000000 l    df *ABS*  00000000 init.c
000000d1 l     F .text  00000000 $t
000001a4 l     O .text  00000000 $d
00000000 l    df *ABS*  00000000 main.c
000001d1 l     F .text  00000000 $t
00000340 l     O .bss   00000000 $d
00000228 l     O .text  00000000 $d
0000022d l     F .text  00000000 $t
000002b1 l     F .text  00000020 AT91F_DBGU_CfgPIO
00000295 l     F .text  0000001a AT91F_US_EnableTx
00000288 l     O .text  00000000 $d
00000295 l     F .text  00000000 $t
000002d1 l     F .text  0000004c AT91F_PIO_CfgPeriph
000002cc l     O .text  00000000 $d
000002d1 l     F .text  00000000 $t
0000005c g       .text  00000000 __main
0000031c g       .text  00000000 _etext
00000004 g       .text  00000000 _vec_undef
000001d1 g     F .text  0000005c AT91F_DBGU_Printk
0000031c g       .rodata        00000000 _srodata
0000000c g       .text  00000000 _vec_pabt
00000340 g       .data  00000000 _sdata
000000b4 g       .text  00000000 AT91F_Default_FIQ_handler
00000074 g       .text  00000000 AT91F_Irq_Handler
00000348 g       .bss   00000000 __bss_end
00000018 g       .text  00000000 _vec_irq
000000b8 g       .text  00000000 AT91F_Default_IRQ_handler
00000348 g       *ABS*  00000000 end
00000340 g     O .bss   00000001 test
00000014 g       .text  00000000 _vec_rsv
00000008 g       .text  00000000 _vec_swi
00000000 g       .text  00000000 _text
00000340 g       .bss   00000000 __bss_start
0000022d g     F .text  00000068 main
00210000 g       *ABS*  00000000 _stack_end
00000010 g       .text  00000000 _vec_dabt
000000d1 g     F .text  00000100 AT91F_LowLevelInit
00000344 g     O .bss   00000004 juju
000000bc g       .text  00000000 AT91F_Spurious_handler
00000340 g       .data  00000000 _edata
00000348 g       *ABS*  00000000 _end
00000000 g       .text  00000000 _vec_reset
0000001c g       .text  00000000 _vec_fiq
0000005c g       .text  00000000 _main
00000340 g       .rodata        00000000 _erodata
(I modified the output string by a few characters, thus the small difference in file size from what you might see.)

Does all of this look correct to you??? I'm really a novice at all this, so it is especially troubling when trying to make a simple demo work!

- Joe
User avatar
Fredo_Boyer
Contact:
Location: ATMEL Rousset FRANCE
Posts: 145
Joined: Mon Mar 22, 2004 12:29 pm

Tue Mar 14, 2006 9:50 am

Hi jdupre,

First of all, try to use the basic gnu project attached above on a previous post.
This should work and then use the ldscript to create yours ...

Take care about "mnitor endian little" error : this should be monitor ...

Then, depending if you are using the SAM7S-EK or the SAM7X-EK, erase your flash to be sure sure to have a system "cleaned up", then for SAM7X-EK only, program the NVM bit 2 to be sure to boot on Flash and not on ROM. All these advices to be sure that no initializations are performed except yours...

Hope this will for help
jdupre
Location: Petaluma, California
Posts: 44
Joined: Sat Apr 16, 2005 12:47 am

Wed Mar 15, 2006 2:13 am

Problem solved. My bad.
I was not using the correct gdb!

Advice: specifically call ...gnuarm/bin/arm-elf-gdb.exe

- Joe
User avatar
Fredo_Boyer
Contact:
Location: ATMEL Rousset FRANCE
Posts: 145
Joined: Mon Mar 22, 2004 12:29 pm

Wed Mar 15, 2006 9:13 am

Great ! :wink:

Bye
jdupre
Location: Petaluma, California
Posts: 44
Joined: Sat Apr 16, 2005 12:47 am

Wed Mar 15, 2006 11:35 pm

The AT91SAM7X header files provided in the BasicGNU project are licensed with GPL. Was it the intent to not allow their use in developing closed-source, non-public executables?

Shouldn't these header files be licensed with the Lesser-GPL, so that they can be used to develop commercial products?

I see that the header files provided with the sample IAR projects do not contain the GPL limitation. Why the difference?

- Joe
nleahcim
Posts: 87
Joined: Thu Aug 25, 2005 7:06 pm

Wed Apr 05, 2006 2:17 am

Hi - I'm having an odd problem. I can't use the divide or modulus operators using this code! I have been reading about GNU-ARM and I think I might have to include a special library or something? I've tried including math.h but that had no effect. Anybody have any idea how to get divide and modulus working? Thanks!!


edit: with the help of Richard at the gnuarm yahoo group I have gotten the problem fixed. Some modifications had to be made to the makefile. If anybody runs into the same problem and wants to see the updated makefile let me know and I'll post it.
mrodsilva
Posts: 2
Joined: Thu Apr 06, 2006 2:01 am

Can't download BasicGnu.zip

Thu Apr 06, 2006 2:09 am

Hi,

I'm trying to download the BasicGnu.zip file without sucess. It seems to be corrupted. The Firefox downloader stop about 850 Kb... The post indicate that the file is greater than 900 Kb... When I try to open it the Winzip complains that the files is corrupted.

Any help?
mrodsilva
Posts: 2
Joined: Thu Apr 06, 2006 2:01 am

Can't download BasicGnu.zip

Thu Apr 06, 2006 3:29 pm

Never mind... I just got the file.

Thanks

Return to “SAM7 ARM7TDMI MCU”

Who is online

Users browsing this forum: No registered users and 1 guest