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

    三、开发板重启即可。


     

  • 相关阅读:
    怎样让人的一生价值最大
    [LeetCode][Java] Minimum Depth of Binary Tree
    KVC和KVO
    js获取单独一个checkbox是否被选中
    It's not a Bug, It's a Feature! (poj 1482 最短路SPFA+隐式图+位运算)
    超声波测距温度补偿
    系统封装接口层 cmsis_os
    STM32F4XX高效驱动篇2 I2C
    Stm32f103 ADC 学习笔记
    Stm32f103 DAC 学习笔记
  • 原文地址:https://www.cnblogs.com/javawebsoa/p/3071959.html
Copyright © 2011-2022 走看看