bugAVR C Runtime Library - Bugs: bug #7276, avr-libc 1.0.2, strncpy_P using...

 
 

bug #7276: avr-libc 1.0.2, strncpy_P using lpm on mega128

Submitted by:  None
Submitted on:  Thu 15 Jan 2004 09:28:57 PM UTC  
 
Category: LibrarySeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: InvalidPercent 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 06 Mar 2004 09:31:21 PM UTC, comment #1:

_attribute_((progmem)) data are only valid (right now) in
the bottom 64 KB of flash ROM anyway.

Extending this requires a lot of work (and code bloat) since
RAMPZ would need to be maintained then. There used to be
an old discussion on the avr-libc mailinglist about this.

Joerg Wunsch <joerg_wunsch>
Project Administrator
Thu 15 Jan 2004 09:28:57 PM UTC, original submission:

Hi , Ive found a problem with strncpy_P ,under some situations data is fetched from the incorrect sourse address because lpm is used instead of elpm when compiled for the mega128.
/snip
  1e646:      fb 01           movw    r30, r22
 1e648:     dc 01           movw    r26, r24

0001e64a <.strncpy_P_loop>:
 1e64a:     41 50           subi    r20, 0x01       ; 1
 1e64c:     50 40           sbci    r21, 0x00       ; 0
 1e64e:     48 f0           brcs    .+18            ; 0x1e662
 1e650:     05 90           lpm     r0, Z+       <<<< should be elpm r0, Z+ on mega 128 ?
 1e652:     0d 92           st      X+, r0 1e654:   00 20           and     r0, r0 1e656:   c9 f7    
  brne    .-14            ; 0x1e64a 1e658:        01 c0           rjmp    .+2             ; 0x1e65c

>

avr-libc 1.0.2
gcc v3.3.2

Cheers
Simon.

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 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 06 Mar 2004 09:31:21 PM UTCjoerg_wunschStatusNone=>Invalid
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1