<?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: SDRAM problems when flash is read-protected in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SDRAM-problems-when-flash-is-read-protected/m-p/410117#M23091</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tested SDRAM example posted in &lt;A href="https://community.nxp.com/message/549762"&gt;Re: can't read data back from SDRAM&lt;/A&gt; , and the same issue happens.&lt;/P&gt;&lt;P&gt;I have modified it a little, to print a message on console when SDRAM tests are performed -&amp;gt; it works fine when flash is not protected and fails when flash is protected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, could anyone tell me if faced the same problem and if could resolve it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Nov 2015 08:06:05 GMT</pubDate>
    <dc:creator>cgarcia1</dc:creator>
    <dc:date>2015-11-16T08:06:05Z</dc:date>
    <item>
      <title>SDRAM problems when flash is read-protected</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SDRAM-problems-when-flash-is-read-protected/m-p/410116#M23090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a Tower with Kinetis K65, and I managed some time ago to configure SDRAM and use it with not too much problems, but today I faced a very very strange issue.&lt;/P&gt;&lt;P&gt;Everything works fine when FTFE_FSEC is 0xFE, but when I change SEC bits to != 0b10, the device doesn't boots up.&lt;/P&gt;&lt;P&gt;Of course, under this circumstance I can't debug, as on-board flash is read-protected. After several tests, I found that when I disable the SDRAM initialization, the device works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone has seen something similar before? Can you give any indication of what can be wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tested several combinations of FTFE_FSEC[SEC] bits. No positive results when flash external read is disbled.&lt;/P&gt;&lt;P&gt;This is my latest setting (in startup_MK65F18.S) :&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;/* Flash Configuration */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .section .FlashConfig, "a"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFBF&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using KDS with MQX. SDRAM configuration is done with ProcessorExpert (and it works fine when FTFE_FSEC[SEC] == 0b10)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Device is able to boot (although SDRAM is not working) when I comment this two lines in SDRAM_Init.c&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; /* Write to an appropriate SDRAM address generates the pall command to the SDRAM block */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; //*((uint8_t *)CS0_SDRAM_BASE_ADDRESS) = 0x00U;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; /* Write access to the SDRAM address space generates the MRS command to that SDRAM */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; //*((uint32_t *)CS0_MRS_COMMAND_ADDRESS) = 0x00000000U;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that this two lines are attempting to write to SDRAM address, and I suspect that this is causing any kind of CPU fault.&lt;/P&gt;&lt;P&gt;It's very strange... when I set FTFE_FSEC[SEC] to 0b10 everything works just fine...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 16:20:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SDRAM-problems-when-flash-is-read-protected/m-p/410116#M23090</guid>
      <dc:creator>cgarcia1</dc:creator>
      <dc:date>2015-11-13T16:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM problems when flash is read-protected</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SDRAM-problems-when-flash-is-read-protected/m-p/410117#M23091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tested SDRAM example posted in &lt;A href="https://community.nxp.com/message/549762"&gt;Re: can't read data back from SDRAM&lt;/A&gt; , and the same issue happens.&lt;/P&gt;&lt;P&gt;I have modified it a little, to print a message on console when SDRAM tests are performed -&amp;gt; it works fine when flash is not protected and fails when flash is protected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, could anyone tell me if faced the same problem and if could resolve it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2015 08:06:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SDRAM-problems-when-flash-is-read-protected/m-p/410117#M23091</guid>
      <dc:creator>cgarcia1</dc:creator>
      <dc:date>2015-11-16T08:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM problems when flash is read-protected</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SDRAM-problems-when-flash-is-read-protected/m-p/410118#M23092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is related to the security level on Kinetis. Please see following description from K65 RM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;9.3.1 Security interactions with FlexBus and SDRAM controller&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When flash security is enabled, SIM_SOPT2[FBSL] enables/disables off-chip accesses&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;through the FlexBus and the SDRAM interfaces. The FBSL bitfield also has an option to&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;allow opcode and operand accesses or only operand accesses.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Default configuration for FBSL disallow Flexbus or SDRAM access. So you need to program FBSL to appropriate configuration.&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/29511iBAC451C1086CD374/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;Hao&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2015 08:36:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SDRAM-problems-when-flash-is-read-protected/m-p/410118#M23092</guid>
      <dc:creator>cutworth</dc:creator>
      <dc:date>2015-11-16T08:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM problems when flash is read-protected</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SDRAM-problems-when-flash-is-read-protected/m-p/410119#M23093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Hao, for your answer!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the place to configure this setting in ProcessorExpert (in FB component)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="fbsl_pex.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/29745iCD10FA2025F7F308/image-size/large?v=v2&amp;amp;px=999" role="button" title="fbsl_pex.png" alt="fbsl_pex.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Configuring FBSL to the desired value solves the issue. Now I'm able to access SDRAM data with internal flash protection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your precise answer :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2015 09:16:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SDRAM-problems-when-flash-is-read-protected/m-p/410119#M23093</guid>
      <dc:creator>cgarcia1</dc:creator>
      <dc:date>2015-11-16T09:16:43Z</dc:date>
    </item>
  </channel>
</rss>

