Andes Workshop

It is currently Thu Mar 28, 2024 9:51 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: user section出現overlap error
PostPosted: Mon May 05, 2014 2:23 pm 
Offline

Joined: Thu Jan 23, 2014 4:18 pm
Posts: 12
我希望自定義user section .dlm,並將dlm section的內容放到DLM中

sag 內容如下:
Code:
USER_SECTIONS .ilm, .dlm

BINARY_PART1 0x00000000 0x00010000
{
   ILM 0x00000000 0x00010000
   {
      VAR _ILM_BASE = 0x00000000 ; ILM base address
      VAR _ILM_SIZE = 0x00010000 ; 64Kb

      LOADADDR __ilm_lmastart
      ADDR __ilm_start
      * (.nds32_init)
      * (.ilm)    ; functions to be put in ILM
      LOADADDR __ilm_lmaend
      ADDR __ilm_end
   }
}
BINARY_PART2 0x00010000 0x00100000
{
   FLASH +0x0
   {
      * (.text) ; program
      * (+RO)     ; const global variables
   }

   SRAM 0x08000000 0x00010000
   {
      LOADADDR __lma_start_data
      ADDR __start_data
      * (+RW)     ; initialized global variables
      ADDR __end_data
      ADDR __start_bss
      * (+ZI)     ; uninitialized global variables
      ADDR __end_bss
      STACK = 0x08010000
   }

   DLM 0x08010000 0x00010000
   {
      VAR _DLM_BASE = 0x08010000 ; DLM base address
      VAR _DLM_SIZE = 0x00010000 ; 64Kb

      LOADADDR __dlm_lmastart
      ADDR __dlm_start
      * (.dlm)    ; data to be put in DLM
      LOADADDR __dlm_lmaend
      ADDR __dlm_end
   }
}


在其中一個source file定義dlm variable
Code:
extern unsigned int TIMER_BASE[4] __attribute__((section(".dlm")));
extern unsigned int PWM_BASE[1] __attribute__((section(".dlm")));
extern unsigned int UART_BASE[2] __attribute__((section(".dlm")));
extern unsigned int SPI_BASE[2] __attribute__((section(".dlm")));
extern unsigned int I2C_BASE[3] __attribute__((section(".dlm")));
extern unsigned int DDC_BASE[3] __attribute__((section(".dlm")));


但在linking時出現錯誤
Code:
section .dlm [00011c14 -> 00011c4f] overlaps section .data1 [00011c14 -> 00011c17]


map.txt內容為
Code:
.dlm            0x08000138       0x3c load address 0x00011c14
.dlm           0x08000138       0x3c ./codebase/main.o
                0x0800014c                UART_BASE
                0x08000168                DDC_BASE
                0x08000148                PWM_BASE
                0x08000138                TIMER_BASE
                0x08000154                SPI_BASE
                0x0800015c                I2C_BASE

.data1          0x08000174        0x4 load address 0x00011c14
*(.data1)
                0x08000178                . = ALIGN (0x8)
*fill*         0x08000174        0x4 00


請問是否sag有那邊寫錯?


Top
 Profile Send private message E-mail  
 
 Post subject: Re: user section出現overlap error
PostPosted: Tue May 06, 2014 11:20 am 
Offline

Joined: Thu Apr 03, 2014 10:09 am
Posts: 42
Hi Sirs,

請問code中用到的變數很多嗎?若很多的情況下,是否能先將變數減少。

若方便可能將專案寄給我們以便debug.


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group