Andes Workshop
http://forum.andestech.com/

能夠將interrupt vector table放到ILM嗎?
http://forum.andestech.com/viewtopic.php?f=6&t=836
Page 1 of 1

Author:  banyh [ Mon Apr 28, 2014 5:43 pm ]
Post subject:  能夠將interrupt vector table放到ILM嗎?

我想到的作法如下:
1.crt0.o和ILM function集中放到 .ilm section
2.ilm section放在load address 0
3.因為ILM大小是64KB,所以text, RO從load address 0x10000開始放
4.開機後將ilm section複製到ILM,並將interrupt vector table指向ILM

但這樣有個問題,crt0.o會同時放到text section,造成multiple definition of '_start':
Code:
   ILM 0x00000000 0x00010000
   {
      LOADADDR __ilm_lmastart
      ADDR __ilm_start
      crt0.o (.text, +RO)
      * (.ilm)    ; functions to be put in ILM
      LOADADDR __ilm_lmaend
      ADDR __ilm_end
   }

   FLASH 0x00010000 0x00100000
   {
      * (.vector) ; program
      * (+RO)     ; const global variables
   }


另外請教一下,".vector" 和 ".text" 是一樣的嗎?

Author:  jerry [ Tue Apr 29, 2014 10:58 am ]
Post subject:  Re: 能夠將interrupt vector table放到ILM嗎?

關於crt0.o會同時放到text section,造成multiple definition of '_start':
會造成這一個問題有可能是專案沒有設定到,請先參考圖紅框的部份,
勾選"Do not use standard start file"
Attachment:
未命名.jpg
未命名.jpg [ 184.77 KiB | Viewed 9491 times ]


.vector和.text?
這兩個不同的Section.
.text為程式段
.vector為user define section ,
這一個可以參考Demo code (demo-crt)裡vector.S
.section .vector, "ax" 在vector.S是與其它demo code不同的地方。

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/