<?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>Processor Expert SoftwareのトピックReset when calling SetFlexNVMPartition() using KDS, PE and K22</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/Reset-when-calling-SetFlexNVMPartition-using-KDS-PE-and-K22/m-p/344095#M2612</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using Processor Expert within Kinetis Design Studio 1.1.1 with a MK22DX256VLH5 processor and I am trying to get the FlexNVM EEPROM to work but having difficulty with the partitioning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've setup the memory organization as per the attached screenshot (all EEPROM no DFlash):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/48133i9035E04EAF8FA28B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is my understanding that the partitioning must either be done by the programmer (I am using a PE Micro Multilink Universal FX) or within software.&amp;nbsp; I'm currently using the GDB server for programming / debugging within KDS and I don't see any options to specify the partition information so I have decided to go the software route (although I am not opposed to using the programmer to set the partition).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My partition initialization code (called from the main function) is as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define FTFL_FCNFG_EEERDY&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x01&lt;/P&gt;&lt;P&gt;void FlexEE_Init()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint16_t code = Cpu_GetFlexNVMPartitionCode();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (code == FLEX_NVM_REQUESTED_PARTITION_CODE)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // output debug information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Cpu_SetFlexNVMPartition() == ERR_FAILED )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // output debug information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Cpu_SetFlexRAMFunction(FlexRAM_AS_EEPROM) == ERR_FAILED)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // output debug information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int count = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (!(FTFL_FCNFG &amp;amp; FTFL_FCNFG_EEERDY))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (count++ &amp;gt; 20000)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // output debug information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code returned from GetFlexNVMPartitionCode is always 0x3F0F which means the EEPROM Data Set Size and FlexNVM Partition Code registers are all set to 1.&amp;nbsp; This is fine because it means it needs to be partitioned.&amp;nbsp; When Cpu_SetFlexNVMPartition() is called it gets all the way until the point where within&amp;nbsp; Cpu_StartCmdAndWaitForCmdDoneOnTheStack() it goes to call the code on the stack and then the processor resets back to the initial startup points @ __thumb_startup(void).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help or insight would be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Dec 2014 16:37:04 GMT</pubDate>
    <dc:creator>ryannickel</dc:creator>
    <dc:date>2014-12-11T16:37:04Z</dc:date>
    <item>
      <title>Reset when calling SetFlexNVMPartition() using KDS, PE and K22</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Reset-when-calling-SetFlexNVMPartition-using-KDS-PE-and-K22/m-p/344095#M2612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using Processor Expert within Kinetis Design Studio 1.1.1 with a MK22DX256VLH5 processor and I am trying to get the FlexNVM EEPROM to work but having difficulty with the partitioning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've setup the memory organization as per the attached screenshot (all EEPROM no DFlash):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/48133i9035E04EAF8FA28B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is my understanding that the partitioning must either be done by the programmer (I am using a PE Micro Multilink Universal FX) or within software.&amp;nbsp; I'm currently using the GDB server for programming / debugging within KDS and I don't see any options to specify the partition information so I have decided to go the software route (although I am not opposed to using the programmer to set the partition).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My partition initialization code (called from the main function) is as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define FTFL_FCNFG_EEERDY&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x01&lt;/P&gt;&lt;P&gt;void FlexEE_Init()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint16_t code = Cpu_GetFlexNVMPartitionCode();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (code == FLEX_NVM_REQUESTED_PARTITION_CODE)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // output debug information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Cpu_SetFlexNVMPartition() == ERR_FAILED )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // output debug information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Cpu_SetFlexRAMFunction(FlexRAM_AS_EEPROM) == ERR_FAILED)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // output debug information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int count = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (!(FTFL_FCNFG &amp;amp; FTFL_FCNFG_EEERDY))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (count++ &amp;gt; 20000)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // output debug information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code returned from GetFlexNVMPartitionCode is always 0x3F0F which means the EEPROM Data Set Size and FlexNVM Partition Code registers are all set to 1.&amp;nbsp; This is fine because it means it needs to be partitioned.&amp;nbsp; When Cpu_SetFlexNVMPartition() is called it gets all the way until the point where within&amp;nbsp; Cpu_StartCmdAndWaitForCmdDoneOnTheStack() it goes to call the code on the stack and then the processor resets back to the initial startup points @ __thumb_startup(void).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help or insight would be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 16:37:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Reset-when-calling-SetFlexNVMPartition-using-KDS-PE-and-K22/m-p/344095#M2612</guid>
      <dc:creator>ryannickel</dc:creator>
      <dc:date>2014-12-11T16:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Reset when calling SetFlexNVMPartition() using KDS, PE and K22</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Reset-when-calling-SetFlexNVMPartition-using-KDS-PE-and-K22/m-p/344096#M2613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have checked a demo application for MK40DX256VLQ10 derivative and it works fine. According to your decription, it seems that the reset can be caused by a stack overflow. You can try increase stack size because the CPU_StartCmdAndWaitForCmdDoneOnTheStack function use the stack to execute a subroutine (the demo application has Stack size set to 0x400). You can set the stack size in the Component Inspector of the CPU, Build options tab, Generated linker file/Stack size property.&lt;/P&gt;&lt;P&gt;I have attached the demo application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Marek Neuzil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2015 13:08:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Reset-when-calling-SetFlexNVMPartition-using-KDS-PE-and-K22/m-p/344096#M2613</guid>
      <dc:creator>marek_neuzil</dc:creator>
      <dc:date>2015-02-12T13:08:14Z</dc:date>
    </item>
  </channel>
</rss>

