• 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

    三、开发板重启即可。


     

  • 相关阅读:
    基于NodeJS的全栈式开发
    Android 反编译apk 详解
    AngularJS 中文资料+工具+库+Demo 大搜集
    Mongodb集群搭建的三种方式
    Ubuntu下解决bash 没有那个文件或目录的方法
    ubuntu12.04 安装配置jdk1.7
    CentOS怎样查看系统信息
    Ubuntu 安装 Redis
    Redis快速入门
    js去掉双引号
  • 原文地址:https://www.cnblogs.com/javawebsoa/p/3071959.html
Copyright © 2020-2023  润新知