mini2440烧写裸机程序(linux+JLink)

一、编写源代码

源代码:

/*******************************led_off.S**************************/

.text
.global _start
_start:
            LDR     R0,=0x56000010
            MOV     R1,#0x00015400
            STR     R1,[R0]

            LDR     R0,=0x56000014
            MOV     R1,#0x0df
            STR     R1,[R0]

MAIN_LOOP:
            B       MAIN_LOOP

/*******************************Makefile****************************/

*指定链接文件地址

*指定链接文件顺序

*********************************************************************/

 

led_off.bin : led_off.S
        arm-linux-gcc -g -c -o led_off.o led_off.S
        arm-linux-ld -Ttext 0x0000000 -g led_off.o -o led_off_elf
        arm-linux-objcopy -O binary -S led_off_elf led_off.bin
clean:
        rm -f   led_off.bin led_off_elf *.o

/*******************************************************************/

二、使用Jlink下载led_off.bin到nand flash(参考烧写Uboot方法)

5.1 打开 J-Link Commander,输入-r
5.2 speed 12000
5.3  J-Link Commonder 输入loadbin f:\init.bin 0
5.4  setpc 0
5.5  g
5.5  h
5.6  J-Link Commonder 输入loadbin f:\u-boot.bin_openjtag 0x33f80000
5.7  setpc 0x33f80000
5.8  g
5.9  h
5.10 J-Link Commonder 输入loadbin f:\u-boot.bin  0x30000000
******************************************************************************************
J-Link Commonder 输入loadbin f:\led_off.bin  0x30000000,即可以烧写汇编程序
******************************************************************************************
5.11 g
5.12 h
5.13 在secretcat 中输入nand scrub
5.14 y
5.15 在secretcat 中输入nand erase 0 0x40000
5.16 在secretcat 中输入nand write.jffs2 30000000 0 0x40000
5.17 重新启动进入nand flash

三、开发板重启即可。

 


 

 

 

posted @ 2013-05-10 21:03  javawebsoa  Views(198)  Comments(0Edit  收藏  举报