[U-Boot-Users] A strange problem in lib_ppc/board.c

Frank Young young726 at hotmail.com
Wed Jun 23 06:51:15 CEST 2004


Hi,

I am trying to install u-boot on my Walnut with PPC405. After I load the 
program, the u-boot hangs without any output on the serial console. I 
located that the program is stopped at the point of where board_init_f() is 
called. More specifically,  the u-boot stop at
     for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
        if ((*init_fnc_ptr) () != 0) {
            hang ();
        }
    }

None of the function init_fnc_ptr pointing to has been called successfully. 
For test purpose, I wrote the following codes and put them in 
board_init_f():
    409     char s[10] = {'h','e','l','l','o'};
    410     if (s[0] == 'h') {
    411         s_putc('y');
    412     } else {
    413         s_putc('n');
    414     }

s_putc() is a function I created to send one char to UART. It has been 
tested working fine. But the u-boot hangs at line 410. Then I changed the 
test code to the following:
    409 //  char s[10] = {'h','e','l','l','o'};
    410     char s[10];
    411     s[0] = 'h';
    412     s[1] = 'e';
    413     s[2] = 'l';
    414     s[3] = 'l';
    415     s[4] = 'o';
    416     if (s[0] == 'h') {
    417         s_putc('y');
    418     } else {
    419         s_putc('n');
    420     }

Then the UART showed a  'y' on the screen, which is what I expected. So from 
the tests I did above, seems some thing wrong with the pointer. It also 
explains the reason why init_fnc_ptr didn't work well. But I couldn't figure 
out what is wrong. I would appreciate if any one can give me some clues.

Thanks!
Frank

_________________________________________________________________
Get fast, reliable Internet access with MSN 9 Dial-up – now 3 months FREE! 
http://join.msn.click-url.com/go/onm00200361ave/direct/01/





More information about the U-Boot mailing list