[U-Boot] [U-Boot-Users] standalone code

Hello,
I want to use the u-boot drivers such as gpio and spi on a standalone application. What do I need to modify in the Makefile to build and link my code with the rest of the U-boot code in order to include those drivers in my application? because when I try to compile my code, it shows some errors of undefined references. Is it possible to run that application automatically when the u-boot starts? maybe from the SD card?
Thanks.Diego Preciado

Dear Diego Preciado Barón,
In message BAY170-W1374704B4379134E5D85C32C82D0@phx.gbl you wrote:
I want to use the u-boot drivers such as gpio and spi on a standalone application.
Why do you want to do this from a standalone app, instead from code linked with the U-Boot image?
What do I need to modify in the Makefile to build and link my code with the rest of the U-boot code in order to include those drivers in my application? because when I try to compile my code, it shows some errors of undefined references.
You can of course link statically against U-Boot, but then you lose all kind of compatibility, i. e. your app will oly run with this very U-Boot image, and will crash in all kinds of horrible ways when you attempt to run it in other environments.
In theory we could of course extend the list of exported functions, but this is something we don't want, as this would weaken the GPL nature of the code.
Is it possible to run that application automatically when the u-boot starts? maybe from the SD card?
Yes, of course - you can run any command or command sequence automatically, either as part of your preboot settings, or as bootcmd.
Best regards,
Wolfgang Denk
participants (2)
-
Diego Preciado Barón
-
Wolfgang Denk