Andes Workshop

It is currently Fri Mar 29, 2024 8:41 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: DLM demo(沒有SDRAM開機的程式)
PostPosted: Mon Nov 28, 2011 10:24 am 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
我改寫了demo-ls1程式,讓它可以在沒有SDRAM的情況下運行。
程式如附件,要將它燒寫到flash裏。
注意,如果燒寫flash顯示No intel flash時,請先按AndeSight右下角的”Reset Target and Hold”,再燒寫就能燒進去。
Attachment:
p2.gif
p2.gif [ 6.84 KiB | Viewed 8297 times ]


原本demo-ls1的運行是.data和.bss在RAM裏,我將它改成DLM。
Attachment:
p3.gif
p3.gif [ 40.25 KiB | Viewed 8297 times ]


改寫的方法:
(1) 在crt0.S裏,增加下面2行
li $r0,0x800001
mtsr $r0, $dlmb
使得DLM (data local memory) enable,並且將地址定在0x800000的地方。
去掉bal _nds32_init_mem 這一行。因為我們沒用到SDRAM,所以不需要init。
(2) 改寫 nds32-burn-16mb.ld檔,將
SDRAM (awx) : ORIGIN = 0x00800000, LENGTH = 4M
將4M改成64K。因為我們的FPGA上的DLM是64K。
將這一行 PROVIDE (_stack = ORIGIN(SDRAM) + LENGTH(SDRAM));
改成 PROVIDE (_stack = ORIGIN(SDRAM) + LENGTH(SDRAM)-8);
這才是真正的DLM的最尾端。

請您直接使用附件程式即可。
很多人的設計是將ILM接flash或是ROM,並且使用boot from ILM。
(硬體設計時,預設ILM為enable即可實現boot from ILM)

執行結果如下 按下GPIO會觸發一個interrupt。
Attachment:
p1.gif
p1.gif [ 15.47 KiB | Viewed 8297 times ]


拔掉SDRAM做測試是否真的沒有用到SDRAM。
Attachment:
nosdram.jpg
nosdram.jpg [ 52.04 KiB | Viewed 8297 times ]


程式碼
Attachment:
demo-ls1-dlm-nosdram.zip [83 KiB]
Downloaded 735 times


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

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 22 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