[U-Boot] printf in uboot

Simon Glass sjg at chromium.org
Mon Dec 12 20:51:15 CET 2011


Hi,

On Sun, Dec 11, 2011 at 11:51 PM, siddharth baisane
<nov15twentyten at gmail.com> wrote:
> hi,
>
> I am trying to print statement in uboot.
> but whenever I add *printf *statement board hangs.
> For example in *u-boot/lib_arm/board.c* i added prinf statement and board
> hags.
>
>
>
>
> void start_armboot (void)
> {
>    init_fnc_t **init_fnc_ptr;
>    char *s;
> #if defined(CONFIG_VFD) || defined(CONFIG_LCD)
>    unsigned long addr;
> #endif
>
>
> *printf("armboot starts\n");*
>    /* Pointer is writable since we allocated a register for it */
>    gd = (gd_t*)(_armboot_start - CONFIG_SYS_MALLOC_LEN - sizeof(gd_t));
>    /* compiler optimization barrier needed for GCC >= 3.4 */
>    __asm__ __volatile__("": : :"memory");
>
>    memset ((void*)gd, 0, sizeof (gd_t));
>    gd->bd = (bd_t*)((char*)gd - sizeof(bd_t));
>    memset (gd->bd, 0, sizeof (bd_t));
>
>    gd->flags |= GD_FLG_RELOC;
>
>    monitor_flash_len = _bss_start - _armboot_start;
>
>

You can use the CONFIG_PRE_CONSOLE_BUFFER feature to support printf()
prior to console_init_f().

Regards,
Simon

>
>
>
>
>
> Thanks
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>


More information about the U-Boot mailing list