<?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>S32GのトピックRe: HSE example code on git</title>
    <link>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2022694#M12237</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/234952"&gt;@ashwini2024&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Can you help me indicating where did you find that function? I have searched in the HSE M7 demo app, ARM trusted firmware, u-boot and Linux code bases and I was not able to find it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for the information.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jan 2025 17:24:18 GMT</pubDate>
    <dc:creator>alejandro_e</dc:creator>
    <dc:date>2025-01-06T17:24:18Z</dc:date>
    <item>
      <title>HSE example code on git</title>
      <link>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2022280#M12224</link>
      <description>&lt;P&gt;I am currently working with the HSE APIs on the S32G3 platform and had a query regarding the use of the hse_mem_allocfunction.&lt;/P&gt;&lt;P&gt;From my understanding, this function is used to allocate memory space for operations, but I am concerned about its impact on memory consumption if it is called repeatedly. Could you please clarify:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Is it necessary to use hse_mem_alloc every time memory is allocated for a new operation, or is there an alternative approach that avoids frequent memory allocation?&lt;/LI&gt;&lt;LI&gt;How does the memory allocation mechanism of hse_mem_alloc work under the hood, and does it manage deallocation automatically, or is there a manual cleanup process required?&lt;/LI&gt;&lt;LI&gt;Are there recommended practices for optimizing memory usage when working with HSE operations to avoid potential memory overhead?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thank you in advance for your guidance!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 05:37:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2022280#M12224</guid>
      <dc:creator>ashwini2024</dc:creator>
      <dc:date>2025-01-06T05:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: HSE example code on git</title>
      <link>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2022694#M12237</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/234952"&gt;@ashwini2024&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Can you help me indicating where did you find that function? I have searched in the HSE M7 demo app, ARM trusted firmware, u-boot and Linux code bases and I was not able to find it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for the information.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 17:24:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2022694#M12237</guid>
      <dc:creator>alejandro_e</dc:creator>
      <dc:date>2025-01-06T17:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: HSE example code on git</title>
      <link>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2022953#M12242</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/238460"&gt;@alejandro_e&lt;/a&gt; ,&lt;BR /&gt;The link &lt;A href="https://github.com/nxp-auto-linux/pkcs11-hse/blob/release/bsp40.0/examples/hse-encrypt/hse-encrypt.c#L119" target="_blank"&gt;https://github.com/nxp-auto-linux/pkcs11-hse/blob/release/bsp40.0/examples/hse-encrypt/hse-encrypt.c#L119&lt;/A&gt; for the code .&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 04:45:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2022953#M12242</guid>
      <dc:creator>ashwini2024</dc:creator>
      <dc:date>2025-01-07T04:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: HSE example code on git</title>
      <link>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2022976#M12244</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/234952"&gt;@ashwini2024&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thanks for letting me know. About your question, to the best of my understanding, there is no way to workaround the memory allocation, this means you will need to follow the same flow as the one shown in the examples, therefore you will need to use&amp;nbsp;&lt;STRONG&gt;hse_mem_alloc&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doing a surface level analysis, the logic implemented to handle memory allocation and free is similar to a liked list. However the exact details are out of my expertise.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This function does not handle memory&amp;nbsp;deallocation&amp;nbsp;automatically. You will need to implement your own logic to free the memory using the function&amp;nbsp;&lt;STRONG&gt;hse_mem_free&lt;/STRONG&gt;. You can check the provided examples for a reference on how to use it, for instance&amp;nbsp;&lt;A href="https://github.com/nxp-auto-linux/pkcs11-hse/blob/8b74f76685547874ca6554afcbacbf4793a1db89/examples/hse-encrypt/hse-encrypt.c#L172" target="_blank"&gt;examples/hse-encrypt/hse-encrypt.c#L172&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can also recommend checking section 10.3 of the BSP40 user manual, starting at page 78:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alejandro_e_0-1736229273136.png" style="width: 467px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/318329iE0F9DE7BDA29C641/image-dimensions/467x69?v=v2" width="467" height="69" role="button" title="alejandro_e_0-1736229273136.png" alt="alejandro_e_0-1736229273136.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this information answers your question.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 05:54:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2022976#M12244</guid>
      <dc:creator>alejandro_e</dc:creator>
      <dc:date>2025-01-07T05:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: HSE example code on git</title>
      <link>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2022987#M12245</link>
      <description>&lt;P&gt;I wanted to understand if the HSE memory can get exhausted when handling multiple cryptographic operations concurrently. Are there any specific limitations or guidelines for memory usage when performing multiple HSE operations simultaneously?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 06:24:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2022987#M12245</guid>
      <dc:creator>ashwini2024</dc:creator>
      <dc:date>2025-01-07T06:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: HSE example code on git</title>
      <link>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2023441#M12257</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/234952"&gt;@ashwini2024&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;In general, like any other memory allocation it will have a limit, and if you check the funciton definition&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/nxp-auto-linux/pkcs11-hse/blob/8b74f76685547874ca6554afcbacbf4793a1db89/libhse/hse-mem.c#L119" target="_blank"&gt;libhse/hse-mem.c#L119&lt;/A&gt;&amp;nbsp;you will see there are some conditions that will cause the function to return NULL, which in general means that the memory is all used, as you can see in the examples, if the function returns NULL, the functions return error ENOMEM (Error no memory) for instance in this line &lt;A href="https://github.com/nxp-auto-linux/pkcs11-hse/blob/8b74f76685547874ca6554afcbacbf4793a1db89/examples/hse-encrypt/hse-encrypt.c#L98" target="_blank"&gt;hse-encrypt/hse-encrypt.c#L98&lt;/A&gt;. You can implement a similar mechanism to control when to stop allocating new memory.&lt;/P&gt;
&lt;P&gt;However, by reviewing the code I am not able to conclude what is the exact limit. I will raise this question with the internal team and let you know their feedback.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 17:39:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2023441#M12257</guid>
      <dc:creator>alejandro_e</dc:creator>
      <dc:date>2025-01-07T17:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: HSE example code on git</title>
      <link>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2024163#M12262</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/234952"&gt;@ashwini2024&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I have received the following information from the internal team:&lt;/P&gt;
&lt;P&gt;"&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;The function hse_mem_alloc() allocates memory from the memory space called “HSE reserved memory range”, which is defined in device tree &amp;lt;linux/arch/arm64/boot/dts/freescale/s32cc.dtsi&amp;gt; . Customer can modify the memory range according to user's requirement.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;The HSE driver creates the "HSE reserved memory range” based on the device tree,&amp;nbsp;The source of hse driver is &amp;lt;linux/drivers/uio/uio_hse.c&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;For example, according to the below picture, the start address of HSE reserved memory range is 0x8400 0000 and the size is 0x100 000. So the maximum size can be allocated from&amp;nbsp; hse_mem_alloc() is 16MB.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alejandro_e_0-1736352735033.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/318621i6FC19931EB556D9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alejandro_e_0-1736352735033.png" alt="alejandro_e_0-1736352735033.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this information fully answers your questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 16:17:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/HSE-example-code-on-git/m-p/2024163#M12262</guid>
      <dc:creator>alejandro_e</dc:creator>
      <dc:date>2025-01-08T16:17:20Z</dc:date>
    </item>
  </channel>
</rss>

