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).
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.
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?
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.
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
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
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$
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
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.