zoukankan      html  css  js  c++  java
  • 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

    三、开发板重启即可。


     

  • 相关阅读:
    iOS 新建xib文件时,最外层view的约束问题
    React native 无法弹出调试控件的问题
    从GitHub下载demo时遇到的依赖问题
    Mac 解决 Sourcetree 同步代码总需要密码的问题
    Mac 安装JRE 1.8
    正则表达式-- (.*?) 或 (.*+)
    字符串内有多个#号,每俩#号为一组,JavaScript 截取每组#号之间的字符
    Js/jQuery实时监听input输入框值变化
    Redis设置密码
    redis本机能访问 远程不能访问的问题
  • 原文地址:https://www.cnblogs.com/javawebsoa/p/3071959.html
Copyright © 2011-2022 走看看