SE050 with vcom in linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SE050 with vcom in linux

Jump to solution
2,132 Views
ninomedj
Contributor I

Hi,

I'm trying to send apdu commands via Vcom to the SE050, when i use windows it work perfectly but when i compiled the examples in linux with all the correct parameters in cmake i got stuck like this:

2022-06-03 17_22_26-vlx-debian10-dev-VMware Workstation.png

I tried to debug and see if my serial ports are the problem but they work when i write and read data to them using simple C code with termios library, that sends an ATR command 00 00 00 00 and i got a correct response from the SE050.

So i wanted to know if there is not problems with vcom implementation for linux in the MW and is there functional examples for that?.

Thank you.

0 Kudos
1 Solution
2,067 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ninomedj ,

 

I just tested on a raspberry pi, with host set to PCLinux64 , and of course, smCom=VCOM, the demo works as expected, please refer to the following for details.

Kan_Li_0-1655367527273.png

but when I tested with some older Ubuntu like 16.04 , I have the same issue as you met, maybe it is also your case?

Please kindly have my cmake options as below:

pi@raspberrypi:~/se05x_mw_v04.01.03_20220331_140602/simw-top_build/raspbian_native_se050_t1oi2c $ cmake . -L
-- BUILD_TYPE: Debug
-- Found: /usr/lib/arm-linux-gnueabihf/libssl.so/usr/lib/arm-linux-gnueabihf/libcrypto.so
-- CMAKE_CXX_COMPILER_ID = GNU
-- CMAKE_SYSTEM_NAME = Linux
-- PTMW_SE05X_Auth - None
-- CMake version: 3.16.3
-- CMake system name: Linux
-- Timestamp is 2022-06-16T08:19:53Z
-- FLOW_VERBOSE is ON!!!
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/se05x_mw_v04.01.03_20220331_140602/simw-top_build/raspbian_native_se050_t1oi2c
-- Cache values
CMAKE_BUILD_TYPE:STRING=Debug
CMAKE_INSTALL_PREFIX:PATH=/usr/local
LIB_ANL:FILEPATH=/usr/lib/arm-linux-gnueabihf/libanl.so
NXPInternal:BOOL=OFF
OPENSSL_ROOT_DIR:PATH=
PAHO_BUILD_DEB_PACKAGE:BOOL=FALSE
PAHO_BUILD_DOCUMENTATION:BOOL=FALSE
PAHO_BUILD_SAMPLES:BOOL=FALSE
PAHO_BUILD_SHARED:BOOL=TRUE
PAHO_BUILD_STATIC:BOOL=FALSE
PAHO_ENABLE_CPACK:BOOL=TRUE
PAHO_ENABLE_TESTING:BOOL=FALSE
PAHO_WITH_SSL:BOOL=TRUE
PTMW_A71CH_AUTH:STRING=None
PTMW_Applet:STRING=SE05X_C
PTMW_FIPS:STRING=None
PTMW_Host:STRING=PCLinux64
PTMW_HostCrypto:STRING=OPENSSL
PTMW_Log:STRING=Verbose
PTMW_RTOS:STRING=Default
PTMW_SBL:STRING=None
PTMW_SCP:STRING=SCP03_SSS
PTMW_SE05X_Auth:STRING=None
PTMW_SE05X_Ver:STRING=03_XX
PTMW_SMCOM:STRING=VCOM
PTMW_mbedTLS_ALT:STRING=None
SSSFTR_SE05X_AES:BOOL=ON
SSSFTR_SE05X_AuthECKey:BOOL=ON
SSSFTR_SE05X_AuthSession:BOOL=ON
SSSFTR_SE05X_CREATE_DELETE_CRYPTOOBJ:BOOL=ON
SSSFTR_SE05X_ECC:BOOL=ON
SSSFTR_SE05X_KEY_GET:BOOL=ON
SSSFTR_SE05X_KEY_SET:BOOL=ON
SSSFTR_SE05X_RSA:BOOL=ON
SSSFTR_SW_AES:BOOL=ON
SSSFTR_SW_ECC:BOOL=ON
SSSFTR_SW_KEY_GET:BOOL=ON
SSSFTR_SW_KEY_SET:BOOL=ON
SSSFTR_SW_RSA:BOOL=ON
SSSFTR_SW_TESTCOUNTERPART:BOOL=ON
WithAccessMgr_UnixSocket:BOOL=OFF
WithCodeCoverage:BOOL=OFF
WithExtCustomerTPMCode:BOOL=OFF
WithNXPNFCRdLib:BOOL=OFF
WithOPCUA_open62541:BOOL=OFF
WithSharedLIB:BOOL=ON
pi@raspberrypi:~/se05x_mw_v04.01.03_20220331_140602/simw-top_build/raspbian_native_se050_t1oi2c $

 

