s3c2410开发环境建立
首先介紹的整體的環境是ubuntu 9.04 gcc的版本是4.1.下面是具體的環境建立
(1)arm-linux-gcc安裝
在下面的網址上http://www.handhelds.org/download/projects/toolchain/下載arm-linux-gcc-3.4.1.tar.bz2
執行下面的命令:
將arm-linux-gcc-3.4.1.tar.bz2復制到/tmp下
bunzip2?arm-linux-gcc-3.4.1.tar.bz2生成arm-linux-gcc-3.4.1.tar
tar xvf arm-linux-gcc-3.4.1.tar -C / 將該tar包解壓到/usr/local/arm目錄下
修改/etc/bash.bashrc新增加下面
if [ -d /usr/local/arm/2.95.3 ] ; then
PATH=/usr/local/arm/2.95.3/bin:"${PATH}"
fi
注意的是上面的PATH后沒有空格
是上面的修改生效?source /etc/profile
下面是測試程序hello.c
#include <stdio.h>
int main ()
{
?? ? ?printf("hello world\n");
?? ? ?return 0;
}
使用下面的命令編譯arm-linux-gcc hello.c -o hello,于是生成二進制hello
(2)Jflash-s3c2410安裝,S3C2410芯片的JTAG工具
到chinaunix上下載Jflash-s3c2410bz2,解壓,進入解壓完的目錄
make all(查看Makefile可知)
第一次時出現下面的error:asm/io.h : No such file or directory。google之得到如下的solution。http://forum.ubuntu.org.cn/viewtopic.php?f=70&t=255593&view=next
Notes on source code: Some people have reported that for some reason this code does not work on theuir systems. If you have problems in getting this to work, try tho following chagest to code: replace the lines "#include <unistd.h%gt;" and "#include <asm/io.h>" with line "#include <sys/io.h>" and then replace line "#define base 0x378" with "#define base 0x0378".
這是人家原文的話,要仔細看。
將<asm/io.h>改為<sys/io.h>
然后生成Jflash-s3c2410,最后將該文件復制到/usr/local/bin/下
(3)安裝gdb調試工具
首先在http://ftp.gnu.org/gnu/gdb/下載gdb-7.0.tar.gz(gcc -4.1下測試通過,沒有安裝gcc-4.1的話,可以使用sudo apt-get install gcc-4.1來安裝)
執行下面的命令:
cp XXX/gdb-7.0.tar.gz /tmp(XXX是gdb-7.0.tar.gz路徑)
cd /tmp
tar zxvf gdb-7.0.tar.gz
cd gdb-7.0
export CC=gcc-4.1
./configure --target=arm-linux
make
sudo make install
執行完上面的命令之后,會安裝完成arm-linux-gdb和gdbserver。
在安裝arm-linux-gdb時,最初使用的是gdb-6.3.tar.gz,但是編譯時在sim/arm/iwmmxt.c上出現編譯錯誤,google該錯誤得到下面的solution,http://hi.baidu.com/zjsxycli/blog/item/99863fddf1be55196227986e.html
將2117行的??? (signed long long) t += s;???
改成??????? (signed long long)t;??? t = (signed long long)(t + s);
將2133行的??? (signed long long) wR[BITS (12, 15)] += (signed long long) t;???
改成??? {(signed long long) wR[BITS (12, 15)];??? wR[BITS (12, 15)] = (signed long long)(wR[BITS (12, 15)] + t);}
將2169行的??? (signed long) s1 = a * b;???
改成??? (signed long) s1;??? s1 =(signed long)(a * b);
將2177行的??? (signed long) s2 = a * b;
改成??? (signed long) s2;??? s2 =(signed long)(a * b);
將2186行的??? (unsigned long) s1 = a * b;
改成??? (unsigned long) s1;??? s1 =(unsigned long)(a * b);
將2191行的??? (signed long) s2 = a * b;
改成??? (unsigned long) s2;??? s2 =(unsigned long)(a * b);
編譯Gdbserver:
linux-arm-low.c:26:21: error: sys/reg.h: No such file or directory
make: *** [linux-arm-low.o] 錯誤 1
根據在linux-arm-low.c中:
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
#endif
在gdb/gdbserver/config.h修改如下:
/* Define if you have the <sys/reg.h> header file.? */
#define HAVE_SYS_REG_H 1
/* Define if you have the <sys/reg.h> header file.? */
//#define HAVE_SYS_REG_H 1 省略
但是按照上面的方法實驗,依然出錯。所以懷疑是版本的問題,果然在換了一個較高的版本之后,成功。
轉載于:https://www.cnblogs.com/xuqiang/archive/2010/02/16/1953750.html
總結
以上是生活随笔為你收集整理的s3c2410开发环境建立的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [翻译]C#数据结构与算法 – 第六章B
- 下一篇: asp.net Urlrewriter在