bugAVR C Runtime Library - Bugs: bug #40206, SP initialization in startup code...

 
 

bug #40206: SP initialization in startup code for xmegas is inconsistent with compiler generated initialization in function prologue

Submitted by:  Senthil Kumar Selvaraj <saaadhu>
Submitted on:  Tue 08 Oct 2013 12:24:16 PM UTC  
 
Category: LibrarySeverity: 3 - Normal
Priority: 5 - NormalItem Group: Startup code
Status: NonePercent Complete: 0%
Assigned to: NoneOpen/Closed: Open
Release: 1.8.0Fixed Release: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Tue 08 Oct 2013 12:24:16 PM UTC, original submission:

gcrt1.S writes SPH before SPL for all devices. For xmegas, the compiler, however, writes SPL before SPH. This is to avoid occurence of interrupts after the writing of SPH but before the writing of SPL; the hardware disables interrupts for four instructions after the write to SPL.

Also, things like writing to the CCP first up in main fail silently because of the reversed order of writing to the SP (when there are less than 4 instructions separating the write to SPL and the write to CCP).

The attached patch (patch #1) makes the startup code write to SPL and then SPH for xmegas, making it consistent with what the compiler does for function prologues.

Senthil Kumar Selvaraj <saaadhu>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #29326:  fix_sp_write_xmega.patch added by saaadhu (707B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by saaadhu (Submitted the item)
  •  

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

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 08 Oct 2013 12:24:16 PM UTCsaaadhuAttached File-=>Added fix_sp_write_xmega.patch, #29326

    Back to the top


    Powered by Savane 3.1-cleanup