Hope that helps,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
5 Replies
2,115 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ninomedj ,

 

From the snapshot, looks like you are using a building folder for eclipse for Linux compiling , please kindly refer to https://www.nxp.com/docs/en/application-note/AN13027.pdf and https://www.nxp.com/docs/en/application-note/AN12570.pdf for details regarding Linux building, and please use -DPTMW_SMCOM=T1oI2C for Linux building instead of VCOM.

 

Hope that makes sense,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
2,113 Views
ninomedj
Contributor I

Hi @Kan_Li 

Thank you for your answer, i'm using linux on my computer VM, i dont want use t1oI2c because this is not an Embedded linux device , what i'm trying to do is to send APDU command to an MCU then the MCU forward it to the SE050 using VCOM, and it works using windows but not linux, so my qst is: is there a linux implementation for the vcom in the MW or not ?

Thank you and have a great day.

 

 

 

0 Kudos
2,108 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ninomedj ,

 

Thanks for the clarification! Actually PCLinux has been tested already with the MW, and it works without any issue, so I am doubting if it is due to the VM, have you ever tried with a PC installed Linux natively? Is the problem still there?

 

Please kindly clarify.

 

BTW, would you please specify the building steps as well as the cmake options(you may fetch it with "cmake -L ." in the building folder)? looks like the building folder is not the right one.

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

 

 

 

0 Kudos
2,104 Views
ninomedj
Contributor I

hi @Kan_Li 

Thank you for your answer again, No i didn't try with native linux setup, but i can confirme that the VM isn't the problem, right now im getting this errors:

App :INFO :PlugAndTrust_v04.01.03_20220331
App :INFO :Running ./se05x_Minimal
App :INFO :Using PortName='/dev/ttyACM1' (CLI)
smCom :INFO :debug comment

smCom :INFO :Opening /dev/ttyACM1
smCom :ERROR:gfileDescriptor = 3
smCom :INFO :debug comment ATR

smCom :INFO :correct define 1
smCom :DEBUG:ATRCmd (Len=8)
00 00 00 04 00 00 01 00
smCom :DEBUG:Enter: read()
smCom :DEBUG:Exit: read(). read_write_len=4
smCom :DEBUG:Enter: read()
smCom :DEBUG:Exit: read(). read_write_len=280
smCom :DEBUG:Enter: read()
smCom :DEBUG:Exit: read(). read_write_len=142
smCom :DEBUG:Enter: read()
smCom :DEBUG:Exit: read(). read_write_len=142
smCom :DEBUG:Enter: read()
smCom :DEBUG:Exit: read(). read_write_len=142
smCom :DEBUG:Enter: read()
smCom :DEBUG:Exit: read(). read_write_len=142
smCom :DEBUG:Enter: read()
smCom :DEBUG:Exit: read(). read_write_len=142
smCom :DEBUG:Enter: read()
smCom :DEBUG:Exit: read(). read_write_len=128
smCom :DEBUG:Enter: read()
smCom :DEBUG:Exit: read(). read_write_len=77
smCom :DEBUG:Enter: read()
Acquiring logging mutext failedsmCom :DEBUG:Exit: read(). read_write_len=146
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Enter: read()
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Exit: read(). read_write_len=145
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Enter: read()
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Exit: read(). read_write_len=142
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Enter: read()
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Exit: read(). read_write_len=142
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Enter: read()
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Exit: read(). read_write_len=142
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Enter: read()
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Exit: read(). read_write_len=142
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Enter: read()
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Exit: read(). read_write_len=142
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Enter: read()
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Exit: read(). read_write_len=142
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Enter: read()
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Exit: read(). read_write_len=90
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Enter: read()
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Exit: read(). read_write_len=-1
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :INFO :Debug:end while
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :WARN :Client: read() failed: error 0
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :WARN :nxEnsure:'0' failed. At Line:180 Function:smComSocket_GetATRFD
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :INFO :Debug:if ATR dont work
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :DEBUG:Cmd (Len=22)
00 A4 04 00 10 A0 00 00 03 96 54 53 00 00 00 01
03 00 00 00 00 00
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :WARN :Client: write() failed: error -1
Releasing logging semaphore failedAcquiring logging mutext failedsmCom :ERROR:SM_CONNECT Failed.
Releasing logging semaphore failedAcquiring logging mutext failedsss :ERROR:SM_RjctConnect Failed. Status 7002
Releasing logging semaphore failedAcquiring logging mutext failedApp :ERROR:sss_session_open failed
Releasing logging semaphore failedAcquiring logging mutext failedApp :ERROR:ex_sss_session_open Failed
Releasing logging semaphore failedAcquiring logging mutext failedApp :ERROR:!ERROR! ret != 0.

