Search code examples
beagleboneblacku-bootbare-metalbeagleboard

U-boot: error when trying to include common.h


First of all, I'm trying to compile a C code to run on BeagleBone Black baremetal, through u-boot console.

Codes without includes compile and run just fine, but I'm trying to transmit some information through serial port and I'm not being successfull. So i tried to use the printf implementation from u-boot which seems to be accessed by including the header common.h, but the compiller is throwing a lot of errors when I try it.

I saw that U-boot has a printf implementation on one of the headers(common.h) and I was trying to use it, so I've included it on my source code as the following image shows:

enter image description here

and then I specified the path to the file.

but it shows an error related to not finding omap.h, it's supposed to be on asm/arch/include/omap.h but i don't have this path on my U-boot folder, so I tried to look for an omap.h on the folder and found these ones:

enter image description here

So, I've included the one who ends with arm-am33xx (since the board is am335x), and changed the path of the file who was looking for it, but now my compiller is showing a bunch of errors that I don't understand why:

enter image description here

Am I doing something wrong??


Solution

  • If you wish to write bare metal applications that are then launched by U-Boot AND also leverage the limited API that U-Boot provides for this, please see https://source.denx.de/u-boot/u-boot/-/blob/master/doc/README.standalone?ref_type=heads and https://source.denx.de/u-boot/u-boot/-/blob/master/examples/standalone/hello_world.c?ref_type=heads for how this is done. You cannot use <common.h> as that is for U-Boot itself.