FX30 UART on IoT expansion card slot


#1

Hello all,
How to set up UART on FX30 IoT expansion card slot in my own application ?
What I do wrong, still I have 115200bps linux Yocto console ?

I made AT command AT!MAPUART=17,1 by USB AT port.
In my Component.cdef file I added:
requires:
{
device:
{
[rw] /dev/ttyHS0 /dev/ttyHS0
}
}

UART initial code:

#define BAUDRATE B19200
struct termios newtio;
int tty_fd = -1;

bool serial_OpenPort ( void )
{
tty_fd = open("/dev/ttyHS0", O_RDWR | O_NOCTTY);
if(tty_fd < 0) {
return false;
}

bzero(&newtio, sizeof(newtio));
cfmakeraw(&newtio);
newtio.c_cflag = BAUDRATE | CS8 | ~CRTSCTS | CLOCAL | CREAD;
newtio.c_iflag = IGNPAR;
newtio.c_oflag = 0;
newtio.c_lflag = 0;
newtio.c_cc[VTIME] = 0;
newtio.c_cc[VMIN] = 5;
tcflush(tty_fd, TCIFLUSH);
tcsetattr(tty_fd, TCSANOW, &newtio);

write(tty_fd, “TEST”, 4);

return true;
}


#2

I have little progress, I find that the default on IoT expansion slot is connected with UART 2 then:

  1. I chenged UART2 mode to: AT!MAPUART=17,2
  2. In file Component.cdef changed to: [rw] /dev/ttyHSL1 /dev/ttyHSL1
  3. In function: tty_fd = open("/dev/ttyHSL1", O_RDWR | O_NOCTTY);

Now I can send chars to the UART 2 and observe on Tx my sended chars, but the speed is incorrect is about 4 000 000 bps no 19200.
Unfotunetly I find next problem with GPIO service when I change UART 2 mode, my application report the error:

Jan 6 00:02:22 | gpioService[538]/sysfsGpio T=main | gpioSysfsUtils.c ExportGpio() 106 | Failed to export GPIO 47. Error Operation not permitted
Jan 6 00:02:22 | gpioService[538]/sysfsGpio T=main | gpioSysfsUtils.c gpioSysfs_SessionOpenHandlerFunc() 1061 | Unable to export GPIO gpio47 for use - stopping session

I finds some information on forum about muxCtrlService but I dont know how to use this on FX30 gateway
Please any help.


#3

This is really a product-specific question. Have you tried contacting Sierra Wireless for support with your FX30?