当前位置:首页 > 单片机 > 单片机
[导读] 今天无竟中发现u-boot中还有一个examples目录,编译u-boot之后发现了好几个测试程序,如hello_world 。同时tq2440的bootloader中有选项可以下载程序sdram中并运行,[7] Download Program (uCOS-II or T

今天无竟中发现u-boot中还有一个examples目录,编译u-boot之后发现了好几个测试程序,如hello_world 。

同时tq2440的bootloader中有选项可以下载程序sdram中并运行,

[7] Download Program (uCOS-II or TQ2440_Test) to SDRAM and Run it。

这样如果hello_world可以直接在sdram中并跑起来的话,就省得每一次都要烧到nand flash中去了。

1. u-boot编译时,修改 ./example/Makefile

ifeq ($(ARCH),arm)
#LOAD_ADDR = 0xc100000
LOAD_ADDR =0x30000000
endif

原先的LOAD_ADDR=0xc100000没有在内存中所以程序跑不起来,修改LOAD_ADDR到内存的起始地址0x30000000.

2. 同时在烧写时也要修改下载的地址

假设在windows下用dnw烧写,则需要设置Options—>Download Address0x30000000, 下载的地址要和连接时的地址保持一致才能运行。

3. 程序运行打印信息如下:

Enter your selection: 7
USB host is connected. Waiting a download.

Now, Downloading [ADDRESS:30000000h,TOTAL:533]
RECEIVED FILE SIZE: 533 (0KB/S, 1S)
## Starting application at 0x30000000 ...
Example expects ABI version 3
Actual U-Boot ABI version 3
Hello World
argc = 1
argv[0] = "30000000"
argv[1] = ""
Hit any key to exit ...

## Application terminated, rc = 0x0


本站声明: 本文章由作者或相关机构授权发布,目的在于传递更多信息,并不代表本站赞同其观点,本站亦不保证或承诺内容真实性等。需要转载请联系该专栏作者,如若文章内容侵犯您的权益,请及时联系本站删除( 邮箱:macysun@21ic.com )。
换一批
延伸阅读
关闭