public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] How to get the serialandle?
@ 2005-07-19  5:01 HARA@KGC
  0 siblings, 0 replies; only message in thread
From: HARA@KGC @ 2005-07-19  5:01 UTC (permalink / raw)
  To: ecos-discuss

Hello all. 

I want to transmit the program from the command line of REDBOOT and to
execute it. However, there is only one SERIAL PORT in hardware. The port
is used for debugging, diagnosis (gdb), and download in REDBOOT. 
After executing the downloaded application program, I want to use the
serial port from the RAM application. 
Handle of the serial port in VIRTUAL VECOTR TABLE was not able to be
obtained though the following sample program was made and executed as
processing done for that. 

//=== testSerial.c===//
//#include <cyg/kernel/kapi.h>
#include <cyg/io/io.h>
#include <cyg/infra/diag.h>

void cyg_user_start( void )
{
	cyg_io_handle_t tty_hdl;
	int err;
	char output_string[]="HElo There!!\n";
	cyg_uint32 output_len=sizeof( output_string);
	unsigned long inc=0,j=0;
	printf( " printf %d\n",j*2 );

	err =cyg_io_lookup( "/dev/ser0", &tty_hdl);

	if( err )
	{
		diag_printf( " Error /dev/tty0\n" );
		return;
	}
	err =cyg_io_write( tty_hdl, output_string, &output_len );
	if( err )
	{
		diag_printf( "Error /dev/tty0 write" );
		return;
	}

}

How can I obtain serialport handle? Is there information that relates to
it?
My best regards. 
--
C----------------------------
C  Keisoku-Giken Corp,
C  Yukihisa Hara(hara@kgc.co.jp)
C----------------------------





-- 
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] only message in thread

only message in thread, other threads:[~2005-07-19  5:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-19  5:01 [ECOS] How to get the serialandle? HARA@KGC

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).