<?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: Problem with SafeRoutineCaller while overwriting flash. in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SafeRoutineCaller-while-overwriting-flash/m-p/665119#M40880</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really sorry but I'm not at liberty to be sharing the project!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I attempt flashing before freeRTOS is started, it seems to work. This seemingly confirms my suspicion that the flashing is mainly failing due to the freeRTOS port of&amp;nbsp;&lt;STRONG style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;taskENTER_CRITICAL()&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;and&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;taskEXIT_CRITICAL()&lt;/STRONG&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;.&lt;BR /&gt;&lt;BR /&gt;However for production, it's not feasible that we actually do this. For this reason, I would still like to solve the problem of performing flashing within the freeRTOS context.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jan 2017 16:40:33 GMT</pubDate>
    <dc:creator>sufyanalamad1</dc:creator>
    <dc:date>2017-01-11T16:40:33Z</dc:date>
    <item>
      <title>Problem with SafeRoutineCaller while overwriting flash.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SafeRoutineCaller-while-overwriting-flash/m-p/665115#M40876</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;My setup is a Cortex-M0+ (MKL15Z128VFT4) running freeRTOS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to write to flash using the ProcessorExpert components. Inside of of method&amp;nbsp;IntFlashLdd2_Main, SafeRoutineCaller() is used. This function has been confirmed to be the point of failure. The processor resets to __vect__table 0x00.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our bootloader&amp;nbsp;&lt;STRONG&gt;does not&lt;/STRONG&gt; use freeRTOS, and also writes to flash, but works perfectly. This leads me to think that the issue arises from the freeRTOS ports&amp;nbsp;&lt;STRONG&gt;taskENTER_CRITICAL()&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;taskEXIT_CRITICAL()&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However our generated watchdog clearing function also uses the above freeRTOS functions, and that is working fine.&lt;BR /&gt;&lt;BR /&gt;I would appreciate some help resolving this issue.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2017 22:11:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SafeRoutineCaller-while-overwriting-flash/m-p/665115#M40876</guid>
      <dc:creator>sufyanalamad1</dc:creator>
      <dc:date>2017-01-05T22:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SafeRoutineCaller while overwriting flash.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SafeRoutineCaller-while-overwriting-flash/m-p/665116#M40877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="292748" data-username="sufyanalamad" href="https://community.nxp.com/people/sufyanalamad"&gt;sufyanalamad&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest you increase the stack size of the flash task to 1000 or bigger to see whether it helps.&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>Mon, 09 Jan 2017 06:43:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SafeRoutineCaller-while-overwriting-flash/m-p/665116#M40877</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2017-01-09T06:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SafeRoutineCaller while overwriting flash.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SafeRoutineCaller-while-overwriting-flash/m-p/665117#M40878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Daniel, thanks for responding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a separate task just for the flashing, it has 2100 bytes of stack allocated to it. I am unable to allocate more due to what I think is heap fragmentation, as I am deleting some tasks before creating this one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways, 2100 sounds like it should be enough -- yet it still fails in the same way. For the flashing, I am doing 16 bytes at a time, exactly like our bootloader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you still think it's a stack problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;EDIT: I have just managed to try it with 8192 bytes allocated to the flashing task. Still the same problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2017 17:21:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SafeRoutineCaller-while-overwriting-flash/m-p/665117#M40878</guid>
      <dc:creator>sufyanalamad1</dc:creator>
      <dc:date>2017-01-09T17:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SafeRoutineCaller while overwriting flash.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SafeRoutineCaller-while-overwriting-flash/m-p/665118#M40879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="292748" data-username="sufyanalamad" href="https://community.nxp.com/people/sufyanalamad"&gt;sufyanalamad&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From your description, it is not a stack problem.&amp;nbsp; could you share your project for further analyzing?&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>Wed, 11 Jan 2017 07:29:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SafeRoutineCaller-while-overwriting-flash/m-p/665118#M40879</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2017-01-11T07:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SafeRoutineCaller while overwriting flash.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SafeRoutineCaller-while-overwriting-flash/m-p/665119#M40880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really sorry but I'm not at liberty to be sharing the project!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I attempt flashing before freeRTOS is started, it seems to work. This seemingly confirms my suspicion that the flashing is mainly failing due to the freeRTOS port of&amp;nbsp;&lt;STRONG style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;taskENTER_CRITICAL()&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;and&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;taskEXIT_CRITICAL()&lt;/STRONG&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;.&lt;BR /&gt;&lt;BR /&gt;However for production, it's not feasible that we actually do this. For this reason, I would still like to solve the problem of performing flashing within the freeRTOS context.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jan 2017 16:40:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-SafeRoutineCaller-while-overwriting-flash/m-p/665119#M40880</guid>
      <dc:creator>sufyanalamad1</dc:creator>
      <dc:date>2017-01-11T16:40:33Z</dc:date>
    </item>
  </channel>
</rss>

