How to build "accessManager" for se05x in the yocto build environment for for "imx6ulevk" device?

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

How to build "accessManager" for se05x in the yocto build environment for for "imx6ulevk" device?

2,142 Views
ajitsj3
Contributor II

Hi,

I have built the se05x recipe on yocto development platform for "imx6ulevk" device using the "se05x_04.01.03.bb" file and also used the plug and trust middleware file "se05x_mw_v04.01.03_20220331_140602.zip" which was downloaded from nxp website. I also used the "meta-custom" layer to build the "se05x" package.

Now I need the "accessManager" binary to communicate with se05x device using the "JRCP_V1" protocol. I have also changed the "-DPTMW_SMCOM" option for "do_configure" in "se05x_04.01.03.bb" file as mentioned below.     

"-DPTMW_SMCOM=JRCP_V1_AM"

After this the "se05x" module/package was built successfully using the bitbake command.

But when I searched for the "accessManager" binary in the rootfs, I could not find it.

Please help me build the "accessManager" binary in the yocto development environment.

Is there any command I need to add in the "se05x_04.01.03.bb" file to specifically build "accessManager"?

 

Thanks and regards

Ajit S J

Labels (2)
0 Kudos
9 Replies

2,127 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ajitsj3 ,

 

Actually clients work with accessManager as below:

Kan_Li_0-1655368899849.png

so JRCP_V1_AM is configured for Client applications, when you make install with this configuration, you may find the client application in "/usr/local/bin", but without accessManager, since it is mentioned in cmake menu already.

Kan_Li_1-1655369094310.png

so you have to configure the MW again with

-DPTMW_SMCOM:STRING=T1oI2C

 and build accessManager like below:

cmake --build . --target accessManager

 then you will find accessManager in bin folder of the building folder, you needn't run "make install" twice, just leave it there, and run it in one console and run the client applications in other consoles.

 

Please kindly refer to simw-top/doc/hostlib/hostLib/accessManager/doc/accessManager.html for more details.

 

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,123 Views
ajitsj3
Contributor II

Hi Kan,

 

Thanks for your response. 

Based on your inputs I am trying to cross compile the accessManager package for our imx6 host.

I used the below mentioned command.

cmake -DPTMW_SCP:STRING=SCP03_SSS -DPTMW_SE05X_Auth:STRING=PlatfSCP03 -DPTMW_SMCOM:STRING=T1oI2C \
-DWithSharedLIB:BOOL=OFF -DPAHO_BUILD_SHARED:BOOL=FALSE -DPAHO_BUILD_STATIC:BOOL=TRUE --toolchain=cmake-toolchain.cmake .

 

But I got the following error.

 

 cmake -DPTMW_SCP:STRING=SCP03_SSS -DPTMW_SE05X_Auth:STRING=PlatfSCP03 -DPTMW_SMCOM:STRING=T1oI2C \
> -DWithSharedLIB:BOOL=OFF -DPAHO_BUILD_SHARED:BOOL=FALSE -DPAHO_BUILD_STATIC:BOOL=TRUE --toolchain=cmake-toolchain.cmake .
CMake Error at CMakeLists.txt:49 (CREATE_BINARY):
Unknown CMake command "CREATE_BINARY".


CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 3.22)

should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/plug-trust-mw/se05x_mw_v04.01.03_20220331_140602/simw-top/hostlib/hostLib/accessManager/CMakeFiles/CMakeOutput.log".
See also "/plug-trust-mw/se05x_mw_v04.01.03_20220331_140602/simw-top/hostlib/hostLib/accessManager/CMakeFiles/CMakeError.log".

 

Please let me know how to solve this issue. I tried in other forums, but could not get any solution for this error.

I am also attaching the "cmake-toolchain.cmake" file as a zip file for reference. This file has the cross-compilation related environment variables.

 

Thanks and regards

Ajit S J

0 Kudos

2,068 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ajitsj3 ,

 

Is the problem still here? It is recommend using the latest cmake from https://cmake.org/download/ , and use --toolchain config_file_name in the end of cmake command line as mentioned in https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-linux .

 

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

2,113 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ajitsj3 ,

 

I think it is due to cmake version, looks like the cross toolchain cmake is too old to support the commands needed by the MW, why not complie the MW natively on the imx6 platform instead? the corresponding cmake can be installed with the apt command. 

 

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,110 Views
ajitsj3
Contributor II

Hi @Kan_Li,

 

Its difficult to build on the imx6 platform as we have a minimal rootfs running on the imx6 platform.

So I need to cross compile only. Please could you let me know which is the version of cmake that I need to install to build this?

Also it would be very easy if we could build "accessManager" using yocto platform only.

 

Thanks and regards

Ajit S J

0 Kudos

2,103 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ajitsj3 ,

 

Alternatively you may attach a USB Disk containing the MW to imx6 platform, and compile it natively without copying the MW into the rootfs.

 

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

2,104 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ajitsj3 ,

 

The cmake version requirement is already in the log:

cmake_minimum_required(VERSION 3.22)

the latest version can be downloaded from https://cmake.org/download/ , and please kindly refer to https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-linux for more details.

 

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

2,009 Views
ajitsj3
Contributor II

@Kan_Li ,

 

