<?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: ResetISR copy .data section  to RAM2</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/ResetISR-copy-data-section-to-RAM2/m-p/517298#M2129</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Wed Feb 11 00:36:24 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;If you read the code carefully, you will see it is initialising all of the data sections listed in a table (the data_section_table). This works in conjunction with the (Managed) Linker script, which creates an entry for each data section.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, this code initialises all data sections.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:26:49 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:26:49Z</dc:date>
    <item>
      <title>ResetISR copy .data section  to RAM2</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ResetISR-copy-data-section-to-RAM2/m-p/517297#M2128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jeshwanth on Tue Feb 10 23:16:24 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello List,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was analysing the ResetISR function in cr_startup_lpc175x_6x.c file. But I can see the copying of .data section is happening for First RAM i.e. RAM1. What if I have .data section in RAM2 ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am little confused with below code with respect to RAM2, please comment &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
ResetISR(void) {

&amp;nbsp;&amp;nbsp;&amp;nbsp; //
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Copy the data sections from flash to SRAM.
&amp;nbsp;&amp;nbsp;&amp;nbsp; //
&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned int LoadAddr, ExeAddr, SectionLen;
&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned int *SectionTableAddr;

&amp;nbsp;&amp;nbsp;&amp;nbsp; // Load base address of Global Section Table
&amp;nbsp;&amp;nbsp;&amp;nbsp; SectionTableAddr = &amp;amp;__data_section_table;

&amp;nbsp;&amp;nbsp;&amp;nbsp; // Copy the data sections from flash to SRAM.
&amp;nbsp;&amp;nbsp;&amp;nbsp; while (SectionTableAddr &amp;lt; &amp;amp;__data_section_table_end) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoadAddr = *SectionTableAddr++;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExeAddr = *SectionTableAddr++;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SectionLen = *SectionTableAddr++;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data_init(LoadAddr, ExeAddr, SectionLen);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; // At this point, SectionTableAddr = &amp;amp;__bss_section_table;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Zero fill the bss segment
&amp;nbsp;&amp;nbsp;&amp;nbsp; while (SectionTableAddr &amp;lt; &amp;amp;__bss_section_table_end) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExeAddr = *SectionTableAddr++;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SectionLen = *SectionTableAddr++;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bss_init(ExeAddr, SectionLen);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

#if defined (__USE_CMSIS) || defined (__USE_LPCOPEN)
&amp;nbsp;&amp;nbsp;&amp;nbsp; SystemInit();
#endif

#if defined (__cplusplus)
&amp;nbsp;&amp;nbsp;&amp;nbsp; //
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Call C++ library initialisation
&amp;nbsp;&amp;nbsp;&amp;nbsp; //
&amp;nbsp;&amp;nbsp;&amp;nbsp; __libc_init_array();
#endif

#if defined (__REDLIB__)
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Call the Redlib library, which in turn calls main()
&amp;nbsp;&amp;nbsp;&amp;nbsp; __main() ;
#else
&amp;nbsp;&amp;nbsp;&amp;nbsp; main();
#endif

&amp;nbsp;&amp;nbsp;&amp;nbsp; //
&amp;nbsp;&amp;nbsp;&amp;nbsp; // main() shouldn't return, but if it does, we'll just enter an infinite loop
&amp;nbsp;&amp;nbsp;&amp;nbsp; //
&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in Advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:26:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ResetISR-copy-data-section-to-RAM2/m-p/517297#M2128</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: ResetISR copy .data section  to RAM2</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ResetISR-copy-data-section-to-RAM2/m-p/517298#M2129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Wed Feb 11 00:36:24 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;If you read the code carefully, you will see it is initialising all of the data sections listed in a table (the data_section_table). This works in conjunction with the (Managed) Linker script, which creates an entry for each data section.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, this code initialises all data sections.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:26:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ResetISR-copy-data-section-to-RAM2/m-p/517298#M2129</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: ResetISR copy .data section  to RAM2</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ResetISR-copy-data-section-to-RAM2/m-p/517299#M2130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jeshwanth on Wed Feb 11 01:45:42 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just referred the Linker file, now understood about the data and bss section table :). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
__data_section_table = .;
LONG(LOADADDR(.data));
LONG( ADDR(.data)) ;
LONG( SIZEOF(.data));
LONG(LOADADDR(.data_RAM2));
LONG( ADDR(.data_RAM2)) ;
LONG( SIZEOF(.data_RAM2));
__data_section_table_end = .;
__bss_section_table = .;
LONG( ADDR(.bss));
LONG( SIZEOF(.bss));
LONG( ADDR(.bss_RAM2));
LONG( SIZEOF(.bss_RAM2));
__bss_section_table_end = .
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:26:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ResetISR-copy-data-section-to-RAM2/m-p/517299#M2130</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:26:50Z</dc:date>
    </item>
  </channel>
</rss>

