Skip to contentSkip to conversation

Problems with NetConsole II

U-Boot alex889 2 participants 2 messages Oct 8, 2009

lore
Share & tools
lore

alex889

author
#0 lore raw

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

Signature · 2 lines
View this message in context: http://www.nabble.com/-U-Boot--Problems-with-NetConsole-II-tp25799667p25799667.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
#1 lore raw

Dear alex889,

Quoted 7 lines · In message <[email protected]> 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?

Quoted 2 lines

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?

Quoted 1 line
	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

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Being schizophrenic is better than living alone.