1,linux Development Environment Construction
2, program test
Easyopentag driver installation, open connection, select Arm-linux
Links: http://pan.baidu.com/s/1pJKK4w7 Password: a0re
1, Environment construction
My system version [Email protected]:~# lsb_release -ano lsb modules are available. distributor id:ubuntudescription:ubuntu 14.04.3 ltsrelease:14.04codename:trusty[email protected]:~# I use the mirros[email protected]:~# cat /etc/apt/sources.listdeb http:// mirrors.zju.edu.cn/ubuntu trusty main universe restricted multiversedeb http:// Mirrors.zju.edu.cn/ubuntu trusty-security main universe restricted multiversedeb http://mirrors.zju.edu.cn/ubuntu trusty-updates main universe restricted multiversedeb http://mirrors.zju.edu.cn/ubuntu trusty-backports main universe Restricted multiversedeb-src http://mirrors.zju.edu.cn/ubuntu trusty main universe restricted multiversedeb-src http://mirrors.zju.edu.cn/ubuntu trusty-security main universe restricted multiversedeb-src http://mirrors.zju.edu.cn/ubuntu trusty-updates main universe restricted multiversedeb-src http://mirrors.zju.edu.cn/ubuntu trusty-backports main universe Restricted multiverse Installing the basic Development Kit [email protected]:~# apt-get update && apt-get install -y build-essential bison flex manpages-dev[email Protected]:~# echo $?0 Installation  ARM-LINUX-GCC Decompression arm-linux-gcc-3.4.5-glibc-2.3.6.tar.bz2 From Vedon teaching CD tar xf arm-linux-gcc-3.4.5-glibc-2.3.6.tar.bz2 installation sudo apt-get install lsb-core otherwise may appear no such file or directory[email protected]:~/leds# arm-linux-objcopy bash: /home/chunli/gcc-3.4.5-glibc-2.3.6/bin/ arm-linux-objcopy: no such file or directory Changing the system path[email protected]:~$ sudo vim /home/chunli/.bashrcExport path= $PATH::/home/chunli/gcc-3.4.5-glibc-2.3.6/bin/look at my system build environment [email protected ]:~$ arm-linux-gcc -vreading specs from /home/chunli/gcc-3.4.5-glibc-2.3.6/bin/. /lib/gcc/arm-linux/3.4.5/specsconfigured with: /work/tools/create_crosstools/crosstool-0.43/build/ Arm-linux/gcc-3.4.5-glibc-2.3.6/gcc-3.4.5/configure --target=arm-linux --host=i686-host_pc-linux-gnu --prefix=/work/tools/gcc-3.4.5-glibc-2.3.6 --with-float=soft --with-headers=/work/tools/ Gcc-3.4.5-glibc-2.3.6/arm-linux/include --with-local-prefix=/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit -- enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-longthread model: posixgcc version 3.4.5[email protected]:~$
Write a program that lights up the LEDs:
Write a compilation applet that illuminates the JZ2440 Development Board
JZ2440 Development Board:
As can be seen from the Jz2440v2_sch.pdf
Nled_2 Pull up to 3.3V
Nled_2 Another foot is connected to GPF5 on this IO function pin
Official Handbook of s3c2440
The address of the Gpfcon is 0x56000050, and the value of this register is set to 0x00000400 configuration GPF5 this pin is output
The address of the Gpfdat is 0x56000054 control GPF5 output Low level
[Email protected]:~/hardware$ mkdir my[email protected]:~/hardware$ cd my/[email protected]:~/hardware/my$ vim led_on. s@******************************************************************************@ file:led_on. s@ function: LED lighting program, light led1@****************************************************************************** . text.global _start_start: ldr r0,=0x56000050 @ The  R0 is set to the Gpbcon register. This register is used to select the functions of each pin: output, input, or other MOV     R1, #0x00000400 @ set as output pin str R1,[R0] @ set GPF5 to output, bit [10:9]=0b01 The  LDR     R0,=0X56000054      @ R0 is set to the Gpbdat register. This register is used for read/write port B pin data MOV    R1, #0x00000000 @ Change this value to 0xffffffff, to make LED2 off            STR     R1,[R0]              @ GPB5 output 0,led1 lit main_loop: B main_loop Writing makefile Files [email protected]:~/hardware/my$ vim makefileled_on.bin : led_on. Sarm-linux-gcc -g -c -o led_on.o led_on. sarm-linux-ld -ttext 0x0000000 -g led_on.o -o led_on_elfarm-linux-objcopy - O binary -s led_on_elf led_on.binclean:rm -f led_on.bin led_on_ ELF *.O compilation [Email protected]:~/hardware/my$ makearm-linux-gcc -g -c -o led_ on.o led_on. sarm-linux-ld -ttext 0x0000000 -g led_on.o -o led_on_elfarm-linux-objcopy - O binary -s led_on_elf led_on.bin No error [email protected]:~/hardware/my$ echo $?0[email protected]:~/hardware/my$ ll-rwxrwxr-x 1 chunli chunli 36 apr 12 22:20 led_on.bin*-rwxrwxr-x 1 chunli chunli 34144 Apr 12 22:20 led_on_elf*-rw-rw-r-- 1 chunli chunli 1412 apr 12 22:20 led_on.o-rw-rw-r-- 1 chunli chunli 1035 apr 12 22:19 led_on. s-rw-rw-r-- 1 chunli chunli 218 apr 12 22:20 Makefile
Upload the Led_on.bin program to the Windows platform,
FTD2XX.dll
Oflash.exe
Led_on.bin
Put it together and you can
Run Oflash.exe applet,d:\arm embedded linux\my>oflash.exe+-------------------------------------------------------- -+| flash programmer v1.3 for openjtag of www.100ask.net | | OpenJTAG is a USB to JTAG & RS232 tool based ft2232 | | this programmer supports both of s3c24x0 & s3c6410 | | &NBSP;&NBSP;&NBSP;AUTHOR:&NBSP;EMAIL/MSN ([email protected]), &NBSP;QQ (17653039) |+------------- --------------------------------------------+usage:1. oflash, run with cfg.txt or prompt2. oflash [file], write [file] to flash with prompt3. oflash [-f config_file]4. oflash [jtag_type] [cpu_type] [flash_type] [Read_or_write] [offset] [file]can ' T open cfg.txt, you should follow the promptselect the jtag type:0. Openjtag1. dongle jtag (Parallel port) 2. wiggler jtag (parallel port) Enter The number: 0select the cpu:0. s3c24101. s3c24402. s3c6410enter the number: 1device: 4 "2232C" deviceid: 0x14575118serialnumber: ftsht3gzadescription: usb<=>jtag&rs232 as3c2440 detected, cpuid = 0x0032409d[main menu] 0:nand flash prog 1:nor flash prog 2:Memory Rd/Wr 3:ExitSelect the function to test:0enter the file name: led_on.bin[nand flash Jtag programmer]scan nand flash:device 0: nand 256mib 3,3v 8-bit, sector size 128 kibtotal size: 256 mib 0:nand flash program 1:nand flash print blkpage 2:exitselect the function to test :0[nand flash writing program]source size: 0x24available target block number: 0~ 2047input target block number:0target start block number =0target size (0x20000*1) =0x20000status:epd:\ arm embedded linux\my>, etc. 5 seconds, the Development Board of the small lamp lit up
This article is from the "Soul Bucket" blog, please be sure to keep this source http://990487026.blog.51cto.com/10133282/1763228
SAMSUNG s3c2440 ARM LINUX Development Board Experience-development environment building