How to use Secure Element SE05x: Setting up Plug and Trust Middleware on the FRDM-IMX93 development board (Japanese blog) In a previous article, we introduced how to set up the "Plug and Trust Middleware" library for SE05x (Secure Element) on a Raspberry Pi .
As of the time of writing this article, Plug and Trust Middleware 04.07.01 does not explicitly state support for the i.MX 93 FRDM development board ( FRDM-IMX93 ), but I was able to set it up and get it working, so I will explain how to do so.
Once setup is complete, you can use the SE05x via OpenSSL or connect to Azure IoT Hub using the Eclipse Mosquitto client in the same way.
(Working time: 30 minutes)
About SE05x and Plug and Trust Middleware
Please refer to the "Introduction" section of the article on how to set up "Plug and Trust Middleware" on a Raspberry Pi .
Hardware, software, and versions used in writing this article
Hardware:
FRDM i.MX 93 Development Board ( FRDM-IMX93 )
EdgeLock ® SE050 Development Kit ( OM-SE050ARD-E )
Four jumper wires (male-to-female or female-to-female)
8GB microSD card (when writing an image to an SD card for use)
Note: Regarding the power supply for FRDM-IMX93
Although it's not mentioned on the Start Guide pages, the Quick Start Guide states that you should prepare a separate USB Type-C PD 45W power supply. Actual power consumption depends on the operating conditions, and I was able to test the SE05x using a 5V2A USB power supply without realizing it and it seemed to work without any problems, but please use a USB PD 45W or higher power supply.
Section 2.2 Power supply of the FRDM-IMX93 user manual states that VBUS_IN is 12-20V and is input to a DC-DC power supply with a 5V 8A max. (40W) output. This includes the current supplied from the FRDM-IMX93 to USB devices.
software:
LF_v6.6.36-2.1.0_images_FRDM_4.0_IMX93( (Downloadable from the FRDM-IMX93 page)
SE-PLUG-TRUST-MW_04.07.01 *The method for accessing the documentation is explained below.
Download the Plug and Trust middleware package.
First, please download the Plug and Trust middleware package (SE05x-PLUG-TRUST-MW) from here.
* A MyNXP account is required for downloading. Registration is free and easy.
* After unzipping, you can access the documentation from simw-top/doc/index.html (hereafter, "documentation" refers to this HTML file).
Hardware preparation
Connect the P12 pin of the FRDM-IMX93 to the OM-SE050ARD-E with a jumper wire, as shown in the image below.
The OM-SE050ARD-E also has markings on the silkscreen, so please refer to those as well.
Please also refer to the table below for the connection of P12 on the FRDM-IMX93 side.
3.3V
GND
SCL
SDA
Since the DPD pins will not be connected, change the following two jumper settings on the OM-SE050ARD-E, just as you would when connecting a Raspberry Pi. For details on the jumper settings, please refer to the Raspberry Pi article.
J13: 1-2
J14: 1-2
Writing a demo image to the SD card (Optional)
The same build procedure should work even with the image pre-installed on the eMMC of the FRDM-IMX93, but for the procedure described in this article, I used a demo image published on nxp.com that was written to an SD card.
The following page describes the procedure for writing the pre-built image to the SD card.
Getting Started with FRDM-IMX93 | NXP Semiconductors
Personally, I found the USB connector connection process a bit confusing, so I've outlined the steps below.
Download the demo image from the FRDM-IMX93 page and extract it.
Insert the SD card into the FRDM-IMX93.
Change the boot switch setting on the FRDM-IMX93 to Serial Downloader (USB) (see diagram below).
Connect the FRDM-IMX93's P2 (the USB connector labeled USB1_C) to your PC.
Following the instructions in FRDM-IMX93 Start Guide 2.3, download uuu, navigate to the directory containing imx-image-full-imx93frdm.rootfs.wic.zst within the demo image, and start executing the uuu command.
Connect the FRDM-IMX93's P1 (the USB connector labeled POWER) to a USB PD power supply. The image download by uuu will begin, so wait until it is complete.
Remove P1 (POWER) from FRDM-IMX93.
Change the boot switch setting on the FRDM-IMX93 to SD (see diagram below).
The boot switch SW1 is set to BOOT_MODE[3:0]=0010 by default, which means it is booting via eMMC.
Serial Downloader (USB) with BOOT_MODE[3:0]=0001
Booting from SD card with BOOT_MODE[3:0]=0011
Middleware setup and running the sample application
Copy the downloaded Plug and Trust middleware package to the FRDM-IMX93 and extract it.
Navigate to the destination directory and execute the following command.
cd simw-top
python scripts/create_cmake_projects.py
Then, run the following command to open the source code.
vi hostlib/hostLib/platform/linux/i2c_a7.c
Change the line containing `default_axSmDevice_name` to the following setting to use i2c-0.
static char* default_axSmDevice_name = "/dev/i2c-0";
As you can see in /sys/bus/i2c/devices, i2c-0, i2c-1, and i2c-2 are enabled by default in the demo image, which correspond to I2C1, I2C2, and I2C3 of the i.MX 93, respectively.
Since I2C1 is connected to pin 12 of the FRDM-IMX93, i2c-0 is specified in the source code. I2C2 and I2C3 are not connected to the external connection pin headers.
Before building, make sure the CMake options are not set for i.MX as described in documentation 4.4. Change the CMake options as follows, following the instructions for the i.MX Linux Build. However, since we are using the SE050E, change only PTMW_Applet to SE050_E.
PTMW_Applet SE050_E
PTMW_FIPS None
PTMW_Host iMXLinux
PTMW_HostCrypto MBEDTLS
PTMW_Log Default
PTMW_MBedTLS 2_X
PTMW_OpenSSL 3_0
PTMW_RTOS Default
PTMW_SBL None
PTMW_SCP None
PTMW_SE05X_Auth None
PTMW_SE05X_Ver 07_02
PTMW_SMCOM T1oI2C
WithCodeCoverage OFF
WithNXPNFCRdLib OFF
WithSSS_TestCounterPart ON
WithSharedLIB OFF
PTMW_mbedTLS_ALT None
Navigate to the build directory using the following command and set the above options.
cd ../simw-top_build/simw-top-eclipse_jrcpv1
cmake -DPTMW_Applet=SE050_E -DPTMW_FIPS=None -DPTMW_Host=iMXLinux -DPTMW_HostCrypto=MBEDTLS -DPTMW_Log=Default -DPTMW_MBedTLS=2_X -DPTMW_OpenSSL=3_0 -DPTMW_RTOS=Default -DPTMW_SBL=None -DPTMW_SCP=None -DPTMW_SE05X_Auth=None -DPTMW_SE05X_Ver=07_02 -DPTMW_SMCOM=T1oI2C -DWithCodeCoverage=OFF -DWithNXPNFCRdLib=OFF -DWithSSS_TestCounterPart=ON -DWithSharedLIB=OFF -DPTMW_mbedTLS_ALT=None .
Once the above is complete, build and install using the following command.
cmake --build .
sudo make install
sudo ldconfig /usr/local/lib
The built applications are located in simw-top_build/raspbian_native_se050_t1oi2c/bin.
Since the files were copied to /usr/local/bin/ during the installation process described earlier, you can run the program without specifying the files in that location.
To verify that it works, execute the following command.
se05x_GetInfo
The execution result will be as follows:
App :INFO :Running se05x_GetInfo
App :INFO :If you want to over-ride the selection, use ENV=EX_SSS_BOOT_SSS_PORT or pass in command line arguments.
App :INFO :PlugAndTrust_v04.07.01_20250519
sss :INFO :atr (Len=35)
01 A0 00 00 03 96 04 03 E8 00 FE 02 0B 03 E8 00
01 00 00 00 00 64 13 88 0A 00 65 53 45 30 35 31
00 00 00
App :WARN :No SemsLite Applet Available.
App :INFO :Running se05x_GetInfo
App :INFO :If you want to over-ride the selection, use ENV=EX_SSS_BOOT_SSS_PORT or pass in command line arguments.
sss :INFO :atr (Len=35)
01 A0 00 00 03 96 04 03 E8 00 FE 02 0B 03 E8 00
01 00 00 00 00 64 13 88 0A 00 65 53 45 30 35 31
00 00 00
sss :WARN :Communication channel is Plain.
sss :WARN :!!!Not recommended for production use.!!!
App :WARN :#####################################################
App :INFO :uid (Len=18)
04 00 50 01 6A 17 2A E0 43 2E 7C 04 27 6A D2 9C
1D 90
App :WARN :#####################################################
App :INFO :Applet Major = 7
App :INFO :Applet Minor = 2
App :INFO :Applet patch = 0
App :INFO :AppletConfig = 3F9F
App :INFO :With ECDSA_ECDH_ECDHE
App :INFO :With EDDSA
App :INFO :With DH_MONT
App :INFO :With HMAC
App :INFO :WithOut RSA_PLAIN
App :INFO :WithOut RSA_CRT
App :INFO :With AES
App :INFO :With DES
App :INFO :With PBKDF
App :INFO :With TLS
App :INFO :With MIFARE
App :INFO :With I2CM
App :INFO :Internal = FFFF
App :WARN :#####################################################
App :INFO :Tag value - proprietary data 0xFE = 0xFE
App :INFO :Length of following data 0x45 = 0x45
App :INFO :Tag card identification data (Len=2)
DF 28
App :INFO :Length of card identification data = 0x42
App :INFO :Tag configuration ID (Must be 0x01) = 0x01
App :INFO :Configuration ID (Len=12)
00 01 A9 21 89 0A 6F 56 4A 23 9C 41
App :INFO :OEF ID (Len=2)
A9 21
App :INFO :Tag patch ID (Must be 0x02) = 0x02
App :INFO :Patch ID (Len=8)
00 00 00 00 00 00 00 01
App :INFO :Tag platform build ID1 (Must be 0x03) = 0x03
App :INFO :Platform build ID (Len=24)
4A 33 52 33 35 31 30 32 39 42 34 31 31 31 30 30
1A 08 FA 50 67 B5 F2 56
App :INFO :JCOP Platform ID = J3R351029B411100
App :INFO :Tag FIPS mode (Must be 0x05) = 0x05
App :INFO :FIPS mode var = 0x00
App :INFO :Tag pre-perso state (Must be 0x07) = 0x07
App :INFO :Bit mask of pre-perso state var = 0x00
App :INFO :Tag ROM ID (Must be 0x08) = 0x08
App :INFO :ROM ID (Len=8)
2E 5A D8 84 09 C9 BA DB
App :INFO :Status Word (SW) (Len=2)
90 00
App :INFO :se05x_GetInfoPlainApplet Example Success !!!...
App :WARN :#####################################################
App :INFO :cplc_data.IC_fabricator (Len=2)
47 90
App :INFO :cplc_data.IC_type1 (Len=2)
D3 21
App :INFO :cplc_data.Operating_system_identifier (Len=2)
47 00
App :INFO :cplc_data.Operating_system_release_date (Len=2)
00 00
App :INFO :cplc_data.Operating_system_release_level (Len=2)
00 00
App :INFO :cplc_data.IC_fabrication_date (Len=2)
41 50
App :INFO :cplc_data.IC_Serial_number (Len=4)
13 93 77 21
App :INFO :cplc_data.IC_Batch_identifier (Len=2)
05 57
App :INFO :cplc_data.IC_module_fabricator (Len=2)
00 00
App :INFO :cplc_data.IC_module_packaging_date (Len=2)
00 00
App :INFO :cplc_data.ICC_manufacturer (Len=2)
00 00
App :INFO :cplc_data.IC_embedding_date (Len=2)
00 00
App :INFO :cplc_data.IC_OS_initializer (Len=2)
07 27
App :INFO :cplc_data.IC_OS_initialization_date (Len=2)
6A 33
App :INFO :cplc_data.IC_OS_initialization_equipment (Len=4)
39 33 37 37
App :INFO :cplc_data.IC_personalizer (Len=2)
00 00
App :INFO :cplc_data.IC_personalization_date (Len=2)
00 00
App :INFO :cplc_data.IC_personalization_equipment_ID (Len=4)
00 00 00 00
App :INFO :cplc_data.SW (Len=2)
90 00
App :INFO :ex_sss Finished
If you see a section reading the uid (Unique ID) as shown below, it's working correctly. Since the uid is a different value for each device, a different value should be read depending on the board being used.
App :INFO :uid (Len=18)
04 00 50 01 6A 17 2A E0 43 2E 7C 04 27 6A D2 9C
1D 90
The following message is also displayed, which indicates that protection (message authentication and encryption) for communication between the host and SE050 is not enabled.
During mass production, we strongly recommend changing the middleware build settings to enable protection.
sss :WARN :Communication channel is Plain.
sss :WARN :!!!Not recommended for production use.!!!
Setting up the command line tool (ssscli)
ssscli is a Python-based command-line tool for controlling SE05X.
Document 9.3.1.2. You can set it up according to i.MX, but here we will introduce a setup using venv, similar to the previous Raspberry Pi article.
The following instructions will create a venv in simw-top/pycli, but you can change this according to your preference.
cd simw-top/pycli
python3 -m venv venv
source venv/bin/activate
python3 -m pip install -r requirements.txt
cd src
python3 setup.py develop
Once the above is complete, try using ssscli to retrieve the uid.
ssscli connect se05x t1oi2c none
ssscli se05x uid
ssscli disconnect
If you get output similar to the following, and obtain the same ID as the result of executing se05x_GetInfo, you can be sure that it is working correctly.
sss :INFO :atr (Len=35)
01 A0 00 00 03 96 04 03 E8 00 FE 02 0B 03 E8 00
01 00 00 00 00 64 13 88 0A 00 65 53 45 30 35 31
00 00 00
sss :WARN :Communication channel is Plain.
sss :WARN :!!!Not recommended for production use.!!!
040050016a172ae0432e7c04276ad29c1d90
Unique ID: 040050016a172ae0432e7c04276ad29c1d90
This completes the setup of Plug and Trust Middleware.
For specific usage examples, please refer to the instructions on using SE05x via OpenSSL and connecting to Azure IoT Hub using the Eclipse Mosquitto client . However, since the demo image does not allow installation of the Mosquitto client via apt, please refer to the following instructions for installation.
Building and installing Mosquitto client
The following page contains instructions on how to build from source.
https://github.com/eclipse-mosquitto/mosquitto
While it wasn't previously required, cJSON seems to have become a requirement at the time of writing this article, so we'll install that first.
https://github.com/davegamble/cjson
Download, build, and install the cJSON source code using the following commands.
The library was installed in /usr/local/lib64, which caused the mosquitto client to not work properly. Therefore, the installation directory was changed to /user/local/lib.
Since both libmosquitto and libcjson, which are installed in /user/local/lib, appear to be built in ELF 64-bit format, there shouldn't be any problems.
wget https://github.com/DaveGamble/cJSON/archive/refs/heads/master.zip -Ocjson.zip
unzip cjson.zip
cd cJSON-master
mkdir build
cd build
cmake -DCMAKE_INSTALL_LIBDIR=lib ..
make
make install
ldconfig /usr/local/lib
Download and extract the Mosquitto client source code using the following command.
wget https://github.com/eclipse-mosquitto/mosquitto/archive/refs/heads/master.zip -Omosquitto.zip
unzip mosquitto.zip
cd mosquitto-master
Open config.mk with the following command:
vi config.mk
Modify the WITH_DOCS line as follows:
WITH_DOCS:=no
The following steps will complete the build and installation.
make
sudo make install
/sbin/ldconfig
ldconfig /usr/local/lib
After setup is complete
How to use SE05x via OpenSSL
Connecting to Azure IoT Hub using the Eclipse Mosquitto client
You can make it work in the same way, so please give it a try.
=========================
We are currently unable to respond to comments left in the " Comment " section of this post . We apologize for the inconvenience, but please refer to " Technical Questions to NXP - How to Contact Us( Japanese Blog) " when making inquiries.(If you are already an NXP distributor or have a relationship with NXP, you may ask your representative directly.) In a previous article, we introduced how to set up the "Plug and Trust Middleware" library for SE05x (Secure Element) on a Raspberry Pi .
As of the time of writing this article, Plug and Trust Middleware 04.07.01 does not explicitly state support for the i.MX 93 FRDM development board ( FRDM-IMX93 ), but I was able to set it up and get it working, so I will explain how to do so.
Once setup is complete, you can use the SE05x via OpenSSL or connect to Azure IoT Hub using the Eclipse Mosquitto client in the same way.
(Working time: 30 minutes) i.MX Processors Security Technology Focus Japanese Blog
View full article