Where can I find the le_tty.api?


#1

Hi All,

I made a simple sample to do test a serial port.
But, there is a compile error due to can’t find le_tty.api’s components.
where can i find and use le_tty.api? It wasn’t included in the Legato AF 16.10.1.(or 16.10.3).

Thanks in advance,
Chase


#2

le_tty is a built-in part of the framework, so you shouldn’t need any “requires api” in your Component.cdef nor do you need to define any bindings in your .adef in order to use it.


#3

Hi Dfrey,

Thanks for the reply.
But, there is a compile error even though I didn’t define any ‘requires api’ and bindings in my Component.cdef and .adef.
Could you review the error message below?

chasejang@chasejang-ubuntu:~/Projects/Legato/legato/apps/sample/ttyTest$ make wp750x
mkapp -v -t wp750x
ttyTest.adef
Executing ninja build system…
$ ninja -v -d explain -f _build_ttyTest/wp750x/build.ninja
ninja explain: output _build_ttyTest/wp750x/app/ttyTest/staging/read-only/bin/ttyTest doesn’t exist
ninja explain: _build_ttyTest/wp750x/app/ttyTest/staging/read-only/bin/ttyTest is dirty
ninja explain: _build_ttyTest/wp750x/app/ttyTest/staging/info.properties is dirty
[1/3] /home/chasejang/legato/packages/legato.toolchain.1.7.3.fw_SWI9X15Y_07110900-wp85-wp750x-native-x86_64-201608171142/resources/native/wrapper/arm-poky-linux-gnueabi-gcc --sysroot=/home/chasejang/legato/packages/legato.toolchain.1.7.3.fw_SWI9X15Y_07110900-wp85-wp750x-native-x86_64-201608171142/resources/native/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -o _build_ttyTest/wp750x/app/ttyTest/staging/read-only/bin/ttyTest _build_ttyTest/wp750x/app/ttyTest/obj/ttyTest/_main.c.o -rdynamic -Wl,–enable-new-dtags,-rpath="$ORIGIN/…/lib" -L_build_ttyTest/wp750x/staging/read-only/lib “-L_build_ttyTest/wp750x/staging/read-only/lib” -lComponent_ttyTestComponent “-L_build_ttyTest/wp750x/staging/read-only/lib” -lComponent_ttyTestComponent “-L$LEGATO_BUILD/framework/lib” -llegato -lpthread -lrt -ldl -lm
FAILED: /home/chasejang/legato/packages/legato.toolchain.1.7.3.fw_SWI9X15Y_07110900-wp85-wp750x-native-x86_64-201608171142/resources/native/wrapper/arm-poky-linux-gnueabi-gcc --sysroot=/home/chasejang/legato/packages/legato.toolchain.1.7.3.fw_SWI9X15Y_07110900-wp85-wp750x-native-x86_64-201608171142/resources/native/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -o _build_ttyTest/wp750x/app/ttyTest/staging/read-only/bin/ttyTest _build_ttyTest/wp750x/app/ttyTest/obj/ttyTest/_main.c.o -rdynamic -Wl,–enable-new-dtags,-rpath="$ORIGIN/…/lib" -L_build_ttyTest/wp750x/staging/read-only/lib “-L_build_ttyTest/wp750x/staging/read-only/lib” -lComponent_ttyTestComponent “-L_build_ttyTest/wp750x/staging/read-only/lib” -lComponent_ttyTestComponent “-L$LEGATO_BUILD/framework/lib” -llegato -lpthread -lrt -ldl -lm
_build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference to le_tty_GetBaudRate' _build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference tole_tty_Open’
_build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference to le_tty_SetRaw' _build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference tole_tty_SetFlowControl’
_build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference to le_tty_SetFraming' _build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference tole_tty_Close’
_build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference to le_tty_SetCanonical' _build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference tole_tty_SetBaudRate’
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
make: *** [wp750x] Error 1

I mean I’d like to test a le_tty_xxx APIs.
Could you let me know how to do it?

Thanks in advance,
Chase


#4

Do you have a built version of Legato and a LEGATO_ROOT environment variable set?


#5

What does a built version of Legato mean?
Do you mean the version of mangOH’s Legato? Or, a Legato AF version of host PC?
LEGATO_ROOT environment variable is defined.


#6

I can make exe of my sample app now. Thanks for your comment.
There was a crash between build environment.
But, there is a error when I run it in my mangOH board(w/ WP7504) as below.

  • capture by logread
    Jan 9 23:44:22 swi-mdm9x15 user.err Legato: =ERR= | ttyTest[27280] | ttyTest: symbol lookup error: /lib/libComponent_ttyTestComponent.so: undefined symbol: le_tty_Open