And here's my building setup:

CMAKE_BUILD_TYPE:STRING=Debug
CMAKE_ECLIPSE_EXECUTABLE:FILEPATH=CMAKE_ECLIPSE_EXECUTABLE-NOTFOUND
CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES:BOOL=TRUE
CMAKE_ECLIPSE_MAKE_ARGUMENTS:STRING=-j8
CMAKE_INSTALL_PREFIX:PATH=/usr/local
LIB_ANL:FILEPATH=/usr/lib/x86_64-linux-gnu/libanl.so
NXPInternal:BOOL=OFF
OPENSSL_ROOT_DIR:PATH=
PAHO_BUILD_DEB_PACKAGE:BOOL=FALSE
PAHO_BUILD_DOCUMENTATION:BOOL=FALSE
PAHO_BUILD_SAMPLES:BOOL=FALSE
PAHO_BUILD_SHARED:BOOL=FALSE
PAHO_BUILD_STATIC:BOOL=TRUE
PAHO_ENABLE_CPACK:BOOL=TRUE
PAHO_ENABLE_TESTING:BOOL=FALSE
PAHO_WITH_SSL:BOOL=TRUE
PTMW_A71CH_AUTH:STRING=None
PTMW_Applet:STRING=SE05X_C
PTMW_FIPS:STRING=None
PTMW_Host:STRING=PCLinux64
PTMW_HostCrypto:STRING=OPENSSL
PTMW_Log:STRING=Verbose
PTMW_RTOS:STRING=Default
PTMW_SBL:STRING=None
PTMW_SCP:STRING=None
PTMW_SE05X_Auth:STRING=None
PTMW_SE05X_Ver:STRING=03_XX
PTMW_SMCOM:STRING=VCOM
PTMW_mbedTLS_ALT:STRING=None
SSSFTR_SE05X_AES:BOOL=ON
SSSFTR_SE05X_AuthECKey:BOOL=ON
SSSFTR_SE05X_AuthSession:BOOL=ON
SSSFTR_SE05X_CREATE_DELETE_CRYPTOOBJ:BOOL=ON
SSSFTR_SE05X_ECC:BOOL=ON
SSSFTR_SE05X_KEY_GET:BOOL=ON
SSSFTR_SE05X_KEY_SET:BOOL=ON
SSSFTR_SE05X_RSA:BOOL=ON
SSSFTR_SW_AES:BOOL=ON
SSSFTR_SW_ECC:BOOL=ON
SSSFTR_SW_KEY_GET:BOOL=ON
SSSFTR_SW_KEY_SET:BOOL=ON
SSSFTR_SW_RSA:BOOL=ON
SSSFTR_SW_TESTCOUNTERPART:BOOL=ON
WithAccessMgr_UnixSocket:BOOL=OFF
WithCodeCoverage:BOOL=OFF
WithExtCustomerTPMCode:BOOL=OFF
WithNXPNFCRdLib:BOOL=OFF
WithOPCUA_open62541:BOOL=OFF
WithSharedLIB:BOOL=OFF
pkgcfg_lib__OPENSSL_crypto:FILEPATH=/usr/lib/x86_64-linux-gnu/libcrypto.so
pkgcfg_lib__OPENSSL_ssl:FILEPATH=/usr/lib/x86_64-linux-gnu/libssl.so

