一、編寫源代碼
源代碼:
/*******************************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
三、開發板重啟即可。
?
?
?
?
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
