Forum Discussion
Altera_Forum
Honored Contributor
16 years agoUART application on NEEK
Hi, I use ocm_mmu_spi from Hippo and I'm able to use the UART for console, or if I use JTAG console, I can print on the UART using "/dev/ttyS0". So UART is working properly. But I would...
Altera_Forum
Honored Contributor
16 years agoI 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