- 裸机开发流程
本次只考虑3,4步
1.1
交差工具链
[[email protected] home]# mkdir S3-ARM/Part1/lesson1
mkdir: 无法创建目录"S3-ARM/Part1/lesson1": 没有那个文件或目录
[[email protected] home]# mkdir S3-ARM
[[email protected] home]# cd S3-ARM/
[[email protected] S3-ARM]# mkdir Part1
[[email protected] S3-ARM]# cd Part1/
[[email protected] Part1]# mkdir lesson1
[[email protected] Part1]# cd lesson1/
[[email protected] lesson1]# chmod 777 ./
[[email protected] lesson1]# ls
ARM-Tools.tar.gz
[[email protected] lesson1]# tar xzf ARM-Tools.tar.gz
[[email protected] lesson1]# ls
ARM-tools ARM-Tools.tar.gz
[[email protected] lesson1]# cd ARM-tools/
[[email protected] ARM-tools]# ls
arm-linux-gcc-4.3.2.tgz dnw eclipse-cpp-helios-SR2-linux-gtk.tar.gz
arm-linux-gdb-7.5.tar.gz dnw_usb.ko JLink_Linux_V434a.tgz
[[email protected] ARM-tools]# rm /usr/local/arm/ -rf
[[email protected] ARM-tools]# tar xzf arm-linux-gcc-4.3.2.tgz -C /
[[email protected] ARM-tools]# cd /usr/local/arm/4.3.2/bin/
[[email protected] bin]# ls
arm-linux-addr2line arm-linux-objdump arm-none-linux-gnueabi-gcov
arm-linux-ar arm-linux-ranlib arm-none-linux-gnueabi-gdb
arm-linux-as arm-linux-readelf arm-none-linux-gnueabi-gdbtui
arm-linux-c++ arm-linux-size arm-none-linux-gnueabi-gprof
arm-linux-c++filt arm-linux-sprite arm-none-linux-gnueabi-ld
arm-linux-cpp arm-linux-strings arm-none-linux-gnueabi-nm
arm-linux-g++ arm-linux-strip arm-none-linux-gnueabi-objcopy
arm-linux-gcc arm-none-linux-gnueabi-addr2line arm-none-linux-gnueabi-objdump
arm-linux-gcc-4.3.2 arm-none-linux-gnueabi-ar arm-none-linux-gnueabi-ranlib
arm-linux-gcov arm-none-linux-gnueabi-as arm-none-linux-gnueabi-readelf
arm-linux-gdb arm-none-linux-gnueabi-c++ arm-none-linux-gnueabi-size
arm-linux-gdbtui arm-none-linux-gnueabi-c++filt arm-none-linux-gnueabi-sprite
arm-linux-gprof arm-none-linux-gnueabi-cpp arm-none-linux-gnueabi-strings
arm-linux-ld arm-none-linux-gnueabi-g++ arm-none-linux-gnueabi-strip
arm-linux-nm arm-none-linux-gnueabi-gcc
arm-linux-objcopy arm-none-linux-gnueabi-gcc-4.3.2
添加PATH环境变量
[[email protected] home]# vim /root/.bashrc
export PATH=$PATH:/usr/local/arm/4.3.2/bin
[[email protected] home]# source /root/.bashrc
[[email protected] home]# cd /home/S3-ARM/Part1/lesson1/
[[email protected] lesson1]# ls
ARM-tools ARM-Tools.tar.gz led.lds led.S Makefile
[[email protected] lesson1]# arm-linux-gcc -g -c led.S
[[email protected] lesson1]# ls
ARM-tools ARM-Tools.tar.gz led.lds led.o led.S Makefile
[[email protected] lesson1]# arm-linux-ld -Tled.lds -o led.elf led.o
[[email protected] lesson1]# ls
ARM-tools ARM-Tools.tar.gz led.elf led.lds led.o led.S Makefile
[[email protected] lesson1]# arm-linux-objcopy -O binary led.elf led.bin
[[email protected] lesson1]# ls
ARM-tools ARM-Tools.tar.gz led.bin led.elf led.lds led.o led.S Makefile
- 交差工具链
- 链接器脚本
- Makefile
[[email protected] lesson1]# make clean
rm *.o led.elf led.bin
[[email protected] lesson1]# make
arm-linux-gcc -g -o led.o -c led.S
arm-linux-ld -Tled.lds -o led.elf led.o
arm-linux-objcopy -O binary led.elf led.bin
[[email protected] lesson1]# ls
ARM-tools ARM-Tools.tar.gz led.bin led.elf led.lds led.o led.S Makefile
烧写到开放板
裸机程序烧写到nandflash
利用nandflsah安装辅助程序安装
将boot开关从00011001à00011111即由nandflash到sd卡启动
打开D:\可移动磁盘\006 嵌入式\飞凌嵌入式\TE6410基础资料-256\Linux-3.0.1\Linux烧写工具\SD_Writer.exe
- Scan
- Select Boot
- Program
打开D:\Program Files\SecureCRT_绿色版
使光标在开发板上电
按住空格键从SD卡启动
###################### User Menu for OK6410#####################
[1] Format the nand flash
[2] Burn image from SD card
[3] Burn image from USB
[4] Reboot the u-boot
[5] Exit to command line
-----------------------------Select---------------------------------
Enter your Selection:1
?
NAND scrub: device 0 whole chip
Warning: scrub option will erase all factory set bad blocks!
There is no reliable way to recover them.
Use this command only for testing purposes if you
are sure of what you are doing!
?
Really scrub this NAND flash? <y/N>
scrub aborted
?
###################### User Menu for OK6410#####################
[1] Format the nand flash
[2] Burn image from SD card
[3] Burn image from USB
[4] Reboot the u-boot
[5] Exit to command line
-----------------------------Select---------------------------------
Enter your Selection:3
使s3c6400x设备连接到虚拟机
##### Select the fuction #####
[1] Flash u-boot
[2] Flash kernel
[3] Flash system
[4] Exit
Enter your Selection:1
?
NAND erase: device 0 offset 0x0, size 0x200000
Erasing at 0x180000 -- 100% complete.
OK
OTG cable Connected!
Now, Waiting for DNW to transmit data
Download Done!! Download Address: 0x50008000, Download Filesize:0xe0
Checksum is being calculated.
Checksum O.K.
?
NAND write: device 0 offset 0x0, size 0x200000
1032192 bytes written: OK
?
[[email protected] ~]# cd /home/S3-ARM/Part1/lesson1/
[[email protected] lesson1]# ls
ARM-tools ARM-Tools.tar.gz led.bin led.elf led.lds led.o led.S Makefile
[[email protected] lesson1]# cd ARM-tools/
[[email protected] ARM-tools]# ls
arm-linux-gcc-4.3.2.tgz dnw eclipse-cpp-helios-SR2-linux-gtk.tar.gz
arm-linux-gdb-7.5.tar.gz dnw_usb.ko JLink_Linux_V434a.tgz
[[email protected] ARM-tools]# insmod dnw_usb.ko
?
Message from [email protected] at Sep 13 23:42:34 ...
kernel:GuoQian USB driver for DNW!
[[email protected] ARM-tools]# ./dnw ../led.bin 50008000
addr = 50008000
File name : ../led.bin
File size : 224 bytes
Start Sending data...
Sent 100% ???? 234 bytes !OK