[U-Boot] Problems with NetConsole II

Hi, I'm trying to run NetConsole, listen for incoming messages for 1 sec, and continue according to the message type. On the other side (PC) i'm sending a broadcast message on port 6666 every 250 ms. What i see is a very unstable behaviour Sometimes i get nothing, sometime only part of the message, and sometimes it fails to continue.. I also tried to listen for 5 sec, and it looks a little better, but still unstable behaviour
The code i use is: setenv("stdin", "nc"); printk("waiting for network message...\n"); timeStart = get_timer(0); while(1) { c = getc(); if(c != 0) { printk("%c", c); buffer[index++] = c; } if(index > 127) break; if((get_timer(0) - timeStart) > 5000) break; }
Thanks, Alex

Dear alex889,
In message 25799667.post@talk.nabble.com you wrote:
Hi, I'm trying to run NetConsole, listen for incoming messages for 1 sec, and continue according to the message type. On the other side (PC) i'm sending a broadcast message on port 6666 every 250 ms. What i see is a very unstable behaviour
Whiich exact version of U-Boot are you running?
Which architecture / cpu / board is this?
Is nc working stable for you in interactive mode?
Are you for example able to copy & paste a long line (say, > 70 characters) as input, and is this read correctly by U-Boot?
Sometimes i get nothing, sometime only part of the message, and sometimes it fails to continue..
"It fails to continue" makes zero sense to me. What fails?
if((get_timer(0) - timeStart) > 5000)
Did you never wonder what the argument to get_timer() is used for?
Why not simply
if (get_timer(timeStart) > 5000)
?
Best regards,
Wolfgang Denk
participants (2)
-
alex889
-
Wolfgang Denk