Help needed: EFI debug

Heinrich Schuchardt xypron.glpk at gmx.de
Fri Jan 13 15:52:27 CET 2023


On 1/13/23 14:47, Michael Lawnick wrote:
> Hi,
>
> I am trying to printf-debug EFI execution triggered by Linux call.
> Specifically I remove a persistent variable via Linux console and want
> to follow execution. Without any printf() this works fine. I need this

Hello Michael,

U-Boot does not implement SetVariable() at runtime yet.

> to refine existing implementation of saving variables to SPI flash.
>
> While printf() works in U-Boot startup context it leads to crash when
> EFI function was called from Linux. Same for putc().
> Next I tried efi_st_printf() but this already crashes in U-Boot startup
> context.
> How do you achieve printf() debugging in this scenario?
> Which initialization steps are required to get efi_st_printf() working
> outside self_test context?
>
> TIA & KR
> Michael

U-Boots print functions can only be used before ExitBootServices().
Don't use any library function that is not declared __efi_runtime after
this point.

At UEFI runtime you might be able to invoke a Linux syscall. I never
tried it.

Or move the debug output into a different UEFI variable using

* efi_var_mem_del() to delete the existing instance
* efi_var_mem_ins() to create the new instance

Both calls are needed.

Best regards

Heinrich


More information about the U-Boot mailing list