I had already tried Hello and it worked. But I have more difficlulties when static or dynamic libraries are needed.
I use ocm_spi_mmu and I wonder if the uclibc is really used?
I can use under uClinux the ttyS0 device, for instance
> cat hello.txt > /dev/ttyS0
and it prints to RS232 port (connected to my PC).
Anyway, when I wrote a small C code for printing a sentence :
# include <stdio.h># include <string.h>
char msg[]="Bonjour le monde";
int main(void)
{
FILE *fp;
fp = fopen("/dev/ttyS0", "r+");
if(fp)
{
printf("Ouverture du port reussit\n");
fwrite(msg, strlen(msg), 1, fp);
fprintf(fp, "Closing the UART file.\n");
fclose(fp);
}
else
{
printf("Erreur à l ouverture de /dev/ttyS0\n");
return (1);
}
return(0);
}
The code is correct (I can not tested on my PC) ?
I have no error and receive nothing at RS232 port ???
Is there a conflict with the ttyS0 already open at kernel level?
thanks