Andes Workshop

It is currently Fri Mar 29, 2024 4:09 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: nds32-elf-aout2mem
PostPosted: Wed Mar 20, 2013 12:41 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
nds32-elf-aout2mem是一個轉檔的tool
(如附件,請解壓縮後使用)
轉成RTL用的格式
用法如下,放在Linux系統裡
nds32-elf-aout2mem demo-int.adx NDSROM.dat

產生的NDSROM.dat的格式如下
Code:
@00000000 4800013a 4800011c 4800011a 48000118
@00000004 48000116 48000114 48000112 48000110
@00000008 4800010e 4800010c 4800010a 48000108
@0000000c 48000106 48000104 48000102 48000100
@00000010 480000fe 480000fc 480000fa 480000f8
@00000014 480000f6 480000f4 480000f2 480000f0
@00000018 480000ee 480000ec 480000ea 480000e8
@0000001c 480000e6 480000e4 480000e2 480000e0
@00000020 480000de 480000dc 480000da 480000d8
@00000024 00000000 00000000 00000000 00000000
@00000028 00000000 00000000 00000000 00000000

這是用Perl寫的
如果需要其他格式可以自己改
下面的附檔是2013.11.28更新
Attachment:
nds32-elf-aout2mem.zip [2.81 KiB]
Downloaded 1443 times


How to use:
Code:
cindy@apc047:~$ PATH=~/Andestech/AndeSight200STD/toolchains/nds32le-elf-newlib-v3m/bin:$PATH
cindy@apc047:~/mycode$ chmod +x nds32-elf-aout2mem
./nds32-elf-aout2mem hello-1000.adx hello-1000.dat

Output file: hello-1000.dat
--------------
aout2mem的输出结果:第一列是地址,后面对应多个结果。
举个例子,如要
0000000 34333231 38373635 64636261 68676665

期待结果:一列地址后面对应一个内容。
Code:
0000000 31
0000001 32
0000002 33
0000003 34
0000004 35
0000005 36
0000006 37
0000007 38

做法如下
nds32le-elf-objcopy --output-target=binary a.out a.bin
(這是2行不同的指令)
od -t xC --width=1 -v a.bin

輸出格式
Code:
0015125 69
0015126 74
0015127 20
0015130 73
0015131 65
0015132 6c
0015133 66
0015134 2e
0015135 2a
0015136 0a
0015137 00
0015140 41
0015141 20
0015142 73


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: Google [Bot] and 14 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