Need Information On UART

Hello,

I had setup Legato (in linux), managed to connect to AirVantage and executed few of the sample applications.
Received 3 breakout-board few day ago and executed the GPIOCF3Demo and manage to capture some signal on GPIO 21 (IOT1_GPIO4)…
Now I need do connect mangoh to RS232 via IOT0 (2 wires) for a start.
The final intention is to connect to IOT0, IOT1 and IOT2.
Search all over for information on how to do it, but fail.
If you any information, can you guide me through?
Thanks in advance,
CSLEE

Hi CSLEE,

Eventually we intend that there be an intelligent service which queries an IoT card and then provides access to the required buses. For now you have to control the muxing manually. This is can be done using the MuxControl app which is part of mangOH.

FYI: I have considerable modifications to the GpioExpander and MuxControl mangOH apps pending in our internal code review system. I expect that those changes will be approved and pushed into github tonight.

To route UART 1 to IoT slot 0, you need to call the Iot0Uart1On() function declared in mangoh_muxCtrl.api and defined in mangoh/apps/muxControl/muxCtrlService/muxCtrl/muxCtrl.c. You can look at mangoh/apps/muxControl/tools/muxCtrlTools.adef for an example of how to bind to the MuxControl service.

For IoT slots 1 and 2, there are similar functions Iot1Uart1On() and Iot2Uart2On(). Please be aware that there are 2 UARTs so it will never be possible to have a UART connected to all 3 IoT slots simultaneously.

1 Like

Hello again CSLEE,

Although my previous message is accurate, I don’t think it will solve your problem. I forgot that UART 1 may not even be under control of the application processor. In order to give control of UART 1 to the application processor we need to send an AT command to the modem.

The mangOH Fundamentals - Linux CLI document describes how to send an AT command in section “7.1.2 Connect to AirVantage” on page 28.

In our case we want to send a different AT command. The AT command we want to sent is briefly described on this Legato HOWTO - Customize UART page.

No documents, just the instructions!

  1. in a terminal on the mangOH, run microcom -E /dev/ttyAT
  2. type the command AT!MAPUART? to show the current UART configuration. The value is interpreted as UART1Routing,UART2Routing.
  3. type the command AT!MAPUART=17,1 to route UART1 to “Customer Linux application”
  4. type in the command AT!MAPUART? to confirm that the setting has changed
  5. press ctrl-x to exit microcom
  6. enter the command reboot -n to reboot the system

Now UART 1 should be available for use by your application. It will default to Iot slot 0, but you can use the instructions from my previous message to disable UART1 or route it to IoT slot 1.

1 Like

Hello dfrey,
Thanks for the info. I will work on it.
I know that I can’t connect IOT0 and IOT1 UART simultaneously. I think it is possible to switch between the two by application(software). I would connect devices that used less frequently and also not simultaneously.
Thanks again,
CSLEE

Hello @dfrey,

I was attempting to get into the UART and found your post. I tried to follow your instructions but what was returned was “-sh: mircom: not found”

I tried sudo… "sudo: not found:

apt-get… "apt-get: not found

Any help would be great,

Thanks
Kas

P.s. My final goal is to read data from a UART port and posting the data to AirVantage.

It is microcom and not micrcom

1 Like

any sample code to initialize uart, write and read value from external uart communication like RS232

You can see here

https://source.sierrawireless.com/resources/airprime/application_notes_and_code_samples/airprime_wp_series_and_fx30_uart_to_tcp_app/