移植uClinux到百为STM32开发板
硬件:百为STM3210E-EVAL开发板软件:vmware6.5.2 + ubuntu8.04
一、安装codesourcery交叉编译器
root@xiliang-desktop:~# cp /mnt/hgfs/share/arm-2009q1-163-arm-uclinuxeabi.bin /home/stm32/
root@xiliang-desktop:~# cd /home/stm32/
root@xiliang-desktop:/home/stm32# ./arm-2009q1-163-arm-uclinuxeabi.bin
The installer has detected that your system uses the dash shell
as /bin/sh.This shell is not supported by the installer.
You can work around this problem by changing /bin/sh to be a
symbolic link to a supported shell such as bash.Please refer
to the Getting Started guide, or contact CodeSourcery Support
for assistance.
这里出现错误,提示说默认的shell是dash shell,而安装.bin要在bash shell下面执行。所以执行下面命令把dash shell取消默认。在弹出的对话框里选择NO。
root@xiliang-desktop:/home/stm32# sudo dpkg-reconfigure dash
然后再重新执行安装
root@xiliang-desktop:/home/stm32# ./arm-2009q1-163-arm-uclinuxeabi.bin
在弹出的对话框里按默认设置一直点next安装就可以了,当然license要agree了。
默认是安装到/root/CodeSourcery/Sourcery_G++_Lite路径,并配置好环境变量。
二、编译uclinux内核
1、复制并解压内核到工作目录下
root@xiliang-desktop:/home/stm32# cp /mnt/hgfs/share/uClinux-dist.tar.gz /home/stm32
root@xiliang-desktop:/home/stm32# tar xvzf uClinux-dist.tar.gz
2、配置uclinux内核
root@xiliang-desktop:/home/stm32/uClinux-dist# make menuconfig
在弹出的对话框里选择厂商和型号
选择stmicroelectronics
选择STM3210E-EVAL
选择后点exit退出,保存.config配置文件
出现下面信息表示配置完成
config/mkconfig > Kconfig
/home/stm32/uClinux-dist/config/kconfig/mconf Kconfig
#
# configuration written to .config
#
*** End of Linux kernel configuration.
*** Execute 'make' to build the kernel or try 'make help'.
3、编译内核
root@xiliang-desktop:/home/stm32/uClinux-dist# make
编译完成后,生成xipImage.bin,rootfs.img.bin ,logo.bin这三个文件,并被自动复制到/home/stm32/uClinux-dist/images目录下:
4、制作DFU文件
首先在WIN上安装DFU软件,然后打开软件DFUse->DFU File Manager
选择I want to GENERATE,设置vendor ID,product ID,version,Target如图:
选择Multi BIN在弹出的对话框里把刚编译生成的image文件逐一添加进来,制作DFU文件
address填64000000,打开xipImage.bin,并add to list
address填64100000,打开rootfs.img.bin,并add to list
address填64160000,打开logo.bin,并add to list
点OK确定
然后点generate生成.dfu文件,保存就可以了
三、下载程序到STM32开发板上
烧写bootloader到STM32内部FLASH,按照我们提供的DFU烧写文档把DFU文件烧写进STM32外部NOR FLASH。然后上电运行程序。
运行信息(注意串口波特率为19200)
platform Initialisation finished jumping to kernel.
Linux version 2.6.26-uc0 (root@xiliang-desktop) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-163) ) #1 Thu May 19 07:11:13 PDT 2011
CPU: ARMv7-M Processor revision 1 (ARMv?(11)M)
Machine: STM3210E-EVAL
SRAM Config: bank @ 0x68000000 (size: 1024KB) - bank @ 0x20000000 (size: 64KB).
Built 1 zonelists in Zone order, mobility grouping off.Total pages: 254
Kernel command line: noinitrd root=mtd1 ro rootfstype=jffs2 init=/linuxrc console=ttyS0
PID hash table entries: 16 (order: 4, 64 bytes)
console enabled
Dentry cache hash table entries: 1024 (order: 0, 4096 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 1MB 0MB = 1MB total
Memory: 980KB available (436K code, 55K data, 8K init)
Mount-cache hash table entries: 512
JFFS2 version 2.2. 漏 2001-2006 Red Hat, Inc.
simple-gpio: now handling 16 GPIOs: 0 - 15
ttyS0 at MMIO 0x40013800 (irq = 37) is a STM32 USART1 Port
Probed and found the STM3210E-EVAL NOR flash chip
Creating 4 MTD partitions on "M29W128F NOR FLASH":
0x00000000-0x00100000 : "Kernel raw data"
0x00100000-0x00160000 : "rootfs"
0x00160000-0x00190000 : "rawdata"
0x00190000-0x001c0000 : "cramfs_partition"
rtc-stm3210e_eval rtc-stm3210e_eval.0: rtc core: registered rtc-stm3210e_eval as rtc0
rtc-stm3210e_eval rtc-stm3210e_eval.0: setting system clock to 1970-01-01 00:00:00 UTC (0)
VFS: Mounted root (jffs2 filesystem) readonly.
Freeing init memory: 8K
Mounting proc fs
Mounting sysfs
Welcome to
____ __
/__| ||_|
_ _| || | _ ___ _ _ _ _
| | | | || || |_ \| | | |\ \/ /
| |_| | |__| || | | | | |_| |/ \
| ___ \____|_||_|_| |_|\____|\_/\_/
| |
|_|
For further information check:
http://www.uclinux.org/
http://www.st.com/stm32
/ # ls
bin etc lib mnt root sys
dev home linuxrcproc sbin usr
/ # cd /bin
/bin # ls
Led_Show busybox df hush mknod rmdir
ShowLogo cat dmesg hwclock mount sh
Splash chmod echo kill mv test
Toggle_gpioclear false ln ps true
[ cp free ls pwd umount
[[ date hello_worldmkdir rm uname
/bin # ./hello_world
hello world.
/bin # ./Led_Show
uclinux启动后LCD上会显示uclinux LOGO
另外cramfs也出弄了个uclinux,u-boot应该也可以在这板上跑了,等有空试试
好厉害,大牛。 顶起 顶起 楼主。{:victory:}{:victory:} lans0625 发表于 2013-10-25 14:58 static/image/common/back.gif
顶起 楼主。
{:handshake:} 帮顶。
厉害。 顶厉害膜拜 五体投地,大神 顶起。
uCLinux应该是429的肉了,在其他STM32上运行都有最大的问题:内存不够,现在429带SDRAM控制器,这是uCLinux发挥的时候了。 好历害! 好牛的楼主,顶你 楼主真NB 本帖最后由 fengyunyu 于 2013-10-27 23:24 编辑
请教lz,可以跑uclinux,那是否可以基于此硬件平台,学习linux的驱动程序设计? fengyunyu 发表于 2013-10-27 23:23 static/image/common/back.gif
请教lz,可以跑uclinux,那是否可以基于此硬件平台,学习linux的驱动程序设计? ...
这个拿来玩玩,调试uclinux内核,驱动,是可以的。不过实用性不大,实际应用可以考虑LPC1788+uclinux xi_liang 发表于 2013-10-30 10:00 static/image/common/back.gif
这个拿来玩玩,调试uclinux内核,驱动,是可以的。不过实用性不大,实际应用可以考虑LPC1788+uclinux ...
请问uclinux能用jlink仿真么? fengyunyu 发表于 2013-10-30 10:04 static/image/common/back.gif
请问uclinux能用jlink仿真么?
调试内核用printf xi_liang 发表于 2013-10-30 10:58 static/image/common/back.gif
调试内核用printf
能用gdb调试么? 强大,学习了! 配置内核时提示如下:请问如何解决
root@desktop:/home/note/Share/uClinux-dist# make menuconfig
config/mkconfig > Kconfig
CC=cc CXX=c++ make -C /home/note/Share/uClinux-dist/config/kconfig conf
make: Entering directory `/home/note/Share/uClinux-dist/config/kconfig'
cc -DCURSES_LOC="<curses.h>" -c -o conf.o conf.c
cc -DCURSES_LOC="<curses.h>" -c -o zconf.tab.o zconf.tab.c
cc conf.o zconf.tab.o -o conf
make: Leaving directory `/home/note/Share/uClinux-dist/config/kconfig'
CC=cc CXX=c++ make -C /home/note/Share/uClinux-dist/config/kconfig mconf
make: Entering directory `/home/note/Share/uClinux-dist/config/kconfig'
cc -DCURSES_LOC="<curses.h>" -c -o mconf.o mconf.c
In file included from mconf.c:27:
lxdialog/dialog.h:32:20: error: curses.h: No such file or directory
In file included from mconf.c:27:
lxdialog/dialog.h:97: error: expected specifier-qualifier-list before ‘chtype’
lxdialog/dialog.h:187: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:193: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:195: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:196: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:197: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:198: error: expected ‘)’ before ‘*’ token
lxdialog/dialog.h:200: error: expected ‘)’ before ‘*’ token
mconf.c: In function ‘conf’:
mconf.c:610: error: ‘KEY_MAX’ undeclared (first use in this function)
mconf.c:610: error: (Each undeclared identifier is reported only once
mconf.c:610: error: for each function it appears in.)
mconf.c: In function ‘conf_choice’:
mconf.c:761: error: ‘KEY_MAX’ undeclared (first use in this function)
make: *** Error 1
make: Leaving directory `/home/note/Share/uClinux-dist/config/kconfig'
make: *** Error 2
root@desktop:/home/note/Share/uClinux-dist#
这个是ubuntu上缺少了些软件包,安装一下就可以了
#apt-get install libncurses5-dev 好强大啊。。。。。 wazhiyi 发表于 2013-12-20 23:32
好强大啊。。。。。
{:lol:} {:handshake:} Mark!1!!!好厉害,有时间再来研究uclinux Mark!1!!!好厉害,有时间再来研究uclinux 顶了,在dsp和2440上都移植过,有空玩玩stm32的 明日有明月 发表于 2013-12-23 14:48
顶了,在dsp和2440上都移植过,有空玩玩stm32的
2440上linux更加好玩一点 arm-2009q1-163-arm-uclinuxeabi.bin
这个 哪里下载的 楼主 把你的资源共享一下 新手不知道怎么找资料
1. GUN编译工具
2. uClinux 内核文件
3. 支持STM32开发的一些文件
需要这个三个文件的吧 楼主有的话 希望共享一下
谢谢了 bruce_helen 发表于 2013-10-27 20:41
顶起。
uCLinux应该是429的肉了,在其他STM32上运行都有最大的问题:内存不够,现在429带SDRAM控制器,这是 ...
什么 429 请指点 http://www.kanebebe.com/download/ARM7uClinux/index.html 我的是 unbuntu 13.10 的 版本最新的 可能存在不兼容的问题不 root@xiliang-desktop:/home/stm32# ./arm-2009q1-163-arm-uclinuxeabi.bin 提示没有这个文件或者目录 https://sourcery.mentor.com/downloads/public/gnu_toolchain/arm-none-linux-gnueabi/ 本帖最后由 闷鱼 于 2014-3-17 06:32 编辑
楼主 你好
我的系统是 unbuntu 13.10 的
安装了 arm-2013.05-24-arm-none-linux-gnueabi.bin和 uClinux-dist-20121024.tar.bz2
我在选择厂商和芯片型号的时候 看不到 STMircroelectronics这是怎么回事
我没有链接开发板
必须连接了开发板才可以看到这个选项么谢谢
顶厉害膜拜 闷鱼 发表于 2014-3-17 06:03
楼主 你好
我的系统是 unbuntu 13.10 的
源码问题,uClinux-dist-20121024.tar.bz2这个源码可能没有支持STM32吧。我们用的是打上STM32 patch的 xi_liang 发表于 2014-3-17 22:28
源码问题,uClinux-dist-20121024.tar.bz2这个源码可能没有支持STM32吧。我们用的是打上STM32 patch的 ...
我也感觉是这里的问题
出于这个考虑而且你又有成功的例子
能否方便把你的tar 和 path 文件传我下麻烦了
非常感谢
xi_liang 发表于 2014-3-17 22:28
源码问题,uClinux-dist-20121024.tar.bz2这个源码可能没有支持STM32吧。我们用的是打上STM32 patch的 ...
执行 #zcat uClinux-dist-20080808-20090112.path.gz | patch p1 之后
patching file p1
The next patch would create the file p1
which already exists! Assume -R? __
我选择了 n
接下来 提示
Apply anyway? __
选择 y回车
又重复提示
The next patch would create the file p1
which already exists! Assume -R? __
这怎么处理 内核版本 最新的 uclinux 是不是不支持 本帖最后由 闷鱼 于 2014-3-18 22:48 编辑
xi_liang 发表于 2014-3-17 22:28
源码问题,uClinux-dist-20121024.tar.bz2这个源码可能没有支持STM32吧。我们用的是打上STM32 patch的 ...
打补丁的时候一直这样 是怎么回事啊
patching file p1
The next patch would create the file p1
which already exists! Assume -R? __
我选择了 y
接下来 提示
Apply anyway? __
选择 y回车
又重复提示
The next patch would create the file p1
which already exists! Assume -R? __
http://www.amobbs.com/forum.php?mod=viewthread&tid=5573095&page=1#pid7393892
这个是我 新开的 求助帖 麻烦您给看看 不错,可惜我没移植上去,板子的flash是外置spi接口,不知怎么配置了 这个不需要打补丁吗? 什么我下载的Uclinux在make menuconfig的hi后没有 Vendor/Production Select 这个选项呢? 浮华一生 发表于 2014-5-8 20:30
这个不需要打补丁吗? 什么我下载的Uclinux在make menuconfig的hi后没有 Vendor/Production Select 这个 ...
我们弄的打完那个补丁有这个选项的,需要的话可以购买我们开发板 顶起来。。。。。。 玩具级的,没有任何商用价值的平台,建议直接上ARM9+linux ucLinux的API基本上与Linux相同,这样是否意味着Linux下开发的C应用程序可以用在ucLinux上?
页:
[1]