<?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>LPC MicrocontrollersのトピックRe: SDRAM interface issue with LPC4367 Controller using __Data attribute and __BSS Attribute</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1404420#M47740</link>
    <description>&lt;P&gt;&lt;EM&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;&amp;gt; Refer the attached code in the thread and revert. after doing this it is working properly but same modification&amp;nbsp;is done in the main code there it is not working. the only difference is instead of Buffer array I am assigning Structure array to it.&amp;nbsp;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;&amp;gt; Also the variables of different data types are there uint8_t, uint16_t, uint32_t son checking the same issue also I am using memcpy function for copying the data to it.&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;I am not sure either.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;I would first check the addresses of said variables/structs in the map file, if they are correctly located. And then check in the debugger how actual access works out.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;I did not need any pre-main initialisation, so initialisation of the EMC interface and the RAM itself is done in main.&amp;nbsp;For my project I used the pointer method as well. Writing is done in an interrupt handler, and I kept it as short as possible.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jan 2022 08:17:32 GMT</pubDate>
    <dc:creator>frank_m</dc:creator>
    <dc:date>2022-01-25T08:17:32Z</dc:date>
    <item>
      <title>SDRAM interface issue with LPC4367 Controller using __Data attribute and __BSS Attribute</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1402252#M47691</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Hi,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;I am using LPC4367 controller. I have interfaced SDRAM with the controller. I have verified the interface using the test code , refer the attached code for the same.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;It is working with 16bit mode (2Byte). The test code use pointer functionality and writes 0XA5A5 and 0x5A5A and write the same in the SDRAM location. I verified it for 4 MB size.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;But when I used __BSS attribute and allocate the array variable to the SDRAM location, then the data stored is fail. Means it stores 0xFFFF instead. so with the same configuration it works using pointer functionality then what would be the reason for not working in&amp;nbsp; __DATA or __BSS mode.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Refer the attached code and please comment on the same. also raised the ticket for the same. The attached&amp;nbsp;code is implemented using the pointer functionality.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;BR,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Gaurav More&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 04:45:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1402252#M47691</guid>
      <dc:creator>gauravmore</dc:creator>
      <dc:date>2022-01-20T04:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM interface issue with LPC4367 Controller using __Data attribute and __BSS Attribute</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1402386#M47694</link>
      <description>&lt;P&gt;Hi, Gaurav,&lt;/P&gt;
&lt;P&gt;As you know that the external SDRAM can save data only after the EMC module is initialized, I suppose that you initialize the EMC in your application&amp;nbsp; code, so you can access the SDRAM with pointer successfully , because at this time when you access SDRAM with pointer, the EMC has been initialized. But when you use .bss section, or __DATA section, cpu access the SDRAM address before the EMC is initialized, of course, you can not write/read successfully.&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 07:42:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1402386#M47694</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2022-01-20T07:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM interface issue with LPC4367 Controller using __Data attribute and __BSS Attribute</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1402482#M47696</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Hi&amp;nbsp;&amp;nbsp;&lt;A href="https://community.nxp.com/t5/user/viewprofilepage/user-id/26034" target="_self"&gt;&lt;SPAN class=""&gt;xiangjun_rong&lt;/SPAN&gt;&lt;/A&gt;,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Thanks for the quick response, But in my case i am initializing the EMC lines at the Chip_SystemInit() function itself&amp;nbsp; where the CPU will come first before it goes to main function&amp;nbsp;routine.&lt;/FONT&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Regarding the data access it will only be done when i will call and assign&amp;nbsp;the data to the variable. So the EMC line will only be active when we access the actual address allocated to that EMC CS line.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Also i will try with different code and confirm you by writing the same patterns,&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;0xA5A5, 0x5555, 0x5A5A. It should work accordingly.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Also check the modified code which i will now download and check. i created the RAM8 in MCU setting option in the properties. You can refer the code and check the EMC init function called in&amp;nbsp;Chip_SystemInit() in sysinit.c file. do you think calling this EMC init function&amp;nbsp;in the above mentioned Chip_SystemInit function will also reflect the same behavior?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Refer the attached code for reference&amp;nbsp;and review so that i can proceed&amp;nbsp;further with the development.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;BR,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Gaurav More&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 08:59:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1402482#M47696</guid>
      <dc:creator>gauravmore</dc:creator>
      <dc:date>2022-01-20T08:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM interface issue with LPC4367 Controller using __Data attribute and __BSS Attribute</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1402520#M47697</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;As the following screenshot, in the cr_startup_lpc43xx.c file, the bss section is initialized as 0.&lt;/P&gt;
