1. 開發環境:
(1). CPU: Andes RISC CPU core_N12.
(2). 平台: ADP-XC5FF676 V1.1.
(3). Windows OS: MS-Windows XP.
(4). Toolchains: AndeSight v1.4 for MS-Windows XP.
2. 實驗目的:
(1). 使用ESL模擬平台環境下UART控制¸UART主要是為了將嵌入式系統的printf()訊息顯示在PC端或是PC端輸入指令下給嵌入式系統.
(2). 使用STD C Project增加新的project, STD C Project與之前選擇C Project的差異就在makefile的產生, 選擇C Project會由AndeSight IDE自動產生,而選擇STD C Project就須自行編寫,因此使用STD C Project〝
需要修改makefile內指定編譯器的路徑〞.
3. 實驗步驟:
(1). UART電路圖.

(2). UART連接頭.

(3). UART傳輸Waveform.

(4). Register設定意義.

(5). 建立新的STD C Project,使用滑鼠選擇〝
File〞->〝
New〞->〝
STD C Project〞.

程式下載:
http://cid-b01cb9ac20175eaa.office.live.com/self.aspx/4%5E_AndeSight%5E_VEP%5E_ESL%5E_UART/4%5E_AndeSight%5E_VEP%5E_ESL%5E_UART.zip
(6). 在〝
Project name:〞欄位輸入計畫名稱,這裡輸入〝
UART〞,之後按下〝
Next>〞至下個一歨驟.

(7). 不需做任何設定,按〝
Finish〞結束選擇.

(8). 接下來要加入已撰寫好的程式,先使用〝
滑鼠左鍵〞點選Project,再點選〝
滑鼠右鍵〞,之後選擇〝
Import〞.

(9). 使用滑鼠點選〝
File System〞後,按〝
Next>〞至下一個走驟.

(10). 在〝
From directory:〞欄位輸入遇加入程式的路徑,這裡按〝
Browse〞來選擇.

(11). 選擇程式路徑,這裡選擇〝
UART〞後按〝
確定〞.

(12). 勾選遇加入的程式檔案,選擇完畢按〝
Finish〞.
注意: 增加檔案時,如有〝
.cdtbuild〞,〝
.cdtproject〞,〝
.project〞的Project參數設定檔案請勿加入,以免覆蓋掉目前產生的Project參數.

(13). 最後編譯程式,先使用〝
滑鼠左鍵〞點選Project,再點選〝
滑鼠右鍵〞,之後選擇〝
Build Project〞.

(14). 接下來要啟動之前設定好的ESL〝
.VEP〞設定檔,使用滑鼠擇〝
Target〞->〝
Fork VEP Target〞.

(15). 按〝
Browse...〞選擇project下已建立好的.VEP檔後按 〝
Finish〞.

(16). 最後可以看到模擬平台的VEP產生.

(17). 使用〝
滑鼠左鍵〞點選〝
EX_UART_V.vep〞可以看到模擬平台架構.

(18). 接下來要執行程式,先使用〝
滑鼠左鍵〞點選Project,再點選〝
滑鼠右鍵〞,之後選擇〝
Run As〞->〝
Run〞.

(19). 使用〝
滑鼠左鍵〞點兩下〝
Cross Platform Application〞.

(20). 之後如下圖所示.

(21). 之後再選擇〝
Debugger〞,在〝
GDB debugger:〞欄位選擇〝
nds32le-elf-gdb.exe〞的路徑,按〝
Browse〞選擇,設定完畢後按〝
Run〞.
注意: 〝
nds32le-elf-gdb.exe〞的選擇要與這個STD C Project下makefile所設定的編譯器〝
nds32le-elf-gcc〞路徑參數相同.

(22). 最後會在Console(Uart)模擬視窗顯示結果.

(23). 終止程式需按下〝
Terminate〞.

(24). 最後當程式執行完畢,需要修改程式之前,先至跳至〝
Debug〞模式視窗,請按〝
Remove All Terminated Launches〞圖示ICOM,將此次的程式設定清除.
沒有留言:
張貼留言