<?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>MCUXpresso SDK中的主题 Re: Flash swap with FreeRTOS</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/Flash-swap-with-FreeRTOS/m-p/971466#M1849</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you can not reproduce this issue when enabling 2 or tasks, and can reproduce when running more than 9 tasks. I would suggest you check the stack size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a multitask OS, the main tasks should can continue running while new firmware is being loaded by a separate uploader/programmer task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Nov 2019 08:04:23 GMT</pubDate>
    <dc:creator>danielchen</dc:creator>
    <dc:date>2019-11-28T08:04:23Z</dc:date>
    <item>
      <title>Flash swap with FreeRTOS</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Flash-swap-with-FreeRTOS/m-p/971465#M1848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We implemented flash swap feature for OTA firmware update&amp;nbsp;in our&amp;nbsp;program. We noticed that sometimes&amp;nbsp;flash swapping provoked a reboot and&amp;nbsp;flash blocks were not swapped.&lt;/P&gt;&lt;P&gt;After&amp;nbsp;many debug sessions, it appears that&amp;nbsp;it's&amp;nbsp;when we call&amp;nbsp;FTFx_CMD_SwapControl&amp;nbsp;or FLASH_Swap&amp;nbsp;function while other OS tasks are running that a crash can occurs.&lt;/P&gt;&lt;P&gt;When enabling only 2 or 3 tasks I was not able to&amp;nbsp;reproduce the issue. But with more tasks running (up to 9) it happens quite often.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Disabling interruptions before calling the swap methods resolved&amp;nbsp;this issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is why do we need to do this whereas none of the running tasks are doing flash write instructions during the&amp;nbsp;call of these methods?&lt;/P&gt;&lt;P&gt;Is disabling interrupts during swap procedure the correct way to proceed with an rtos?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Target is a MK26FN2M0VMD18.&lt;/P&gt;&lt;P&gt;SDK version 2.5.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;DIV style="position: absolute; left: 69px; top: 352px;"&gt;&lt;DIV class="gtx-trans-icon"&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2019 08:34:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Flash-swap-with-FreeRTOS/m-p/971465#M1848</guid>
      <dc:creator>timothéehaugedé</dc:creator>
      <dc:date>2019-10-11T08:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Flash swap with FreeRTOS</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Flash-swap-with-FreeRTOS/m-p/971466#M1849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you can not reproduce this issue when enabling 2 or tasks, and can reproduce when running more than 9 tasks. I would suggest you check the stack size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a multitask OS, the main tasks should can continue running while new firmware is being loaded by a separate uploader/programmer task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Nov 2019 08:04:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Flash-swap-with-FreeRTOS/m-p/971466#M1849</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2019-11-28T08:04:23Z</dc:date>
    </item>
  </channel>
</rss>

