[ECOS] e7t write problem
Vinayak P Risbud
vinayak@multitech.co.in
Mon Jul 1 07:42:00 GMT 2002
Hi,
I am working on ARM e7t board.
My problem is, I am not able write my data
on other serial port (i.e other than com port)
My code is like this :
int len, msglen;
char msg[] = "This is a test \n";
err = cyg_io_lookup("/dev/ser0", &handle);
if (err == ENOERR){
diag_printf("We got the handle \n");
diag_printf(" Handle %d \n", handle);
}
else{
diag_printf("opening port failed \n");
return;
}
len = sizeof(serial_info);
err = cyg_io_get_config(handle, CYG_IO_GET_CONFIG_SERIAL_INFO,
&serial_info, &len);
if (err != ENOERR)
{
diag_printf(" cant get serial config \n");
return;
}
diag_printf("Baud: %d, stop: %d, parity: %d \n", serial_info.baud,
serial_info.stop,
serial_info.parity);
len = sizeof(serial_info);
err = cyg_io_set_config(handle, CYG_IO_SET_CONFIG_SERIAL_INFO,
&serial_info,
&len);
diag_printf("set config error %d \n", err);
msglen = strlen(msg);
err = cyg_io_write(handle, msg, &msglen);
diag_printf(" write error %d \n", err);
if (err != ENOERR)
{
diag_printf(" cant write data %d \n", err);
return;
}
The output is
We got the handle
Handle 135472
Baud: 18, stop: 1, parity: 0
set config error 0
write error 0
--------------------------------
I have connected the e7t other port to PC's COM2 on a straight RS232
cable.
minicom on COM2 does not show any bytes receved
Any one helps me in fixing this problem ?
thanks and regards
Vinayak
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss
mailing list