如何在U-Boot中添加用户定义的功能?

时间:2016-11-17 13:22:25

标签: c linux embedded embedded-linux u-boot

这里我只想在u-boot中添加一个功能。我需要在start_armboot()中调用一个函数。例如,

这是hell.h头文件。

extern void hello(void);

这是hell.c文件。

#include<stdio.h>
    #include<hell.h>

void hello(void)
{
    printf("Hello world");
}

将此hell.c添加到公共文件夹中,并将hell.h添加到include文件夹中。然后我将这个hell.h包含在lib_arm / board.c中。最后,我从lib_arm / board.c中的start_armboot()调用了hello()函数。每当我编译它都会显示错误。

lib_arm/libarm.a(board.o): In function `start_armboot':
/home/davinci-evm/U-Boot/lib_arm/board.c:389: undefined reference to `hello'
make: *** [u-boot] Error 1

除了这个之外,还有其他程序在u-boot中添加功能吗?请帮帮我。

1 个答案:

答案 0 :(得分:2)

您必须修改common文件夹中的makefile。

您只需添加

即可
obj-y += hell.o
相关问题