Setup of serial channel

I am new to use the netos63 software. I have tried to use the termios drivers without success. I have used the template software.
void applicationStart (void)

{
struct termios term;
int fd;
char message[] = "Print with termios
";

printf ("Print with printf

");
tx_thread_sleep(10);

fd = open("/com/0", (O_RDWR | O_NONBLOCK));
if (fd < 0)
{
    printf("Error in open() file = %d

", getErrno());
}
if (tcgetattr(fd, &term) < 0)
{
printf("Error in tcgetattr() = %d
", getErrno());
}

term.c_iflag = 0;
term.c_oflag = 0;
term.c_cflag &amp;= ~CSIZE;
term.c_cflag |= CS8;        // 8 bit
term.c_cflag &amp;= ~CSTOPB;    // 1 stop bit
term.c_cflag &amp;= ~PARENB;    // No parity
term.c_cflag |= CRTS;       // Enable RTS for input flow control
term.c_cflag |= CCTS;       // Enable CTS for output flow control
term.c_xflag = 0;
term.c_cc[0] = 0;
term.baud = 9600;

if (tcsetattr(fd, TCSANOW, &amp;term) &lt; 0)
{
    printf("Error in tcsetattr() = %d

", getErrno());
}

if (write(fd, message, strlen(message)) &lt; 0)
{
    printf("Error in write() = %d

", getErrno());
}

printf ("Print with printf again

");
tx_thread_suspend(tx_thread_identify());
}

The printf’s print the text.
The open() comes with errno 16 (mount device busy) and tcgetattr and tcsetattr will therefore come with error 22 (invalid argument).
I suppose that this means that the /com/0 has already been opened, but I am not able to close it first because I don’t know the file descriptor.
The termios API’s are used, because they are defined in the bsp connectme platform as default.
What is the problem?

Try to set the flags before opening the COM port. And also comment the COM0 -lines from appconf.h so the debugger won’t use them in its own purposes. (COM0 is for debugger serial connection ind default).