天天看點

U_BOOT移植時出現相關錯誤時解決辦法

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

然後執行清除、編譯指令

繼續閱讀