Could you let me know how to resolve this error?


#7

Hi Chase ,

If it is possible , Can you please share your Application files.
I suspect , This to be related build environment.
Linking of this Runtime Library is not success .
Please check if your legato build is successful
Before building Application , build legato framework and check.

Also check for the symbol in nm -D libComponent_ttyTestComponent.so , if its listing all API’s as

0000000000201058 B __bss_start
w __cxa_finalize
0000000000201058 D _edata
0000000000201070 B _end
U event_QueueComponentInit
0000000000000a74 T _fini
w gmon_start
00000000000007d0 T _init
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
w _Jv_RegisterClasses
U _le_log_Send
U le_tty_Open
U le_tty_SetCanonical
U log_RegComponent
0000000000000955 T _ttyComp_COMPONENT_INIT
0000000000201068 B ttyComp_LogLevelFilterPtr
0000000000201060 B ttyComp_LogSession

Regards
Ankita


#8

ttyTest.tar.gz (49.3 KB)

Hi Ankita,

Sorry for the late reply. Please refer to attachment.
And, I checked my library file via ‘nm -D xxx’ as below.

0000b220 B bss_end
0000b220 B bss_end_
0000b214 B __bss_start
0000b214 B bss_start
w __cxa_finalize
0000b214 D _edata
0000b220 B _end
0000b220 B end
U event_QueueComponentInit
U exit
U fcntl
U fd_Close
00002878 T _fini
w gmon_start
00000794 T _init
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
w _Jv_RegisterClasses
U _le_log_Send
U _le_log_SetFilterLevel
U le_tty_Close
U le_tty_GetBaudRate
U le_tty_Open
U le_tty_SetBaudRate
U le_tty_SetCanonical
U le_tty_SetFlowControl
U le_tty_SetFraming
U le_tty_SetRaw
U log_RegComponent
U tcgetattr
U tcsetattr
00002488 T _ttyTestComponent_COMPONENT_INIT
0000b21c B ttyTestComponent_LogLevelFilterPtr
0000b218 B ttyTestComponent_LogSession
chasejang@chasejang-ubuntu:~/Projects/Legato/legato/apps/sample/ttyTest/_build_ttyTest/wp750x/staging/read-only/lib$

Thanks in Advance,
Chase


#9

Hi Chase ,

I tried reproducing the issue , but it worked fine for me.
I suspect this to be related to build issues of Legato Framework

Please follow the below steps

1.Download the source for legato

http://legato.io/legato-docs/latest/aboutReleaseInfo.html

2.Make Sure you have toolchain for wp750x

3.run make wp750x on your legato root.

4.After build is successfull set environment using
./bin/legs

5.Go to your application folder and build your app with mkapp tool
cd apps/sample/ttyTest/
mkapp -t wp750x ttyTest.adef

6.Install your Application using instapp tool
instapp ttyTest.wp750x.update 192.168.2.2

  1. In your target root
    app status
    you can check your application installed.
    Also , Make sure same legato version/framework is running on the target
    fwupdate query

Secondly , there was one issue in the application
As your are trying to open /dev/ttyS0 (in my case Console on target is /dev/ttyHS0)
add that to your .adef as below
requires:
{
device:
{
[rw] /dev/ttyHS0 /dev/ttyHS0
}

}

I made the above changes in .adef before building application .
as it was not able to open the device path (though it existed)

I can see below logs of test cases execution
5. I can see below logs
Jan 6 02:40:29 swi-mdm9x15 user.warn kernel: [ 1690.436166] msm_serial_hs: Rx break
Jan 6 02:40:29 swi-mdm9x15 user.info Legato: INFO | ttyTest[4077]/ttyTestComponent T=main | ttyTest.c _ttyTestComponent_COMPONENT_INIT() 319 | ======== Tty Test Completed Successfully ========
Jan 6 02:40:29 swi-mdm9x15 user.info Legato: INFO | supervisor[461]/supervisor T=main | proc.c proc_SigChildHandler() 1942 | Process ‘ttyTest’ (PID: 4077) has exited with exit code 0.
Jan 6 02:40:29 swi-mdm9x15 user.warn Legato: -WRN- | _appStopClient[4087]/framework T=main | LE_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2!
Jan 6 02:40:29 swi-mdm9x15 user.info Legato: INFO | supervisor[461]/supervisor T=main | apps.c DeactivateAppContainer() 340 | Application ‘ttyTest’ has stopped

