bugAVR C Runtime Library - Bugs: bug #14486, some macros from boot.h doesn't...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #14486: some macros from boot.h doesn't compile correctly

Submitter:  None
Submitted:  Sat 10 Sep 2005 07:01:10 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  7 - High Item Group:  None
Status:  Fixed Assigned to:  None
Percent Complete:  0% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

Sat 10 Sep 2005 07:01:10 AM UTC, original submission:  

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.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Follow 6 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-10-06 aesok Assigned toarcanum None
    Open/ClosedOpen Closed
2005-10-06 aesok StatusNone Fixed
2005-09-10 joerg_wunsch Priority5 - Normal 7 - High
    Assigned toNone arcanum
2005-09-10 None Carbon-Copy- Added rmarko --AT-- maxwell --DOT-- spina --DOT-- si

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code