您的位置:首页 > 其它

U_BOOT移植时出现相关错误时解决办法

2011-11-21 10:45 465 查看
1.board.c:127: error: inline function 'coloured_LED_init' cannot be declared weak

board.c:129: error: inline function 'red_LED_on' cannot be declared weak

board.c:131: error: inline function 'red_LED_off' cannot be declared weak

board.c:133: error: inline function 'green_LED_on' cannot be declared weak

board.c:135: error: inline function 'green_LED_off' cannot be declared weak

board.c:137: error: inline function 'yellow_LED_on' cannot be declared weak

board.c:139: error: inline function 'yellow_LED_off' cannot be declared weak

board.c:141: error: inline function 'blue_LED_on' cannot be declared weak

board.c:143: error: inline function 'blue_LED_off' cannot be declared weak

make[1]: *** [board.o] 错误 1

make[1]: Leaving directory `/root/workspace/u-boot-2009.08/lib_arm'

make: *** [lib_arm/libarm.a] 错误 2

出现错误,内嵌函数不能被声明为weak属性,打开lib_arm/board.c,定位到127行开始,将其注释掉,修改后结果如下:

void inline __coloured_LED_init (void) {}

//void inline coloured_LED_init (void) __attribute__((weak, alias("__coloured_LED_init")));

void inline __red_LED_on (void) {}

//void inline red_LED_on (void) __attribute__((weak, alias("__red_LED_on")));

void inline __red_LED_off(void) {}

//void inline red_LED_off(void) __attribute__((weak, alias("__red_LED_off")));

void inline __green_LED_on(void) {}

//void inline green_LED_on(void) __attribute__((weak, alias("__green_LED_on")));

void inline __green_LED_off(void) {}

//void inline green_LED_off(void)__attribute__((weak, alias("__green_LED_off")));

void inline __yellow_LED_on(void) {}

//void inline yellow_LED_on(void)__attribute__((weak, alias("__yellow_LED_on")));

void inline __yellow_LED_off(void) {}

//void inline yellow_LED_off(void)__attribute__((weak, alias("__yellow_LED_off")));

void inline __blue_LED_on(void) {}

//void inline blue_LED_on(void)__attribute__((weak, alias("__blue_LED_on")));

void inline __blue_LED_off(void) {}

//void inline blue_LED_off(void)__attribute__((weak, alias("__blue_LED_off")));



2.

cpu/arm920t/start.o: In function `start_code':

/root/workspace/u-boot-2009.08/cpu/arm920t/start.S:117: undefined reference to `coloured_LED_init'

/root/workspace/u-boot-2009.08/cpu/arm920t/start.S:118: undefined reference to `red_LED_on'

make: *** [u-boot] 错误 1

出现错误coloured_LED_init'未定义。打开cpu/arm920t/start.S,搜索“coloured_LED_init”定位到117行,找到如下代码:

bl coloured_LED_init

bl red_LED_on

将其注释掉

//这两行是AT91RM9200DK开发板的LED初始化,注释掉

//bl coloured_LED_init

//bl red_LED_on

然后执行清除、编译命令
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