[U-Boot-Users] Side-effects when adding debug output

Hi everybody!
I have a little problem with u-boot and I don't know if I am the reason for it. It's the following:
I want to add some extra output to the functions do_bootm and do_bootm_linux because I have problems with the kernel parameters. So i added a few printf's to the functions mentioned above. The things that happen now, I do not understand:
Parameters of called functions (e.g. like the "int argc" parameter) suddenly change to random values. How could that be caused? Has it something to do with the stack (overflow or undefined behaviour when using "printf")? Or should I use any other function for creating output? (instead of using the BDI2k)
Greetings, Sebastian

In message 2D9AB865A49FD511914700105A0EF6790252BD31@morse.smart.lfk.eads.net you wrote:
I want to add some extra output to the functions do_bootm and do_bootm_linux because I have problems with the kernel parameters. So i added a few printf's to the functions mentioned above. The things that happen now, I do not understand:
Don't use printf for debugging here. Use a debugger.
Parameters of called functions (e.g. like the "int argc" parameter) suddenly change to random values. How could that be caused? Has it something to do with the stack (overflow or undefined behaviour when using "printf")?
Passing control to the Linux kernel invoves giving up more and more function in U-Boot, including things like overwriting the exception vector table or so. Adding printf() to the wrong place may have funny effects. You better know exactly what yuou are doing.
Or should I use any other function for creating output? (instead of using the BDI2k)
Use the BDI2000. That's what it was made for.
Best regards,
Wolfgang Denk
participants (2)
-
"Häpe, Sebastian, HRD/AB"
-
Wolfgang Denk