Dear NXP supporters,
We are an OEM developer who has a device using SE050. We are using SM6225 chipset Android 13. I need to build SE050 middleware to provide native library for dev team to communicate with SE050. I have built SE050 nano-package before and succeeded, but when I build the full middleware version 04.07.01, I did the same but the examples I pushed to the device with native lib could not run, it reported mutex error, Aborted. I want to ask if there is any documentation or instructions on how to build this? I am deploying the build following these steps.
cd EdgeLock_SE05x_PlugAndTrust_Middleware/SE-PLUG-TRUST-MW_04.07.01/simw-top/scripts
export ANDROID_NDK_ROOT=/media/tuananh/data/tuananh/Android/Sdk/ndk/28.0.12433566
export TOOLCHAIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin
export TARGET=aarch64-linux-android
export API=21
export CC=$TOOLCHAIN/${TARGET}${API}-clang
export CXX=$TOOLCHAIN/${TARGET}${API}-clang++
export PKG_CONFIG_PATH=/data/local/tmp/lib/pkgconfig
export CFLAGS="$CFLAGS -DDISABLE_SYSTEMD"
source ./env_setup.sh
python3 create_cmake_projects.py
cd ../../simw-top_build/android_arm64
cd ../..&&
cmake ../../simw-top \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-$API \
-DANDROID_NDK=$ANDROID_NDK_ROOT \
-DCMAKE_SYSTEM_NAME=Android \
-DPTMW_Host=Android \
-DSSS_HAVE_HOST_ANDROID=1 \
-DSSS_HAVE_HOST_PCWINDOWS=0 \
-DSSS_HAVE_MBEDTLS=1 \
-DSSS_HAVE_RTOS=0 \
-DSSS_HAVE_APPLET=SE05X_A \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DPLUGANDTRUST_DEBUG_LOGS=ON \
-DPLUGANDTRUST_SE05X_AUTH=None
make -j$(nproc)
Notes:
File bin example in EdgeLock_SE05x_PlugAndTrust_Middleware/SE-PLUG-TRUST-MW_04.07.01/simw-top_build/android_arm64/bin
Lib native .so in:
EdgeLock_SE05x_PlugAndTrust_Middleware/SE-PLUG-TRUST-MW_04.07.01/simw-top_build/android_arm64/hostlib/hostLib/se05x
Hi @anhtt ,
No , I haven't got a chance to try on an Android 13 platform, but in case you have already e.g. a Yocto cross-compilation toolchain available, activate it:
. /opt/fsl-imx-xwayland/6.1-langdale/environment-setup-armv8a-poky-linux
Then you create a cmake configuration with a standard cmake call (as an alternative the create_cmake_projects.py will as well create some cross-compilation setups for you):
extnb012@grkextnb012:~/se_mw/preview/se05x_mw_v04.05.00_20231204$ cd simw-top_build/
extnb012@grkextnb012:~/se_mw/preview/se05x_mw_v04.05.00_20231204/simw-top_build$ mkdir cc_se05x
extnb012@grkextnb012:~/se_mw/preview/se05x_mw_v04.05.00_20231204/simw-top_build$ cd cc_se05x/
extnb012@grkextnb012:~/se_mw/preview/se05x_mw_v04.05.00_20231204/simw-top_build/cc_se05x$
extnb012@grkextnb012:~/se_mw/preview/se05x_mw_v04.05.00_20231204/simw-top_build/cc_se05x$ cmake -DPTMW_Applet=SE050_E -DPTMW_HostCrypto=OPENSSL -DPTMW_Host=iMXLinux -DPTMW_SMCOM=T1oI2C -DCMAKE_BUILD_TYPE=Debug ../../simw-top
-- Toolchain file defaulted to '/opt/fsl-imx-xwayland/6.1-langdale/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake'
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/fsl-imx-xwayland/6.1-langdale/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/fsl-imx-xwayland/6.1-langdale/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- BUILD_TYPE: Debug
-- Found OpenSSL: /opt/fsl-imx-xwayland/6.1-langdale/sysroots/armv8a-poky-linux/usr/lib/libcrypto.so (found version "3.0.7")
-- Found: /opt/fsl-imx-xwayland/6.1-langdale/sysroots/armv8a-poky-linux/usr/lib/libssl.so/opt/fsl-imx-xwayland/6.1-langdale/sysroots/armv8a-poky-linux/usr/lib/libcrypto.so
-- CMAKE_CXX_COMPILER_ID = GNU
-- CMAKE_SYSTEM_NAME = Linux
-- Found Git: /usr/bin/git (found version "2.25.1")
-- Could not detect git directories. Using STUB Values for GIT Version
-- CMake version: 3.24.0
-- CMake system name: Linux
-- Timestamp is 2023-12-15T23:15:41Z
accessManager is not copied to default binary directory upon install
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/extnb012/se_mw/preview/se05x_mw_v04.05.00_20231204/simw-top_build/cc_se05x
And then a normal cmake build run will create cross-compiled binaries.
I am not sure if you have similar environment, but just for your reference.
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.
-------------------------------------------------------------------------------