My final goal is to build the accessManager on the yocto platform. So I had edited the “se05x_04.01.03.bb” recipe file to include cmake build options for access manager as mentioned in the “PlugAndTrust-MW Document-AN13030.pdf” document. I have attached the recipe file and pdf files for reference in the zip file.

 

Initially I had some issues with the “-DPTMW_SMCOM=T1oI2C” build option as I got the CMAKE error message “Can not use SCI2C with SE05X” when I did bitbake of se05x.

So I changed it to “-DPTMW_SMCOM=JRCP_V1” and this resolved the CMAKE error.

 

But then it started giving the below mentioned error

“| CMake Error: The source directory "/home/ajit/work/minimalbuild/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/se05x/04.01.03-r0/build/accessManager" does not exist.”

 

So I added a new directory reference to point to the “accessManager” directory in the “do_configure” option as mentioned below.

A = "${WORKDIR}/simw-top/hostlib/hostLib"

do_configure() {

    cd ${A}

 

This resolved the “accessManager” directory issue.

 

 

But when I did a bitbake of “se05x” I got the following errors which are mentioned below.

 

 

~/work/minimalbuild$ bitbake se05x

Initialising tasks: 100% |####################################################################################################################| Time: 0:00:00

Sstate summary: Wanted 64 Found 57 Missed 7 Current 267 (89% match, 97% complete)

NOTE: Executing SetScene Tasks

NOTE: Executing RunQueue Tasks

ERROR: se05x-04.01.03-r0 do_configure: Function failed: do_configure (log file is located at /home/ajit/work/minimalbuild/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/se05x/04.01.03-r0/temp/log.do_configure.60592)

ERROR: Logfile of failure stored in: /home/ajit/work/minimalbuild/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/se05x/04.01.03-r0/temp/log.do_configure.60592

Log data follows:

| DEBUG: Executing shell function do_configure

| -- The C compiler identification is GNU 8.3.0

| -- The CXX compiler identification is GNU 8.3.0

| -- Check for working C compiler: /home/ajit/work/minimalbuild/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/se05x/04.01.03-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc

| -- Check for working C compiler: /home/ajit/work/minimalbuild/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/se05x/04.01.03-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc -- works

| -- Detecting C compiler ABI info

| -- Detecting C compiler ABI info - done

| -- Detecting C compile features

| -- Detecting C compile features - done

| -- Check for working CXX compiler: /home/ajit/work/minimalbuild/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/se05x/04.01.03-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-g++

| -- Check for working CXX compiler: /home/ajit/work/minimalbuild/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/se05x/04.01.03-r0/recipe-sysroot-native/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-g++ -- works

| -- Detecting CXX compiler ABI info

| -- Detecting CXX compiler ABI info - done

| -- Detecting CXX compile features

| -- Detecting CXX compile features - done

| CMake Error at CMakeLists.txt:49 (CREATE_BINARY):

|   Unknown CMake command "CREATE_BINARY".

|

|

| CMake Warning (dev) in CMakeLists.txt:

|   No cmake_minimum_required command is present.  A line of code such as

|

|     cmake_minimum_required(VERSION 3.14)

|

|   should be added at the top of the file.  The version specified may be lower

|   if you wish to support older CMake versions for this project.  For more

|   information run "cmake --help-policy CMP0000".

| This warning is for project developers.  Use -Wno-dev to suppress it.

|

| -- Configuring incomplete, errors occurred!

| See also "/home/ajit/work/minimalbuild/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/se05x/04.01.03-r0/simw-top/hostlib/hostLib/CMakeFiles/CMakeOutput.log".

| WARNING: exit code 1 from a shell command.

| ERROR: Function failed: do_configure (log file is located at /home/ajit/work/minimalbuild/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/se05x/04.01.03-r0/temp/log.do_configure.60592)

ERROR: Task (~/se05x/se05x_04.01.03.bb:do_configure) failed with exit code '1'

NOTE: Tasks Summary: Attempted 1356 tasks of which 1348 didn't need to be rerun and 1 failed.

 

Summary: 1 task failed:

  ~/se05x/se05x_04.01.03.bb:do_configure

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

 

Tags (1)
0 Kudos

1,998 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ajitsj3 ,

 

Actually there is no need to modify the cmake files, the error you had  “| CMake Error: The source directory "/home/ajit/work/minimalbuild/tmp-glibc/work/armv7ahf-neon-oe-linux-gnueabi/se05x/04.01.03-r0/build/accessManager" does not exist.”  is an expected result since you select “-DPTMW_SMCOM=JRCP_V1” option, as I mentioned before, this option is just for client application, not for accessManager.

The MW's doc provides an example for building accessManager, please kindly refer to the following for details.

cmake -DPTMW_SCP:STRING=SCP03_SSS -DPTMW_SE05X_Auth:STRING=PlatfSCP03 -DPTMW_SMCOM:STRING=T1oI2C \
  -DWithSharedLIB:BOOL=OFF -DPAHO_BUILD_SHARED:BOOL=FALSE -DPAHO_BUILD_STATIC:BOOL=TRUE .
cmake --build . --target accessManager

You may refer to simw-top/doc/hostlib/hostLib/accessManager/doc/accessManager.html for more details.

 

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