This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
About i386 pc serial device problem
- To: "ecos-discuss" <ecos-discuss at sources dot redhat dot com>
- Subject: [ECOS] About i386 pc serial device problem
- From: "John" <john at imining dot com dot tw>
- Date: Thu, 8 Mar 2001 19:01:57 +0800
Hi all,
I have built eCos to directly boot from floppy without gdb stub.
I can let printf() to show on screen now. (thanks for your helps)
But I also want to use the serial port.
I build eCos with i386 pc target default template.
Change CYG_HAL_STARTUP to FLOPPY
Uncheck CYGSEM_HAL_I386_PC_DIAG_SERIAL1
Check CYGSEM_HAL_I386_PC_DIAG_SCREEN
Check CYGPKG_IO_SERIAL_I386_PC
Check CYGPKG_IO_SERIAL_I386_PC_SERIAL0
I connect COM1 to Windows hyper terminal.
But it does not work.
Nothing show on the screen and hyper terminal.
The code in my thread function is:
cyg_io_handle_t handle;
Cyg_ErrNo err;
const char test_string[] = "serial example is working correctly!\n";
cyg_uint32 len = strlen(test_string);
printf("Starting serial example\n");
err = cyg_io_lookup( "/dev/ser0", &handle );
if (ENOERR == err) {
printf("Found /dev/ser0. Writing string....\n");
err = cyg_io_write( handle, test_string, &len );
}
if (ENOERR == err) {
printf("I think I wrote the string. Did you see it?\n");
}
printf("Serial example finished\n");
Thanks in advance.
----
謝豪哲
John Hsieh
發現者國際股份有限公司
iMining Technology Co., Ltd.
john@imining.com.tw
TEL: 886-2-27235122
FAX: 886-2-27232287
www.imining.com.tw