avr-libc-dev
[Top][All Lists]
Advanced

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

[avr-libc-dev] [bug #14486] some macros from boot.h doesn't compile corr


From: anonymous
Subject: [avr-libc-dev] [bug #14486] some macros from boot.h doesn't compile correctly
Date: Sat, 10 Sep 2005 07:01:13 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; sl-SI; rv:1.7.10) Gecko/20050720 Fedora/1.0.6-1.1.fc4 Firefox/1.0.6

URL:
  <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=14486>

                 Summary: some macros from boot.h doesn't compile correctly
                 Project: AVR C Runtime Library
            Submitted by: None
            Submitted on: Sat 09/10/05 at 07:01
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
        Percent Complete: 0%
        Originator Email: address@hidden
             Open/Closed: Open

    _______________________________________________________

Details:

Hi

I have a problem with programing the bootloader. I am using atmega128,
avrlibc 1.2.5, avr-gcc 4.0.1, binutils 2.16.1. Linker report problem with
undefined reference  'Y'. This problem is in function boot_page_erase(addr)
from boot .h. I will explain my problem on two examples.

First instance of call boot_page_erase():

 51:program.c     ****     boot_page_erase (70);
 80                   .LM2:
 81                   /* #NOAPP */
 82 0008 23E0              ldi r18,lo8(3)
 83 000a 86E4              ldi r24,lo8(70)
 84 000c 90E0              ldi r25,hi8(70)
 85 000e A0E0              ldi r26,hlo8(70)
 86 0010 B0E0              ldi r27,hhi8(70)
 87                   /* #APP */
 88 0012 FC01              movw r30, r24
 89 0014 A093 5B00         sts  91, r26
 90 0018 2093 6800         sts 104, r18
 91 001c E895              spm


When I am calling this function for second time compiler produces this:

131 004e C8E6              ldi r28,lo8(104)
132 0050 D0E0              ldi r29,hi8(104)
133 0052 93E0              ldi r25,lo8(3)
134 0054 A8E6              ldi r26,lo8(104)
135 0056 B0E0              ldi r27,hi8(104)
136                   .L8:
 69:program.c     ****             // erase only main section (bootloader
protection)
 70:program.c     ****             address = 0;  71:program.c     ****       
     while ( address < 0x1dfff ){
 72:program.c     ****                 // Perform page erase
 73:program.c     ****                 boot_page_erase (address);
138                   .LM10:
139                   /* #APP */
140 0058 F901              movw r30, r18
141 005a 4093 5B00         sts  91, r20
142 005e 9093 0000         sts Y, r25        <<--PROBLEM
143 0062 E895              spm


Problem is in call sts Y,r25. Compiler loads 104 which is addres of SPM_REG
but  you cannot write to Y with sts only with st. If you look into boot.h
there is output operators "=m". What do they stand for. I haven't found any
documentatio for them. How can you force the compiler to do correct code.

Same problem is with boot_rww_enable();

Cheers,
Rok

ps: Bjorn Hasse showed me a solution and it is working.




    _______________________________________________________

Carbon-Copy List:

CC Address                          | Comment
------------------------------------+-----------------------------
rmarko --AT-- maxwell --DOT-- spina --DOT-- si | Originator Email




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=14486>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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