Serial port issues

Michel Macena mmacena.eng at gmail.com
Wed Aug 7 21:13:02 UTC 2019


just to update, I've tried different ways to get something from the serial
port.
when  i use open (from unistd.h) to open the serial port it returns "-1".I
also tried the getchark() function from
https://github.com/RTEMS/rtems/tree/master/cpukit/libcsupport/src
repository but it also returns "-1". I forgot to say before but I'am using
a board that was that
has two UART channels, Channel A for console e and Channel B for debugging.
I load the programs and send the command to execute through GDB connect to
the port B.
I get the board responses in the channel A. I can make the board print
properly in console (ch A) but when
I ask to getc(), getchark(),fgets() or scanf() it does not get the
character or string.

Thanks.


Em seg, 5 de ago de 2019 às 17:55, Michel Macena <mmacena.eng at gmail.com>
escreveu:

> Hi, I'm working with an ERC 32 target board and would like
> to read strings or any characters in the serial input (UART).
> regular C printf() function works well but when I try
> fgets(), scanf() or fgetc() the board just does not get the string
> or any character, is there any RTEMS specific ways to get
> characters or strings through the standard serial port ?
>
> a sample code:
>
> #include <bsp.h>
> #include <stdlib.h>
> #include <stdio.h>
>
> char line[6];
>
> rtems_task Init(
>   rtems_task_argument ignored
> )
> {
>
>     fgets(line,6,stdin);
>     printf( "string: %s\n",line );
>
> }
>
> /* configuration information */
>
> #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
> #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
>
> #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
> #define CONFIGURE_MAXIMUM_TASKS 1
>
> #define CONFIGURE_INIT
>
> #include <rtems/confdefs.h>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20190807/072178f2/attachment-0002.html>


More information about the users mailing list