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

 
 

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

Submitted by:  None
Submitted on:  Sat 10 Sep 2005 07:01:10 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 7 - HighItem Group: None
Status: FixedPercent Complete: 0%
Assigned to: NoneOriginator Email: -unavailable-
Open/Closed: ClosedRelease: None
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 6 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Thu 06 Oct 2005 08:08:23 PM UTCaesokAssigned toarcanum=>None
  Open/ClosedOpen=>Closed
Thu 06 Oct 2005 08:08:22 PM UTCaesokStatusNone=>Fixed
Sat 10 Sep 2005 08:36:59 PM UTCjoerg_wunschPriority5 - Normal=>7 - High
  Assigned toNone=>arcanum
Sat 10 Sep 2005 07:01:10 AM UTCNoneCarbon-Copy-=>Added rmarko --AT-- maxwell --DOT-- spina --DOT-- si

Back to the top


Powered by Savane 3.1-cleanup1