Rajavarman Rajavarman - 1 year ago 93
C Question

How to add user defined function in U-Boot?

Here i just want to add one function in u-boot. I need to call one function in start_armboot(). For example,

This is hell.h header file.

extern void hello(void);

This is hell.c file.


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

This hell.c is added into the common folder,and hell.h is added into the include folder. And then i include this hell.h into lib_arm/board.c. Finally i called hello() function from start_armboot() in lib_arm/board.c. Whenever i compiling it will show the error.

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

Is there any other procedure to add function in u-boot other than this? please help me out.

Answer Source

You must modify the makefile inside common folder.

You can simply add

obj-y += hell.o
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download