How does uboot print information during board bring up

During bootup of the target board we see uboot (bootloader) printing some information such as Image name, Image type, Load Address, Verifying checksum etc on the console. Which printing mechanism does it use? Does it use something like printk or it has its own definition for printing info even before kernel boots up? Where can I find the code for its printing implementation?


In the normal U-boot boot process,a limited amount of information is printed to the console. It use the the same kind of functions to print information as we use during the C programming.

u-boot use printf and puts to print the information on the console. you can find the same function implementations in the u-boot source code (u-boot boardfile and drivers).

There are a lot of commands which you can try from u-boot command prompts for more information.

To enable more messages you can either:

  • Using debug_cond (cond, fmt, args...): if you define some cond, once it is met, the U-boot will print out this message.
  • Using debug(fmt, args...): you can define DEBUG in the file u-boot- include/configs/<boardfile>_common.h (like in my case mx6_common.h), once do that and recompile the code, the U-boot will print out all debug message
  • Note: If you put too much debug into the code, it might make u-boot hang up.


    如果你想获得关于uBoot的信息,例如它打印到哪里或者它的值是什么,你可以使用'printenv'命令并且用'setenv'命令改变它们,你可以在启动时输入uBoot(中断内核启动) '命令。

    链接地址: http://www.djcxy.com/p/66806.html

    上一篇: 如何使用GRUB 0.97 menu.lst将参数传递给内核?

    下一篇: 如何在开机过程中uboot打印信息