dingit1024 发表于 2013-7-16 15:06:53

想在TQ335x的uboot上运行个hello world程序

本帖最后由 dingit1024 于 2013-7-16 15:21 编辑

有没有在uboot上做裸机程序的,如果在main中直接return 0返回,编译成.bin、烧写,运行后出现rc = 0x0.应该是执行成功吧。

在uboot上运行个hello world程序,却没有反应。按照http://hi.baidu.com/316194566/item/25d06c57549f28dcd58bac70这个指导。
void (*show)(char*,...) = 0x80810158;
int main(void)
{       
      show("hello.world!\n");
      return 0;
}
在编译后的uboot中system.map找到的printf地址,编译生成了bin。但是在开发板运行没反应,不知为何?
TQ3358# tftp 0x82000000 demo.bin
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.8; our IP address is 192.168.1.6
Filename 'demo.bin'.
Load address: 0x82000000
Loading: ###
done
Bytes transferred = 32868 (8064 hex)
TQ3358# go 0x82000000
## Starting application at 0x82000000 ...

C调的笨娃娃 发表于 2013-7-16 15:38:24

我用SD卡试过starterware

亚瑟王 发表于 2013-7-16 16:32:03

你在u-boot试一下你的show函数看能否成功?
不推荐这种做法,建议将其编译到自身的镜像中。

dingit1024 发表于 2013-7-17 12:02:38

C调的笨娃娃 发表于 2013-7-16 15:38 static/image/common/back.gif
我用SD卡试过starterware

恩恩,starterware很好用。甚至在TQ3358上成功移植starterware的led程序。老大说starterware中的init.S太过于简单,没对RAM初始化,因此放弃这种方案。
页: [1]
查看完整版本: 想在TQ335x的uboot上运行个hello world程序