&lt;P&gt;BTW, as you know the SDRAM is RAM, volatile memory, it can not save constant data, the constant must be saved in flash, and copy to RAM as the following code.&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_0-1642670660573.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/168329i7B14F53A627F52D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_0-1642670660573.png" alt="xiangjun_rong_0-1642670660573.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 09:30:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1402520#M47697</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2022-01-20T09:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM interface issue with LPC4367 Controller using __Data attribute and __BSS Attribute</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1403098#M47710</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; As the following screenshot, in the cr_startup_lpc43xx.c file, the bss section is initialized as 0.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;gt; BTW, as you know the SDRAM is RAM, volatile memory, it can not save constant data, the constant must be saved in flash, and copy to RAM as the following code.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It shouldn't be too difficult to modify the startup code, and initialize the EMC before the constants (Flash data) are copied.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 06:44:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1403098#M47710</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2022-01-21T06:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM interface issue with LPC4367 Controller using __Data attribute and __BSS Attribute</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1404305#M47737</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Hi Frank,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;It is already done in the attached code in the thread. The initialization of EMI lines are done in the startup function inside&amp;nbsp;SystemInit() - &amp;gt;Chip_SystemInit()-&amp;gt;EMC_SetPinMux() &amp;amp; EMC_SetupSDRAMMemmory()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Also I verified it by using below code modification in the attached reference code.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#define SDRAM_SIZE_BYTES       (2* 1024 * 1024)
#define	SDRAM_SIZE		SDRAM_SIZE_BYTES
__BSS(RAM8)	uint16_t	Buffer[SDRAM_SIZE_BYTES ];
__BSS(RAM9)	uint16_t	Buffer1[SDRAM_SIZE_BYTES ];

void main(void)
{
 uint32_t l_ui_Count = 0;
 uint8_t l_ui8_status = 0, l_ui8_status1 = 0;
/* Writing the data in SDRAM RAM*/
for(l_ui_Count = 0; l_ui_Count &amp;lt; SDRAM_SIZE; l_ui_Count++ )
{
  Buffer[l_ui_Count] = 0x5555;
  Buffer1[l_ui_Count] = 0xA5A5;
}

/* Reading the data from SDRAM and verification of the same */ 
for(l_ui_Count = 0; l_ui_Count &amp;lt; SDRAM_SIZE; l_ui_Count++ )
{
  if(Buffer[l_ui_Count] != 0x5555)
  {
    l_ui8_status = 1;
  }

  if(Buffer1[l_ui_Count] != 0xA5A5)
  {
    l_ui8_status1 = 1;
   }
}

while(1)
{
  if(l_ui8_status == 0 &amp;amp;&amp;amp; l_ui8_status1 == 0)
  {
    Chip_GPIO_SetPinToggle(LPC_GPIO_PORT, 5, 5);
    for (i=0; i&amp;lt;0xFFFFF;i++ );
    Chip_GPIO_SetPinToggle(LPC_GPIO_PORT, 5, 19);
    for (i=0; i&amp;lt;0xFFFFF;i++ );
  }
  else
  {
   Chip_GPIO_SetPinState(LPC_GPIO_PORT, 5, 19, (bool) false);
  }
}
   return 0 ;
}/* Main()*/&lt;/LI-CODE&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Refer the attached code in the thread and revert. after doing this it is working properly but same modification&amp;nbsp;is done in the main code there it is not working. the only difference is instead of Buffer array I am assigning Structure array to it.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Also the variables of different data types are there uint8_t, uint16_t, uint32_t son checking the same issue also I am using memcpy function for copying the data to it.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Just suggest if have pointers mean while I will check at my side.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;BR,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;Gaurav More&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 05:17:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1404305#M47737</guid>
      <dc:creator>gauravmore</dc:creator>
      <dc:date>2022-01-25T05:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: SDRAM interface issue with LPC4367 Controller using __Data attribute and __BSS Attribute</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1404420#M47740</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;&amp;gt; Refer the attached code in the thread and revert. after doing this it is working properly but same modification&amp;nbsp;is done in the main code there it is not working. the only difference is instead of Buffer array I am assigning Structure array to it.&amp;nbsp;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;&amp;gt; Also the variables of different data types are there uint8_t, uint16_t, uint32_t son checking the same issue also I am using memcpy function for copying the data to it.&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;I am not sure either.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;I would first check the addresses of said variables/structs in the map file, if they are correctly located. And then check in the debugger how actual access works out.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif" size="2"&gt;I did not need any pre-main initialisation, so initialisation of the EMC interface and the RAM itself is done in main.&amp;nbsp;For my project I used the pointer method as well. Writing is done in an interrupt handler, and I kept it as short as possible.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 08:17:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SDRAM-interface-issue-with-LPC4367-Controller-using-Data/m-p/1404420#M47740</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2022-01-25T08:17:32Z</dc:date>
    </item>
  </channel>
</rss>

