本篇可以先參考劉昱賢的Hello World使用GDB及AICE下載到開發版

我只做個整理。

 

(1)把板子turn on,接上AICE。

(2)#./ICEman.exe --port 1234

在XP裡打開ICEman

 

(3)下面示範bin檔的restore及執行功能

#./nds32le-elf-gdb

這樣子會進入gdb,以下是gdb的command

target remote:1234

restore hello.bin binary 0x500000

set $pc=0x500000

continue

quit

 

不過我做的結果,程式雖能執行,但是程式執行完跳不過gdb

 

(4)下面示範elf檔的load功能

#./nds32le-elf-gdb

這樣子會進入gdb,以下是gdb的command

target remote:1234

targetreset

file ./hello.adx

load

continue

quit

也是執行正常

 

至於這2個執行檔的產生,可以用AndeSight編譯。 原始碼如下:

 

#include <stdio.h>

int main(void)
{
 int i;
 i = 0;
 while ( i < 1000 ) {
 printf("%05d  hello! world!\n", i);
 i++;
 }
 return 0;
}

創作者介紹
創作者 Andes Core 的頭像
Cindy

Andes Core

Cindy 發表在 痞客邦 留言(0) 人氣( 989 )