您现在的位置: 主页 > 嵌入式开发入门到精通 > 单片机技术进阶 > TQ2440之uboot---6.运行U-boot目录examples中的hello_world.c -
本文所属标签:
为本文创立个标签吧:

TQ2440之uboot---6.运行U-boot目录examples中的hello_world.c -

来源: 网络用户发布,如有版权联系网管删除 2018-09-08 

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

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

本文引用地址: http://www.21ic.com/app/mcu/201806/764764.htm

同时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




              查看评论 回复



嵌入式交流网主页 > 嵌入式开发入门到精通 > 单片机技术进阶 > TQ2440之uboot---6.运行U-boot目录examples中的hello_world.c -
 

"TQ2440之uboot---6.运行U-boot目录examples中的hello_world.c -"的相关文章

网站地图

围观()