<div dir="ltr"><div>my linkscmd is <a href="https://gist.github.com/goog/aad6dae4c418255dd6fb2b23bf2e6f08">https://gist.github.com/goog/aad6dae4c418255dd6fb2b23bf2e6f08</a></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>void BSP_START_TEXT_SECTION bsp_start_hook_1(void)<br>{<br> SRAM_fsmc_setup();<br> bsp_start_copy_sections();<br> bsp_start_clear_bss();<br><br> /* At this point we can use objects outside the .start section */<br>}<br></div></blockquote><div><br></div><div>but now my code run disordered</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 17, 2019 at 2:45 PM Christian Mauderer <<a href="mailto:christian.mauderer@embedded-brains.de">christian.mauderer@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If you put any sections into the external RAM that need initialization,<br>
you have to init the RAM before the BSP copies it's sections. The STM32<br>
BSP copies it's sections in bsp_start_hook_1(). So either put it in<br>
bsp_start_hook_0 or in bsp_start_hook_1 before the copy_section calls.<br>
Attention: You can't use much in these functions. They are in a very<br>
early initialization stage. So be careful what you put there.<br>
<br>
If you only want malloc to allocate memory from there, there might is a<br>
later point where you can do that.<br>
<br>
On 17/06/2019 08:32, Jython wrote:<br>
> Thank you and the example! that is to say put extern sram init in<br>
> bsp_start( void ) function?<br>
> <br>
> On Mon, Jun 17, 2019 at 1:04 PM Christian Mauderer<br>
> <<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>>> wrote:<br>
> <br>
> On 17/06/2019 03:05, Jython wrote:<br>
> > STM32:<br>
> > 112KB at 2000 0000<br>
> > 16KB at 2001 C000<br>
> ><br>
> > external sram : 1MB at 0x68000000<br>
> ><br>
> > does MEMORY layout support RAM2?<br>
> <br>
> Hello Jython,<br>
> <br>
> you can distribute the regions to the two RAMs. For example this BSP<br>
> does that:<br>
> <br>
> <a href="https://git.rtems.org/rtems/tree/bsps/arm/lpc32xx/start/linkcmds.lpc32xx_phycore" rel="noreferrer" target="_blank">https://git.rtems.org/rtems/tree/bsps/arm/lpc32xx/start/linkcmds.lpc32xx_phycore</a><br>
> <br>
> Please note that you have to take a detailed look at what is used till<br>
> your external RAM initialization run and what not. But if you put your<br>
> external RAM initialization in an early enough step, you shouldn't get<br>
> problems with that.<br>
> <br>
> Best regards<br>
> <br>
> Christian<br>
> <br>
> ><br>
> > On Fri, Jun 14, 2019 at 10:13 PM Christian Mauderer<br>
> > <<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>><br>
> > <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>>>> wrote:<br>
> ><br>
> > If you have already added the chip and it is initialized<br>
> during startup,<br>
> > you most likely have to add a section for it in your linker<br>
> command<br>
> > file. Depending on where your internal RAM is located and<br>
> where the<br>
> > external one is: If they are continuous that can be enough.<br>
> ><br>
> > Best regards<br>
> ><br>
> > Christian<br>
> ><br>
> > On 14/06/2019 04:42, Jython wrote:<br>
> > > we have added 1M ram by FSMC, and want to manage it by<br>
> system malloc<br>
> > > controler<br>
> > ><br>
> > > On Fri, Jun 14, 2019 at 10:26 AM Mr. Andrei Chichak<br>
> > <<a href="mailto:groups@chichak.ca" target="_blank">groups@chichak.ca</a> <mailto:<a href="mailto:groups@chichak.ca" target="_blank">groups@chichak.ca</a>><br>
> <mailto:<a href="mailto:groups@chichak.ca" target="_blank">groups@chichak.ca</a> <mailto:<a href="mailto:groups@chichak.ca" target="_blank">groups@chichak.ca</a>>><br>
> > > <mailto:<a href="mailto:groups@chichak.ca" target="_blank">groups@chichak.ca</a> <mailto:<a href="mailto:groups@chichak.ca" target="_blank">groups@chichak.ca</a>><br>
> <mailto:<a href="mailto:groups@chichak.ca" target="_blank">groups@chichak.ca</a> <mailto:<a href="mailto:groups@chichak.ca" target="_blank">groups@chichak.ca</a>>>>> wrote:<br>
> > ><br>
> > > A 407 doesn’t normally have external RAM.<br>
> > ><br>
> > > ARMs have flash at 0 and the 407 has RAM at 0x2000 0000<br>
> as you<br>
> > > discussed earlier.<br>
> > ><br>
> > > If you want to work with external flash or RAM, you have<br>
> to set up<br>
> > > the FSMC or FMC to support it, but that isn’t a part of<br>
> the dev<br>
> > > board that Sebastian used for the BSP port.<br>
> > ><br>
> > > The external memory is going to be very specific to your<br>
> board.<br>
> > > Which board are you working with?<br>
> > ><br>
> > > A<br>
> > ><br>
> > > > On 2019-June-13, at 06:23, Christian Mauderer<br>
> > > <<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>><br>
> > <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>>><br>
> > > <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>><br>
> > <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>>>>> wrote:<br>
> > > ><br>
> > > > On 05/06/2019 02:55, Jython wrote:<br>
> > > >> Hello!<br>
> > > >><br>
> > > >> 2. In the normal (non-debugging) case, the linker<br>
> > script still<br>
> > > >> places the<br>
> > > >><br>
> > > >> .text section near zero, but places the start of the<br>
> > .data and<br>
> > > .bss<br>
> > > >> sections at the start location of the MPC555's<br>
> internal<br>
> > RAM. The<br>
> > > >> system startup code then configures the external<br>
> RAM just<br>
> > > after the<br>
> > > >> internal RAM in memory, forming one large block<br>
> from the<br>
> > two RAM<br>
> > > >> devices.<br>
> > > >><br>
> > > >> from <a href="https://devel.rtems.org/wiki/TBR/BSP/Ss555" rel="noreferrer" target="_blank">https://devel.rtems.org/wiki/TBR/BSP/Ss555</a><br>
> > > >><br>
> > > >> but i dont know how to configure the external RAM just<br>
> > after the<br>
> > > >> internal RAM in memory?<br>
> > > >> hope you could give me some guide!<br>
> > > >> <br>
> > > >><br>
> > > ><br>
> > > > Hello Jython,<br>
> > > ><br>
> > > > the documentation you linked is for an MPC. But your<br>
> subject<br>
> > line<br>
> > > > mentions an STM32. What controller / BSP are you using?<br>
> > > ><br>
> > > > Best regards<br>
> > > ><br>
> > > > Christian Mauderer<br>
> > > > --<br>
> > > > --------------------------------------------<br>
> > > > embedded brains GmbH<br>
> > > > Herr Christian Mauderer<br>
> > > > Dornierstr. 4<br>
> > > > D-82178 Puchheim<br>
> > > > Germany<br>
> > > > email: <a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>><br>
> > <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>>><br>
> > > <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>><br>
> > <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>>>><br>
> > > > Phone: +49-89-18 94 741 - 18<br>
> > > > Fax: +49-89-18 94 741 - 08<br>
> > > > PGP: Public key available on request.<br>
> > > ><br>
> > > > Diese Nachricht ist keine geschäftliche Mitteilung im<br>
> Sinne<br>
> > des EHUG.<br>
> > > > _______________________________________________<br>
> > > > users mailing list<br>
> > > > <a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a> <mailto:<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a>><br>
> <mailto:<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a> <mailto:<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a>>><br>
> > <mailto:<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a> <mailto:<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a>><br>
> <mailto:<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a> <mailto:<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a>>>><br>
> > > > <a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><br>
> > ><br>
> > ><br>
> > > _______________________________________________<br>
> > > users mailing list<br>
> > > <a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a> <mailto:<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a>><br>
> <mailto:<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a> <mailto:<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a>>><br>
> > > <a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><br>
> > ><br>
> ><br>
> > --<br>
> > --------------------------------------------<br>
> > embedded brains GmbH<br>
> > Herr Christian Mauderer<br>
> > Dornierstr. 4<br>
> > D-82178 Puchheim<br>
> > Germany<br>
> > email: <a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>><br>
> > <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>>><br>
> > Phone: +49-89-18 94 741 - 18<br>
> > Fax: +49-89-18 94 741 - 08<br>
> > PGP: Public key available on request.<br>
> ><br>
> > Diese Nachricht ist keine geschäftliche Mitteilung im Sinne<br>
> des EHUG.<br>
> ><br>
> <br>
> -- <br>
> --------------------------------------------<br>
> embedded brains GmbH<br>
> Herr Christian Mauderer<br>
> Dornierstr. 4<br>
> D-82178 Puchheim<br>
> Germany<br>
> email: <a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
> <mailto:<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>><br>
> Phone: +49-89-18 94 741 - 18<br>
> Fax: +49-89-18 94 741 - 08<br>
> PGP: Public key available on request.<br>
> <br>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
> <br>
<br>
-- <br>
--------------------------------------------<br>
embedded brains GmbH<br>
Herr Christian Mauderer<br>
Dornierstr. 4<br>
D-82178 Puchheim<br>
Germany<br>
email: <a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a><br>
Phone: +49-89-18 94 741 - 18<br>
Fax: +49-89-18 94 741 - 08<br>
PGP: Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
</blockquote></div>