Skip to contentSkip to conversation

printf works but how can I make debug() printed to serial port console?

DISCUSSION Chan Kim 1 participant 2 messages Dec 22, 2021

lore
Share & tools
lore

Chan Kim

author
#0 lore raw

Hello all,

I'm trying to boot from RAM using SPL only.

(Another scp processor loads the FIT image to the SDRAM before starting u-boot-spl is started)

Since the debugger doesn't work yet, I have to rely on prints to debug.

The printf works fine (I once asked about initializing serial port here, and later found serial_init is done in board_init_f ).

I tried to make debug(xxx) printed to serial port but couldn't figure out how to do it.

I tried

1. Adding #define DEBUG to the relevant source file

2. Giving DEBUG=1 in the make command (or CFLAGS=-DDEBUG)

But it doesn't work (of course I can change debug to printf to see it).

How can I make debug( ) macro output to the serial port?

Thank you!

Chan Kim

#1 lore raw

As the document said, I tried added "#define DEBUG" in each file but it doesn't work.
If I add "#define debug printf" then, of course debug() is printed.

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Chan Kim
Sent: Wednesday, December 22, 2021 3:13 PM
To: U-Boot Mailing List <[email protected]>
Subject: printf works but how can I make debug() printed to serial port console?

Hello all,

I'm trying to boot from RAM using SPL only.

(Another scp processor loads the FIT image to the SDRAM before starting u-boot-spl is started)

Since the debugger doesn't work yet, I have to rely on prints to debug.

The printf works fine (I once asked about initializing serial port here, and later found serial_init is done in board_init_f ).

I tried to make debug(xxx) printed to serial port but couldn't figure out how to do it.

I tried

1. Adding #define DEBUG to the relevant source file

2. Giving DEBUG=1 in the make command (or CFLAGS=-DDEBUG)

But it doesn't work (of course I can change debug to printf to see it).

How can I make debug( ) macro output to the serial port?

Thank you!

Chan Kim