<?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 C40 Flash driver - Domain ID explanation in S32K</title>
    <link>https://community.nxp.com/t5/S32K/C40-Flash-driver-Domain-ID-explanation/m-p/1793885#M30995</link>
    <description>&lt;P&gt;I'm using the C40_Ip_Example_S32K344 to develop Flash operations. I've imported the C40 component (obviously the corresponding generated files) into a custom project and functions for erasing, writing and reading work only with DomainIdValue = 0, because otherwise code keeps looping into the "do-while" attached below, because ActualDomainIDs = 0 and DomainIdValue = 1.&lt;/P&gt;&lt;P&gt;Into C40_Ip_Example_S32K344&amp;nbsp; code example FLS_MASTER_ID = 0 (then FLS_MASTER_ID&amp;nbsp; is assigned to DomainIdValue when calling C40 functions).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/**
 * Function Name    C40_Ip_MainInterfaceWriteJobAddress
 * Description      Write the address in the PEADR register
 */
static C40_Ip_StatusType C40_Ip_MainInterfaceWriteJobAddress(uint32 PhysicalAddress,
                                                             uint8 DomainIdValue
                                                            )
{
    C40_Ip_StatusType ReturnCode = STATUS_C40_IP_SUCCESS;
    uint8 ActualDomainIDs;

    /* Write the address in the PEADR register */
    do
    {
        #if (STD_ON == C40_IP_ENABLE_USER_MODE_SUPPORT)
        OsIf_Trusted_Call1param(C40_Ip_MainInterfaceWriteLogicalAddress, PhysicalAddress);
        #else
        C40_Ip_MainInterfaceWriteLogicalAddress(PhysicalAddress);
        #endif

        ActualDomainIDs = (uint8)((C40_Ip_pFlashBaseAddress-&amp;gt;MCR &amp;amp; FLASH_MCR_PEID_MASK) &amp;gt;&amp;gt; FLASH_MCR_PEID_SHIFT);

        #if (STD_ON == C40_TIMEOUT_SUPERVISION_ENABLED)
        C40_Ip_u32ElapsedTicks += OsIf_GetElapsed(&amp;amp;C40_Ip_u32CurrentTicks, (OsIf_CounterType)C40_TIMEOUT_TYPE);
        if (C40_Ip_u32ElapsedTicks &amp;gt;= C40_Ip_u32TimeoutTicks)
        {
            /* Errors Timeout because wait for the Done bit long time*/
            ReturnCode = STATUS_C40_IP_ERROR_TIMEOUT;
            break;
        }
        #endif
    }
    while (ActualDomainIDs != DomainIdValue);

    return ReturnCode;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't understand the usage of DomainIdValue input argument: is it the Core number to use for executing the erase/write operation?&lt;BR /&gt;&lt;BR /&gt;In my project, Core 0 is running code (from Flash block 1) and Core 1 is running this functions (from Flash block 1) for erasing a sector into Flash block 2: just to be clear, running C40 functions from Core 1 with DomainIdValue = 0 works, but not with DomainIdValue = 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jan 2024 14:35:11 GMT</pubDate>
    <dc:creator>Drifter22</dc:creator>
    <dc:date>2024-01-23T14:35:11Z</dc:date>
    <item>
      <title>C40 Flash driver - Domain ID explanation</title>
      <link>https://community.nxp.com/t5/S32K/C40-Flash-driver-Domain-ID-explanation/m-p/1793885#M30995</link>
      <description>&lt;P&gt;I'm using the C40_Ip_Example_S32K344 to develop Flash operations. I've imported the C40 component (obviously the corresponding generated files) into a custom project and functions for erasing, writing and reading work only with DomainIdValue = 0, because otherwise code keeps looping into the "do-while" attached below, because ActualDomainIDs = 0 and DomainIdValue = 1.&lt;/P&gt;&lt;P&gt;Into C40_Ip_Example_S32K344&amp;nbsp; code example FLS_MASTER_ID = 0 (then FLS_MASTER_ID&amp;nbsp; is assigned to DomainIdValue when calling C40 functions).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/**
 * Function Name    C40_Ip_MainInterfaceWriteJobAddress
 * Description      Write the address in the PEADR register
 */
static C40_Ip_StatusType C40_Ip_MainInterfaceWriteJobAddress(uint32 PhysicalAddress,
                                                             uint8 DomainIdValue
                                                            )
{
    C40_Ip_StatusType ReturnCode = STATUS_C40_IP_SUCCESS;
    uint8 ActualDomainIDs;

    /* Write the address in the PEADR register */
    do
    {
        #if (STD_ON == C40_IP_ENABLE_USER_MODE_SUPPORT)
        OsIf_Trusted_Call1param(C40_Ip_MainInterfaceWriteLogicalAddress, PhysicalAddress);
        #else
        C40_Ip_MainInterfaceWriteLogicalAddress(PhysicalAddress);
        #endif

        ActualDomainIDs = (uint8)((C40_Ip_pFlashBaseAddress-&amp;gt;MCR &amp;amp; FLASH_MCR_PEID_MASK) &amp;gt;&amp;gt; FLASH_MCR_PEID_SHIFT);

        #if (STD_ON == C40_TIMEOUT_SUPERVISION_ENABLED)
        C40_Ip_u32ElapsedTicks += OsIf_GetElapsed(&amp;amp;C40_Ip_u32CurrentTicks, (OsIf_CounterType)C40_TIMEOUT_TYPE);
        if (C40_Ip_u32ElapsedTicks &amp;gt;= C40_Ip_u32TimeoutTicks)
        {
            /* Errors Timeout because wait for the Done bit long time*/
            ReturnCode = STATUS_C40_IP_ERROR_TIMEOUT;
            break;
        }
        #endif
    }
    while (ActualDomainIDs != DomainIdValue);

    return ReturnCode;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't understand the usage of DomainIdValue input argument: is it the Core number to use for executing the erase/write operation?&lt;BR /&gt;&lt;BR /&gt;In my project, Core 0 is running code (from Flash block 1) and Core 1 is running this functions (from Flash block 1) for erasing a sector into Flash block 2: just to be clear, running C40 functions from Core 1 with DomainIdValue = 0 works, but not with DomainIdValue = 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 14:35:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/C40-Flash-driver-Domain-ID-explanation/m-p/1793885#M30995</guid>
      <dc:creator>Drifter22</dc:creator>
      <dc:date>2024-01-23T14:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: C40 Flash driver - Domain ID explanation</title>
      <link>https://community.nxp.com/t5/S32K/C40-Flash-driver-Domain-ID-explanation/m-p/1794813#M31044</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/179750"&gt;@Drifter22&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can find the RTD_MEM_43_INFLS User Manual, which describes the AUTOSAR Mem_43_InFls Driver for S32K3XX under the following directory:&lt;/P&gt;
&lt;P&gt;"C:\nxp\SW32K3_RTD_4.4_R21-11_3.0.0\eclipse\plugins\Mem_43_InFls_TS_T40D34M30I0R0\doc"&lt;/P&gt;
&lt;P&gt;Here, you can find the definition for "&lt;EM&gt;DomainIdValue:&amp;nbsp;ID for the core that requests sector lock"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Julián&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 18:31:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/C40-Flash-driver-Domain-ID-explanation/m-p/1794813#M31044</guid>
      <dc:creator>Julián_AragónM</dc:creator>
      <dc:date>2024-01-24T18:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: C40 Flash driver - Domain ID explanation</title>
      <link>https://community.nxp.com/t5/S32K/C40-Flash-driver-Domain-ID-explanation/m-p/1795296#M31076</link>
      <description>&lt;P&gt;Thanks for the link, the meaning now it's clear.&lt;/P&gt;&lt;P&gt;Regarding my specific project, could you help me to find out why it doesn't work chosing Core 1 to execute operations (link clear lock, erasing sector, etc.)?&lt;/P&gt;&lt;P&gt;I was also wondering why I'm not finding a description of the function&amp;nbsp;C40_Ip_MainInterfaceSectorErase that it's generated with C40 component. Could you help me?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 09:22:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/C40-Flash-driver-Domain-ID-explanation/m-p/1795296#M31076</guid>
      <dc:creator>Drifter22</dc:creator>
      <dc:date>2024-01-25T09:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: C40 Flash driver - Domain ID explanation</title>
      <link>https://community.nxp.com/t5/S32K/C40-Flash-driver-Domain-ID-explanation/m-p/1796227#M31134</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/179750"&gt;@Drifter22&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The information for&amp;nbsp;&lt;SPAN&gt;C40_Ip_MainInterfaceSectorErase is under&amp;nbsp;&lt;STRONG&gt;chapter&amp;nbsp;6.1.6.12&amp;nbsp;&lt;/STRONG&gt;from the User Manual.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let me check with the team for the first question, and I will get back with you as soon as I get an answer.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;BR /&gt;Julián.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 19:04:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/C40-Flash-driver-Domain-ID-explanation/m-p/1796227#M31134</guid>
      <dc:creator>Julián_AragónM</dc:creator>
      <dc:date>2024-01-26T19:04:16Z</dc:date>
    </item>
  </channel>
</rss>

