Skip to main content
Visitor
October 16, 2026
Question

Request for STSAFE-A110 and X-CUBE-STSE01 Host Session Example (host session provisioning use cases)

 

  1. I am integrating the STSAFE-A110 as a secure element with the STM32H523 as the host MCU. I am using the latest version of the X-CUBE-STSE01 middleware and want to establish and use a secure channel between the secure element and the host.

  2. Using the Host Key Provisioning example provided in X-CUBE-STSE01, I provisioned the Host MAC and Host Cipher keys into the secure element.

  3. I want to store 12 bytes of data in data partition index 2 during provisioning and read the data back during runtime in the host environment.

  4. Currently, I can successfully store and read the data using the following APIs with STSE_NO_PROT:

            stse_data_storage_update_data_zone()

            stse_data_storage_read_data_zone()

  1. However, I want to perform these operations using STSE_HOST_C_MAC_R_MAC, as this is the Host Session protection mode supported by X-CUBE-STSE01.

  2. On one board, I receive the STSE_INVALID_C_MAC error. I provisioned the keys on another board, but on that board, I receive the STSE_KEY_BLOCKED error.

  3. Before performing the read/write operations, I execute the following initialization functions:

          SAFEA1_Init()

         stse_set_default_handler_value()

         stse_init()

        I also open the Host Session using:

        stsafea_open_host_session()

  1. During Host Key provisioning, the example calls:

             stsafea_put_attribute_host_key()

 

      During the protected read/write operation, the execution flow is:

       stsafea_read_data_zone()

        -> stsafea_frame_transfer()

           -> stsafea_session_authenticated_transfer()

             -> stsafea_frame_raw_transfer()

                -> stsafea_frame_receive()

The stsafea_frame_receive() function returns STSE_INVALID_C_MAC.

  1. Please confirm whether my current approach to secure-channel establishment and protected data-zone access is correct.

  2. Please provide an example demonstrating how to use the Host Session with STSE_HOST_C_MAC_R_MAC, including how the Host MAC key and Host Cipher key should be used during runtime.

  3. Any reference example demonstrating protected data-zone read and write operations in the host environment would be highly appreciated.