public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* re:Re: [ECOS] Serial Port in non-blocking mode
@ 2005-04-22  9:20 Gatien Gillon
  2005-04-22 21:47 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: Gatien Gillon @ 2005-04-22  9:20 UTC (permalink / raw)
  To: ecos-discuss

I'm getting 0x0 instead of the caracter ... *z = 0x0 when I put a breakpoint on the "if( *z >= 'A' && *z <= 'z' )" (see lower)

In my main I have :

cyg_io_set_config(ser_handle, 0x1081, &zero, &l32);
while(1)
	{
  		t+=dt;
  		if(t>=900)
  			dt = -step;
  		if(t<=100)
  			dt = step;
  		HAL_WRITE_UINT16 (0xFFFAC008, t); // write DAC
  		readch();
	  	/*if(var1)
	  		printf("var 1 : %d\n", var1);*/
	  	
	}

void readch()
{
	int i;
	
	cyg_io_read( ser_handle, z, &l );
	
	if( *z >= 'A' && *z <= 'z' )
	{
		printf(z);
		line[cnt] = *z;
		cyg_io_write( ser_handle, z, &l );
	
		if(cnt<10)
			cnt++;
		if(*z == '\n')
			exec=1;
		
		if(exec)
		{
			exec = 0;
			exec_cmd(line);
			cnt = 1;
		}
	}
}



I'm getting 0x0 instead of the caracter ... *z = 0x0 when I put a breakpoint on the "if( *z >= 'A' && *z <= 'z' )"

>
>----- Original Message ----- 
>From: "Andrew Lunn" <andrew@lunn.ch>
>To: "Gatien Gillon" <ggillon@ulb.ac.be>
>Cc: <ecos-discuss@sources.redhat.com>
>Sent: Thursday, April 21, 2005 5:39 PM
>Subject: Re: [ECOS] Serial Port in non-blocking mode
>
>
>> On Thu, Apr 21, 2005 at 05:02:09PM +0200, Gatien Gillon wrote:
>>> I'm trying to make my AT91EB55 board communicate with a PC, when using 
>>> the
>>> cyg_io_read function the program waits for an input wich is not what i
>>> want. In non blocking mode I keep on getting 0x0's when reading the port
>>> even if I have sended some characters.
>>
>> Are you getting 0x0 as well as, or instead of?
>>
>>        Andrew
>>
>> -- 
>> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
>> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>> 
>
>
>
>-- 
>Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
>and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
>



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re: [ECOS] Serial Port in non-blocking mode
  2005-04-22  9:20 re:Re: [ECOS] Serial Port in non-blocking mode Gatien Gillon
@ 2005-04-22 21:47 ` Andrew Lunn
  2005-04-23  0:21   ` [ECOS] i386 'make' problem Gonçalo Antunes
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2005-04-22 21:47 UTC (permalink / raw)
  To: Gatien Gillon; +Cc: ecos-discuss

On Fri, Apr 22, 2005 at 10:52:23AM +0200, Gatien Gillon wrote:
> I'm getting 0x0 instead of the caracter ... *z = 0x0 when I put a breakpoint on the "if( *z >= 'A' && *z <= 'z' )" (see lower)
> 
> void readch()
> {
> 	int i;
> 	
> 	cyg_io_read( ser_handle, z, &l );
> 	
> 	if( *z >= 'A' && *z <= 'z' )

From the documentation:

// Read data from a device 
Cyg_ErrNo cyg_io_read( 
    cyg_io_handle_t handle,
    void *buf,
    cyg_uint32 *len )

This function receives data from a device. The desired size of data to
receive is contained in *len and the actual size obtained will be
returned in the same place.

So you first need to set l to 1 before calling the function. I cannot
see this in your code. Next problem is that you have the device in
none blocking mode. So say it has nothing in its buffer. So it sets l
to 0 and returns. Your code does not look at the value of l to
determine how many charactors it has returned. You always assume it
has returned a charactor, which is obviously false!

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ECOS] i386 'make' problem
  2005-04-22 21:47 ` Andrew Lunn
@ 2005-04-23  0:21   ` Gonçalo Antunes
  0 siblings, 0 replies; 3+ messages in thread
From: Gonçalo Antunes @ 2005-04-23  0:21 UTC (permalink / raw)
  To: ecos-discuss

Hi

I started my config.ecc with the i386realtek template.
added the HTTP, CPuload, FreeBSD, networking, and common ethernet packages..
and now I get an error on the 'make tests'.
I'm using the startup method 'FLOPPY' and I get the error:


/home/gmma/config_install/lib/vectors.o:/tmp/ccfRQjJM.s: undefined reference 
to 'hal_saved_interrupt_state'
make: leaving directory '/home/gmma/config_build'
collect2: ld returned 1 exit status


if  I  change the startup method to RAM, the error does not appear...
I really need to have it running from the FLOPPY...



Can you help?

Thank you very much.

Gonçalo Antunes.




-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-04-22 21:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-22  9:20 re:Re: [ECOS] Serial Port in non-blocking mode Gatien Gillon
2005-04-22 21:47 ` Andrew Lunn
2005-04-23  0:21   ` [ECOS] i386 'make' problem Gonçalo Antunes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).