<?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: Multi-core shared memory problem in MPC5xxx</title>
    <link>https://community.nxp.com/t5/MPC5xxx/Multi-core-shared-memory-problem/m-p/1894382#M25682</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/224715"&gt;@xiha&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yes, it makes sense that this does not work. Of course, the program will never leave the interrupt handler to finish the critical section in main function. You can do something like this in operating system between different tasks but not here. This must be solved on application level. For example, you can set just some SW flag in the interrupt handler and then build some state machine in main which can handle this.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2024 11:37:52 GMT</pubDate>
    <dc:creator>lukaszadrapa</dc:creator>
    <dc:date>2024-06-26T11:37:52Z</dc:date>
    <item>
      <title>Multi-core shared memory problem</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Multi-core-shared-memory-problem/m-p/1893742#M25674</link>
      <description>&lt;P&gt;Now, &lt;SPAN&gt;my Z4 core is responsible for Ethernet communication and Z2 core is responsible for CANFD communication.CANFD has a shared memory for receiving data, and Ethernet has a shared memory for receiving data.So I used &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;two mutex locks&lt;/STRONG&gt;&lt;/FONT&gt; to protect these two shared memory Spaces.But it triggers a deadlock.The brief code is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiha_1-1719328411674.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/285683iBBF1C899973F2916/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiha_1-1719328411674.png" alt="xiha_1-1719328411674.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the z4 core main program obtains the can_mutex, the Z2 core main program also obtains the enet_mutex. &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Both cores then trigger an interrupt when the mutex is not released&lt;/STRONG&gt;&lt;/FONT&gt;, and both are stuck where the lock was obtained.&lt;/P&gt;&lt;P&gt;If I am not clear, please tell me what else you would like to know.Finally, I would like to ask if there is any good advice for me.Than you very much!!!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 15:21:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Multi-core-shared-memory-problem/m-p/1893742#M25674</guid>
      <dc:creator>xiha</dc:creator>
      <dc:date>2024-06-25T15:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-core shared memory problem</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Multi-core-shared-memory-problem/m-p/1894382#M25682</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/224715"&gt;@xiha&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yes, it makes sense that this does not work. Of course, the program will never leave the interrupt handler to finish the critical section in main function. You can do something like this in operating system between different tasks but not here. This must be solved on application level. For example, you can set just some SW flag in the interrupt handler and then build some state machine in main which can handle this.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 11:37:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Multi-core-shared-memory-problem/m-p/1894382#M25682</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2024-06-26T11:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Multi-core shared memory problem</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Multi-core-shared-memory-problem/m-p/1895787#M25690</link>
      <description>&lt;P class=""&gt;I've changed my plan to not use mutex.I have found that when using a shared memory area with two cores, it occurs that the cache is not updated. Using two locks solves the cache problem, but it deadlocks. My colleague used the assembly code msync to solve this caching problem, &lt;SPAN&gt;so I can not use the lock&lt;/SPAN&gt;, thank you for your help&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 08:45:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Multi-core-shared-memory-problem/m-p/1895787#M25690</guid>
      <dc:creator>xiha</dc:creator>
      <dc:date>2024-06-28T08:45:07Z</dc:date>
    </item>
  </channel>
</rss>