Thank you.

0 Kudos
2,068 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ninomedj ,

 

I just tested on a raspberry pi, with host set to PCLinux64 , and of course, smCom=VCOM, the demo works as expected, please refer to the following for details.

Kan_Li_0-1655367527273.png

but when I tested with some older Ubuntu like 16.04 , I have the same issue as you met, maybe it is also your case?

Please kindly have my cmake options as below:

pi@raspberrypi:~/se05x_mw_v04.01.03_20220331_140602/simw-top_build/raspbian_native_se050_t1oi2c $ cmake . -L
-- BUILD_TYPE: Debug
-- Found: /usr/lib/arm-linux-gnueabihf/libssl.so/usr/lib/arm-linux-gnueabihf/libcrypto.so
-- CMAKE_CXX_COMPILER_ID = GNU
-- CMAKE_SYSTEM_NAME = Linux
-- PTMW_SE05X_Auth - None
-- CMake version: 3.16.3
-- CMake system name: Linux
-- Timestamp is 2022-06-16T08:19:53Z
-- FLOW_VERBOSE is ON!!!
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/se05x_mw_v04.01.03_20220331_140602/simw-top_build/raspbian_native_se050_t1oi2c
-- Cache values
CMAKE_BUILD_TYPE:STRING=Debug
CMAKE_INSTALL_PREFIX:PATH=/usr/local
LIB_ANL:FILEPATH=/usr/lib/arm-linux-gnueabihf/libanl.so
NXPInternal:BOOL=OFF
OPENSSL_ROOT_DIR:PATH=
PAHO_BUILD_DEB_PACKAGE:BOOL=FALSE
PAHO_BUILD_DOCUMENTATION:BOOL=FALSE
PAHO_BUILD_SAMPLES:BOOL=FALSE
PAHO_BUILD_SHARED:BOOL=TRUE
PAHO_BUILD_STATIC:BOOL=FALSE
PAHO_ENABLE_CPACK:BOOL=TRUE
PAHO_ENABLE_TESTING:BOOL=FALSE
PAHO_WITH_SSL:BOOL=TRUE
PTMW_A71CH_AUTH:STRING=None
PTMW_Applet:STRING=SE05X_C
PTMW_FIPS:STRING=None
PTMW_Host:STRING=PCLinux64
PTMW_HostCrypto:STRING=OPENSSL
PTMW_Log:STRING=Verbose
PTMW_RTOS:STRING=Default
PTMW_SBL:STRING=None
PTMW_SCP:STRING=SCP03_SSS
PTMW_SE05X_Auth:STRING=None
PTMW_SE05X_Ver:STRING=03_XX
PTMW_SMCOM:STRING=VCOM
PTMW_mbedTLS_ALT:STRING=None
SSSFTR_SE05X_AES:BOOL=ON
SSSFTR_SE05X_AuthECKey:BOOL=ON
SSSFTR_SE05X_AuthSession:BOOL=ON
SSSFTR_SE05X_CREATE_DELETE_CRYPTOOBJ:BOOL=ON
SSSFTR_SE05X_ECC:BOOL=ON
SSSFTR_SE05X_KEY_GET:BOOL=ON
SSSFTR_SE05X_KEY_SET:BOOL=ON
SSSFTR_SE05X_RSA:BOOL=ON
SSSFTR_SW_AES:BOOL=ON
SSSFTR_SW_ECC:BOOL=ON
SSSFTR_SW_KEY_GET:BOOL=ON
SSSFTR_SW_KEY_SET:BOOL=ON
SSSFTR_SW_RSA:BOOL=ON
SSSFTR_SW_TESTCOUNTERPART:BOOL=ON
WithAccessMgr_UnixSocket:BOOL=OFF
WithCodeCoverage:BOOL=OFF
WithExtCustomerTPMCode:BOOL=OFF
WithNXPNFCRdLib:BOOL=OFF
WithOPCUA_open62541:BOOL=OFF
WithSharedLIB:BOOL=ON
pi@raspberrypi:~/se05x_mw_v04.01.03_20220331_140602/simw-top_build/raspbian_native_se050_t1oi2c $

 

Hope that helps,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos