<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: HSE active passive block fail in S32K</title>
    <link>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1654673#M23138</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Lukas,&amp;nbsp;&lt;/SPAN&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;My project is a basic project, s32k312 HSE function has just started testing, I have not done any operations, such as a&lt;SPAN&gt;dvance LC&lt;/SPAN&gt;, program ADPK key, and f&lt;SPAN&gt;ormat HSE key catalogs&lt;/SPAN&gt;, etc., so the chip status is default.&lt;/P&gt;&lt;P&gt;The test code and allowed results are shown in the following figure：&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void hse_init()
{
    hseStatus_t        HseStatus;
    hseSrvResponse_t   HseSrvResponse;

    OsIf_Init(NULL_PTR);

    Crypto_Init(NULL_PTR);

    HostFlash_Init();

    /* read HSE FW Version */
    HseSrvResponse = HSE_GetVersion(&amp;amp;HseFwVersion);
    LOGI("HSE Version: %d.%d.%d.%d.%d.%d\r\n", HseFwVersion.reserved, HseFwVersion.socTypeId, HseFwVersion.fwTypeId, 
    HseFwVersion.majorVersion, HseFwVersion.minorVersion, HseFwVersion.patchVersion);

    /* read Lifecycle */
    HseSrvResponse = HSE_ReadLifecycle(&amp;amp;HseAttrSecureLifecycle);
    LOGI("HseAttrSecureLifecycle: %d\r\n", HseAttrSecureLifecycle);

    /* read AttrExtendCustSecurityPolicy */
    HseSrvResponse = HSE_ReadAttrExtendCustSecurityPolicy(&amp;amp;HseAttrExtendCustSecurityPolicy);
    LOGI("HseAttrExtendCustSecurityPolicy: enableADKm = %d, startAsUser = %d\r\n", 
        HseAttrExtendCustSecurityPolicy.enableADKm, HseAttrExtendCustSecurityPolicy.startAsUser);

    /* copy active data to passive */
    HostFlash_PassiveUpgradeTest();
    LOGI("HostFlash_PassiveUpgrade success\r\n");

    /* ab swap */
    HseSrvResponse = HSE_ActivatePassiveBlock();
    if (HSE_SRV_RSP_OK != HseSrvResponse)
        LOGI("HSE_ActivatePassiveBlock fail [error_code: 0x%x]\r\n", HseSrvResponse);
    else 
        LOGI("HSE_ActivatePassiveBlock success\r\n");
}

#define MU0 (0)
#define HSE_ADMIN_CHANNEL (0)

hseSrvResponse_t HSE_ActivatePassiveBlock(void)
{
    hseSrvResponse_t hseStatus = HSE_SRV_RSP_GENERAL_ERROR;
    uint8_t u8MuChannel = HSE_ADMIN_CHANNEL; 
    hseSrvDescriptor_t* pHseSrvDesc;

    pHseSrvDesc = &amp;amp;gHseSrvDesc[MU0][u8MuChannel];
    memset(pHseSrvDesc, 0, sizeof(hseSrvDescriptor_t));

    pHseSrvDesc-&amp;gt;srvId = HSE_SRV_ID_ACTIVATE_PASSIVE_BLOCK;
    hseStatus = HSE_Send(MU0, u8MuChannel, gSyncTxOption, pHseSrvDesc);

    /* wait for positive response */
    ASSERT(HSE_SRV_RSP_OK == hseStatus);
    return hseStatus;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot-20230522-172325.png" style="width: 683px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/224207iF8625DCEDD7EC058/image-size/large?v=v2&amp;amp;px=999" role="button" title="screenshot-20230522-172325.png" alt="screenshot-20230522-172325.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2023 09:33:19 GMT</pubDate>
    <dc:creator>liangyouchao</dc:creator>
    <dc:date>2023-05-22T09:33:19Z</dc:date>
    <item>
      <title>HSE active passive block fail</title>
      <link>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1651640#M22986</link>
      <description>&lt;P&gt;&lt;BR /&gt;CHIP:&amp;nbsp; &amp;nbsp; &amp;nbsp;S32K312&lt;/P&gt;&lt;P&gt;LC:&amp;nbsp; &amp;nbsp; HSE_LC_CUST_DEL&lt;/P&gt;&lt;P&gt;HSE FW ver:&amp;nbsp; &amp;nbsp; 1.13.0.1.2.1&lt;/P&gt;&lt;P&gt;My code is 90KB, I copy 128KB data from address 0x00400000 to 0x00500000, and then execute the service HSE_SRV_ID_ACTIVATE_PASSIVE_BLOCK, but the hseSrvResponse code returns HSE_SRV_RSP_NOT_ALLOWED.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define HSE_SRV_RSP_NOT_ALLOWED                 ((hseSrvResponse_t)0xAA55A21CUL)  /**&amp;lt; @brief The operation is not allowed because of some restrictions (in attributes, life-cycle dependent operations, key-management, etc.). */&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;what could be the reason for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 02:54:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1651640#M22986</guid>
      <dc:creator>liangyouchao</dc:creator>
      <dc:date>2023-05-17T02:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: HSE active passive block fail</title>
      <link>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1653029#M23047</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209179"&gt;@liangyouchao&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although the HSE RM does not specify the Super User (SU) right requirements for partition swap service, SU is needed. &lt;BR /&gt;LC CUST DEL has SU rights by default but user rights can be forced (from HSE RM):&lt;/P&gt;
&lt;P&gt;"The execution rights after reset in LC states CUST_DEL and OEM_PROD can be forced to User rights configuring the “Start as User” option within hseAttrExtendCustSecurityPolicy_t and hseAttrExtendOemSecurityPolicy_t attributes."&lt;/P&gt;
&lt;P&gt;Could you confirm you are not forcing user rights?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Also, it should be noted that the partition swap service ACTVATE Passive block can be given once in a reset cycle, so if you call the service twice it also returns error "HSE_SRV_RSP_NOT_ALLOWED".&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 09:52:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1653029#M23047</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2023-05-18T09:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: HSE active passive block fail</title>
      <link>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1654673#M23138</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Lukas,&amp;nbsp;&lt;/SPAN&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;My project is a basic project, s32k312 HSE function has just started testing, I have not done any operations, such as a&lt;SPAN&gt;dvance LC&lt;/SPAN&gt;, program ADPK key, and f&lt;SPAN&gt;ormat HSE key catalogs&lt;/SPAN&gt;, etc., so the chip status is default.&lt;/P&gt;&lt;P&gt;The test code and allowed results are shown in the following figure：&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void hse_init()
{
    hseStatus_t        HseStatus;
    hseSrvResponse_t   HseSrvResponse;

    OsIf_Init(NULL_PTR);

    Crypto_Init(NULL_PTR);

    HostFlash_Init();

    /* read HSE FW Version */
    HseSrvResponse = HSE_GetVersion(&amp;amp;HseFwVersion);
    LOGI("HSE Version: %d.%d.%d.%d.%d.%d\r\n", HseFwVersion.reserved, HseFwVersion.socTypeId, HseFwVersion.fwTypeId, 
    HseFwVersion.majorVersion, HseFwVersion.minorVersion, HseFwVersion.patchVersion);

    /* read Lifecycle */
    HseSrvResponse = HSE_ReadLifecycle(&amp;amp;HseAttrSecureLifecycle);
    LOGI("HseAttrSecureLifecycle: %d\r\n", HseAttrSecureLifecycle);

    /* read AttrExtendCustSecurityPolicy */
    HseSrvResponse = HSE_ReadAttrExtendCustSecurityPolicy(&amp;amp;HseAttrExtendCustSecurityPolicy);
    LOGI("HseAttrExtendCustSecurityPolicy: enableADKm = %d, startAsUser = %d\r\n", 
        HseAttrExtendCustSecurityPolicy.enableADKm, HseAttrExtendCustSecurityPolicy.startAsUser);

    /* copy active data to passive */
    HostFlash_PassiveUpgradeTest();
    LOGI("HostFlash_PassiveUpgrade success\r\n");

    /* ab swap */
    HseSrvResponse = HSE_ActivatePassiveBlock();
    if (HSE_SRV_RSP_OK != HseSrvResponse)
        LOGI("HSE_ActivatePassiveBlock fail [error_code: 0x%x]\r\n", HseSrvResponse);
    else 
        LOGI("HSE_ActivatePassiveBlock success\r\n");
}

#define MU0 (0)
#define HSE_ADMIN_CHANNEL (0)

hseSrvResponse_t HSE_ActivatePassiveBlock(void)
{
    hseSrvResponse_t hseStatus = HSE_SRV_RSP_GENERAL_ERROR;
    uint8_t u8MuChannel = HSE_ADMIN_CHANNEL; 
    hseSrvDescriptor_t* pHseSrvDesc;

    pHseSrvDesc = &amp;amp;gHseSrvDesc[MU0][u8MuChannel];
    memset(pHseSrvDesc, 0, sizeof(hseSrvDescriptor_t));

    pHseSrvDesc-&amp;gt;srvId = HSE_SRV_ID_ACTIVATE_PASSIVE_BLOCK;
    hseStatus = HSE_Send(MU0, u8MuChannel, gSyncTxOption, pHseSrvDesc);

    /* wait for positive response */
    ASSERT(HSE_SRV_RSP_OK == hseStatus);
    return hseStatus;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screenshot-20230522-172325.png" style="width: 683px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/224207iF8625DCEDD7EC058/image-size/large?v=v2&amp;amp;px=999" role="button" title="screenshot-20230522-172325.png" alt="screenshot-20230522-172325.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 09:33:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1654673#M23138</guid>
      <dc:creator>liangyouchao</dc:creator>
      <dc:date>2023-05-22T09:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: HSE active passive block fail</title>
      <link>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1656440#M23242</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209179"&gt;@liangyouchao&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please try to update the FW to latest version which is 0.2.6.0.&lt;/P&gt;
&lt;P&gt;The correct file for AB Swap version (which ensures that OTA flag is enabled by HSE) is this one:&lt;/P&gt;
&lt;P&gt;s32k3x2_hse_fw_1.13.0_2.6.0_pb221129.bin.pink&lt;/P&gt;
&lt;P&gt;Update also the SBAF. It can be found in the 0.2.6.0 FW package too. It will ensure that all the HSE services will be available.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 08:19:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1656440#M23242</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2023-05-24T08:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: HSE active passive block fail</title>
      <link>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1657467#M23290</link>
      <description>&lt;P&gt;Hi Lukas,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have updated HSE_FW_S32K3XX_0_2_6_0. How do I update SBAF&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 08:17:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1657467#M23290</guid>
      <dc:creator>MengWang1</dc:creator>
      <dc:date>2023-05-25T08:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: HSE active passive block fail</title>
      <link>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1657706#M23297</link>
      <description>&lt;P&gt;If you use scripts from the demo app, you can just select in T32:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_0-1685020521575.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/224871i640C2A8C72D2CE40/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_0-1685020521575.png" alt="lukaszadrapa_0-1685020521575.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;The SBAF can be found here:&lt;/P&gt;
&lt;P&gt;c:\NXP\HSE_FW_S32K3XX_0_2_6_0\hse_full_mem\sbaf\bin\s32k3x2_Secure_Baf_0.13.0_0.9.0_pb220502.bin.pink&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or it is described in the HSE Firmware Reference Manual in section 12.7 Secure-BAF update.&lt;/P&gt;
&lt;P&gt;In short, it's necessary to load the pink file somewhere to flash and then call service HSE_SRV_ID_SBAF_UPDATE.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 13:20:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1657706#M23297</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2023-05-25T13:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: HSE active passive block fail</title>
      <link>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1800201#M31337</link>
      <description>&lt;P&gt;Hi，I&amp;nbsp;will&amp;nbsp;update&amp;nbsp;SBAF，but&amp;nbsp;return&amp;nbsp;HSE_SRV_RSP_NOT_ALLOWED，why ？&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 18:15:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/HSE-active-passive-block-fail/m-p/1800201#M31337</guid>
      <dc:creator>huangmingsong</dc:creator>
      <dc:date>2024-02-01T18:15:12Z</dc:date>
    </item>
  </channel>
</rss>