If build environment is proper , i think this will solve the issue.

Regards
Ankita


#10

Hi Ankita,

Thanks for your kindly reply.
I have modified my environment as your recommendation.

  1. Download the source for legato
  • I have download 16.07 version due to mangOH’s Legato version is 16.07.0_83d5ae80e6896b93abca6648c7f13b86_modified
  1. Make sure you have toolchain for sp750x
  1. make wp750x on my legato root

  2. ./bin/legs

  3. build app with mkapp tool

  • and then, I met another error as below

chasejang@chasejang-ubuntu:~/Projects/legato-16.07.0/apps/sample/ttyTest$ mkapp -t wp750x ttyTest.adef
[6/8] Linking C executable
FAILED: /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -o _build_ttyTest/wp750x/app/ttyTest/staging/read-only/bin/ttyTest _build_ttyTest/wp750x/app/ttyTest/obj/ttyTest/_main.c.o -rdynamic -Wl,–enable-new-dtags,-rpath="$ORIGIN/…/lib" -L_build_ttyTest/wp750x/staging/read-only/lib “-L_build_ttyTest/wp750x/staging/read-only/lib” -lComponent_ttyTestComponent “-L_build_ttyTest/wp750x/staging/read-only/lib” -lComponent_ttyTestComponent “-L$LEGATO_BUILD/framework/lib” -llegato -lpthread -lrt -ldl -lm
_build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference to le_tty_GetBaudRate' _build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference tole_tty_Open’
_build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference to le_tty_SetRaw' _build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference tole_tty_SetFlowControl’
_build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference to le_tty_SetFraming' _build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference tole_tty_Close’
_build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference to le_tty_SetCanonical' _build_ttyTest/wp750x/staging/read-only/lib/libComponent_ttyTestComponent.so: undefined reference tole_tty_SetBaudRate’
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
chasejang@chasejang-ubuntu:~/Projects/legato-16.07.0/apps/sample/ttyTest$

How to resolve it?

Thanks in advance,
Chase


#11

Hi Chase ,

I can’t see tty API’s in Legato 16.07.0

You can check available API’s here
http://legato.io/legato-docs/16_07/c_APIs.html

It is good to check the available API’s in each release .

You can view supported APIs here

http://legato.io/legato-docs/latest/aboutReleaseInfo.html

User Docs ->API Guides ->C Runtime Library

I would suggest you to use Latest Legato Framework for Wp series / Legato Version 16.10.1

Regards
Ankita


#12

Hi Ankita,

Could you send the toolchain v16.10.1? or, Could you let me know where can I download it?
Because, I can’t download it from the sierra link below.(it’s gone.)
https://source.sierrawireless.com/resources/legato/downloads/

Thanks in advance,
Chase


#13

Hi Chase ,

You can also use legato-spm to download package
Please follow the steps in this link

http://source.sierrawireless.com/resources/airprime/software/legato_application_development_kit_linux/

Regards
Ankita


#14

Hi Ankita,

Thanks, but it is not the toolchain.
Could you please recheck it? I want to download the toolchain begin as “poky-swi-ext…”.

And, I have one more question.
Could you let me know the Legato version of your mangOH?
It is 16.07.0_xxxxxxxxx_modified in my case.

Thanks in advance,
Chase


#15

Hi Chase ,

I posted the link for Legato Framework only. (i.e atest SDK version for WP85 module (and update legato.sdk.latest link))

You can download full package , just follow these steps .
https://source.sierrawireless.com/resources/airprime/software/legato_spm/

Install latest PDK version for WP85 module (including Legato Source code distribution package)

The following packages will be installed

  • Legato for WP85/WP75
  • Legato Application Framework
  • Legato Device Image for WP85/WP75
  • GCC cross compiler Toolchain
  • Legato Recovery Tooling for Linux

I am using Legato 16.10.1

Regards
Ankita


#16

Hi Ankita,

I already have installed all packages and I need the toolchain v16.10.1 only.
When I try to download it from the site below, there is an error.
https://source.sierrawireless.com/resources/legato/downloads/

Thanks in advance,
Chase


#17

Hi Chase ,

I checked https://source.sierrawireless.com/resources/legato/downloads/.
I can see the link expired .

So i would suggest , the best way you can get tool-chain is through legato-spm.

Regards
Ankita


#18

Hi Ankita,

I see.
Thanks for your kindly reply.