This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Using the Serial A on an eb40a board for both read and write!
- From: Jesper Jensen <jjen01 at kom dot auc dot dk>
- To: ecos-discuss at sources dot redhat dot com
- Date: Tue, 02 Nov 2004 11:13:05 +0100
- Subject: [ECOS] Using the Serial A on an eb40a board for both read and write!
Hi all,
I'm writing an aplication for the eb40a eveluation board.
I would like to use the Serial A connection for communication in both
directions.
I have a functioning system with Redboot installed in ROM.
I prefer to use the command-line configuration tool ecosconfig, but I
have tried to get the
serial-drivers into eCos using configtool.
I understand that I'm not able read from the keyboard when using
arm-elf-gdb. Therefore
I download the program to target using arm-elf-gdb but instead of typing
'c' I quit arm-elf-gdb,
start minicom and do a go 0xc040. If anybody has a more elegant solution
I'm interested...
I've tried the following both using /dev/ser0, /dev/tty0
void thread_B(cyg_addrword_t data)
{
int delay=100/THREAD_B_FREQ;
const char buf[]="Test\n";
cyg_io_handle_t handle;
cyg_uint32 len = 5;
setup_EBI();
if(cyg_io_lookup("/dev/ser0", &handle) < 0){
printf("I/O-handle 'ser0' not available!\n");
}
else printf("ser0 Works!\n");
for (;;) {
cyg_mutex_lock(&cliblock);{
cyg_io_write(&handle, buf, &len);
printf("Thread B\n");
}
cyg_mutex_unlock(&cliblock);
cyg_thread_delay(delay);
}
}
I get "ser0 Works!" So I get a handle all right, but the thread stalls
when doing cyg_io_write. I haven't tried reading the keyboard yet.
IN OTHER WORDS can anybody prowide me the commands to make eCos
right (ecosconfig new eb40a && ecosconfig add XXX && ecosconfig tree &&
make)
and a program with this functionality just using the Serial A port:
int main(){
char input;
printf("\n write a char!\n );
scanf("%c",&input);
printf("\n you typed %c",input);
}
Well thangs for now!
Jesper
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss