<?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 Strange KDS/KE18F behavior in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Strange-KDS-KE18F-behavior/m-p/633157#M8138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am seeing something strange on a KE18F512 with KDS 3.2.&amp;nbsp; It seems to be a linkage problem, but it shows up under debug.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We use an external SPI EEPROM to store data.&amp;nbsp; We've done this on KE06 and KE18F successfully.&amp;nbsp; I modified the linker directive to map the EEPROM section to a "fake" memory region, and in the post-build steps, I use objcopy to separate the EEPROM section into a separate S-record:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;${cross_prefix}objcopy -O srec -R.nvsec c3main.elf c3main.srec&amp;amp;${cross_prefix}objcopy -O srec -j.nvsec --change-section-address .nvsec=0x0 c3main.elf c3eeprom.srec&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have the means to program the EEPROM with initial data in-circuit, and the debugger is aware of the "fake" addresses, but correctly identifies what is there.&amp;nbsp; I have my own routines for reading and writing the EEPROM.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now we've added a second SPI EEPROM, but things are going tragically wrong.&amp;nbsp;&amp;nbsp; I've added to the post build-steps:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;${cross_prefix}objcopy -O srec -R.nvsec -R.nvsec2 c3main.elf c3main.srec&amp;amp;${cross_prefix}objcopy -O srec -j.nvsec --change-section-address .nvsec=0x0 c3main.elf c3eeprom.srec&amp;amp;${cross_prefix}objcopy -O srec -j.nvsec2 --change-section-address .nvsec2=0x0 c3main.elf c3eeprom2.srec&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything is fine, until I actually put something into the second EEPROM, then the debugger can't stop at the beginning breakpoint, and it jumps into strange sections of code.&amp;nbsp; I can't stop it, I just have to kill the process.&amp;nbsp; It doesn't even make it to where it reads or writes the EEPROMs, it just won't boot at all.&amp;nbsp; The linker directive has this:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Specify the memory areas */&lt;BR /&gt;MEMORY&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; m_interrupts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX)&amp;nbsp; : ORIGIN = 0x00000000, LENGTH = 0x00000400&lt;BR /&gt;&amp;nbsp; m_flash_config&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX)&amp;nbsp; : ORIGIN = 0x00000400, LENGTH = 0x00000010&lt;BR /&gt;&amp;nbsp; m_text&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;&amp;nbsp; (RX)&amp;nbsp; : ORIGIN = 0x00000410, LENGTH = 0x0007FBF0&lt;BR /&gt;&amp;nbsp; m_flex&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;&amp;nbsp; (RW)&amp;nbsp; : ORIGIN = 0x10000000, LENGTH = 0x00010000&lt;BR /&gt;&amp;nbsp; m_data&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;&amp;nbsp; (RW)&amp;nbsp; : ORIGIN = 0x1FFF8000, LENGTH = 0x00008000&lt;BR /&gt;&amp;nbsp; m_data_2&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; (RW)&amp;nbsp; : ORIGIN = 0x20000000, LENGTH = 0x00008000&lt;BR /&gt;&amp;nbsp; eeprom&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;&amp;nbsp; (RW)&amp;nbsp; : ORIGIN = 0x60000000, LENGTH = 0x00040000&lt;BR /&gt;&amp;nbsp; eeprom_2&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; (RW)&amp;nbsp; : ORIGIN = 0x60040000, LENGTH = 0x00040000&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;.nvsec :&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;. = ALIGN(4);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;KEEP(*(.nvdata))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;KEEP(*(.nvstrings))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;KEEP(*(.nvptrs))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;KEEP(*(.nvfptrs))&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;. = ALIGN(4);&lt;BR /&gt;&amp;nbsp; } &amp;gt; eeprom&lt;BR /&gt;&amp;nbsp; .nvsec2 :&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(4);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KEEP(*(.nvdata2))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(4);&lt;BR /&gt;&amp;nbsp; } &amp;gt; eeprom_2&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's not a problem of address location; if I move the original EEPROM section up to 0x60040000, it still works&amp;nbsp; fine.&amp;nbsp; It's only when it has data in the second section.&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What gives?&amp;nbsp; Do we have too many sections defined?&amp;nbsp; Am I missing something?&amp;nbsp; Once I put things back into the first EEPROM so that nothing is there, everything runs normally.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Oct 2016 18:56:39 GMT</pubDate>
    <dc:creator>davidsherman</dc:creator>
    <dc:date>2016-10-13T18:56:39Z</dc:date>
    <item>
      <title>Strange KDS/KE18F behavior</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Strange-KDS-KE18F-behavior/m-p/633157#M8138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am seeing something strange on a KE18F512 with KDS 3.2.&amp;nbsp; It seems to be a linkage problem, but it shows up under debug.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We use an external SPI EEPROM to store data.&amp;nbsp; We've done this on KE06 and KE18F successfully.&amp;nbsp; I modified the linker directive to map the EEPROM section to a "fake" memory region, and in the post-build steps, I use objcopy to separate the EEPROM section into a separate S-record:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;${cross_prefix}objcopy -O srec -R.nvsec c3main.elf c3main.srec&amp;amp;${cross_prefix}objcopy -O srec -j.nvsec --change-section-address .nvsec=0x0 c3main.elf c3eeprom.srec&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have the means to program the EEPROM with initial data in-circuit, and the debugger is aware of the "fake" addresses, but correctly identifies what is there.&amp;nbsp; I have my own routines for reading and writing the EEPROM.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now we've added a second SPI EEPROM, but things are going tragically wrong.&amp;nbsp;&amp;nbsp; I've added to the post build-steps:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;${cross_prefix}objcopy -O srec -R.nvsec -R.nvsec2 c3main.elf c3main.srec&amp;amp;${cross_prefix}objcopy -O srec -j.nvsec --change-section-address .nvsec=0x0 c3main.elf c3eeprom.srec&amp;amp;${cross_prefix}objcopy -O srec -j.nvsec2 --change-section-address .nvsec2=0x0 c3main.elf c3eeprom2.srec&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything is fine, until I actually put something into the second EEPROM, then the debugger can't stop at the beginning breakpoint, and it jumps into strange sections of code.&amp;nbsp; I can't stop it, I just have to kill the process.&amp;nbsp; It doesn't even make it to where it reads or writes the EEPROMs, it just won't boot at all.&amp;nbsp; The linker directive has this:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Specify the memory areas */&lt;BR /&gt;MEMORY&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; m_interrupts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX)&amp;nbsp; : ORIGIN = 0x00000000, LENGTH = 0x00000400&lt;BR /&gt;&amp;nbsp; m_flash_config&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX)&amp;nbsp; : ORIGIN = 0x00000400, LENGTH = 0x00000010&lt;BR /&gt;&amp;nbsp; m_text&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;&amp;nbsp; (RX)&amp;nbsp; : ORIGIN = 0x00000410, LENGTH = 0x0007FBF0&lt;BR /&gt;&amp;nbsp; m_flex&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;&amp;nbsp; (RW)&amp;nbsp; : ORIGIN = 0x10000000, LENGTH = 0x00010000&lt;BR /&gt;&amp;nbsp; m_data&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;&amp;nbsp; (RW)&amp;nbsp; : ORIGIN = 0x1FFF8000, LENGTH = 0x00008000&lt;BR /&gt;&amp;nbsp; m_data_2&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; (RW)&amp;nbsp; : ORIGIN = 0x20000000, LENGTH = 0x00008000&lt;BR /&gt;&amp;nbsp; eeprom&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;&amp;nbsp; (RW)&amp;nbsp; : ORIGIN = 0x60000000, LENGTH = 0x00040000&lt;BR /&gt;&amp;nbsp; eeprom_2&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; (RW)&amp;nbsp; : ORIGIN = 0x60040000, LENGTH = 0x00040000&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;.nvsec :&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;. = ALIGN(4);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;KEEP(*(.nvdata))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;KEEP(*(.nvstrings))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;KEEP(*(.nvptrs))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;KEEP(*(.nvfptrs))&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;. = ALIGN(4);&lt;BR /&gt;&amp;nbsp; } &amp;gt; eeprom&lt;BR /&gt;&amp;nbsp; .nvsec2 :&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(4);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KEEP(*(.nvdata2))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(4);&lt;BR /&gt;&amp;nbsp; } &amp;gt; eeprom_2&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's not a problem of address location; if I move the original EEPROM section up to 0x60040000, it still works&amp;nbsp; fine.&amp;nbsp; It's only when it has data in the second section.&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What gives?&amp;nbsp; Do we have too many sections defined?&amp;nbsp; Am I missing something?&amp;nbsp; Once I put things back into the first EEPROM so that nothing is there, everything runs normally.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 18:56:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Strange-KDS-KE18F-behavior/m-p/633157#M8138</guid>
      <dc:creator>davidsherman</dc:creator>
      <dc:date>2016-10-13T18:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Strange KDS/KE18F behavior</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Strange-KDS-KE18F-behavior/m-p/633158#M8139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I figured it out, it seems we've been lucky so far with the one part, apparently the debugger was attempting to initialize the EEPROM sections.&amp;nbsp; I know from experience that it will bus fault if you try to read or write these fake regions, but apparently we got away with it having the one part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made an identical build configuration for debug only that uses a modified linker directive which has the NOLOAD option defined for those regions.&amp;nbsp; Build the release configuration to generate the EEPROM S-records, then build the debug image without them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 20:20:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Strange-KDS-KE18F-behavior/m-p/633158#M8139</guid>
      <dc:creator>davidsherman</dc:creator>
      <dc:date>2016-10-13T20:20:18Z</dc:date>
    </item>
  </channel>
</rss>

