mini2440燒寫裸機程式(linux+JLink)

來源:互聯網
上載者:User

一、編寫原始碼

原始碼:

/*******************************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

三、開發板重啟即可。

 

 

 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.