avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] New prosessor goes into stack violation!


From: Per Arnold Blåsmo
Subject: Re: [avr-gcc-list] New prosessor goes into stack violation!
Date: Sat, 08 Jan 2005 00:34:07 +0100
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)



E. Weddington wrote:

Per Arnold Blåsmo wrote:



No, this address is not, as I can understand, in the interrupt vector table. There are relatively few interrupt vector in this processor compared to the ordinary AVR processors. Since it originally is used in smart card applications it also has very limited I/O.

Since this is in the startup code and no calls or anything has been done, the SP has not changed from its initial value. The only thing it has done some far is to set the SP and start copying from the end of the program area in flash to SRAM.

As you can see from the disassembly this is ordinary avr-gcc startup code:

Disassembly of section .text:

00000000 <__vectors>:
  0:    0c 94 0e 00     jmp    0x1c
  4:    0c 94 27 00     jmp    0x4e
  8:    0c 94 27 00     jmp    0x4e
  c:    0c 94 27 00     jmp    0x4e
 10:    0c 94 27 00     jmp    0x4e
 14:    0c 94 27 00     jmp    0x4e
 18:    0c 94 27 00     jmp    0x4e

0000001c <__ctors_end>:
 1c:    11 24           eor    r1, r1
 1e:    1f be           out    0x3f, r1    ; 63
 20:    cf ef           ldi    r28, 0xFF    ; 255
 22:    cd bf           out    0x3d, r28    ; 61

00000024 <__do_copy_data>:
 24:    12 e0           ldi    r17, 0x02    ; 2
 26:    a0 e6           ldi    r26, 0x60    ; 96
 28:    b0 e0           ldi    r27, 0x00    ; 0
 2a:    ec e2           ldi    r30, 0x2C    ; 44
 2c:    fe e0           ldi    r31, 0x0E    ; 14
 2e:    02 c0           rjmp    .+4          ; 0x34

00000030 <.do_copy_data_loop>:
 30:    05 90           lpm    r0, Z+
32: 0d 92 st X+, r0 <------This is where it crashes X=0x00fe


Ok. Shot in the dark:
- Is this the *first* address that it is using? i.e. is this the first time through the loop?
- Does your device have that opcode variant?

No, it is not the first time trough the loop. I goes trough the loop approx. 150-160 times before it crashes.
What opcode variant?
It used something called and AVR3+ instruction set. I have set it to compile with avr5 in avr-gcc, avr-binutils and avr-libc.

Per A.
--
Per Arnold Blåsmo
e-mail: address@hidden
Get Thunderbird <http://www.mozilla.org/products/thunderbird/>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]