<?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 Using dynamic RAM with uClinux on LPC1788 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-dynamic-RAM-with-uClinux-on-LPC1788/m-p/523234#M5870</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Vladimir Khusainov on Wed Feb 08 09:14:00 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;To run on the LPC1788 devices, Linux (uClinux) requires external RAM. The on-chip Flash and SRAM are just not large enough to host the bulky Linux kernel, let alone various user-space tools and applications a practical Linux configuration may require.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Being able to execute code from external RAM is, thus, a pre-requisite for running uClinux on the LPC1788. This however is not an issue that is specific to uClinux only. Up to 512 KBytes of the on-chip Flash may be sufficient for some embedded configurations however for an application that requires "features", fitting all code that is needed into the integrated Flash may be a challenge. An obvious solution here would be to run some code from external RAM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The LPC1788 memory map allocates the address region of 0xA0000000-0xDFFFFFFF to dynamic memory devices. Using an SDRAM device may indeed be a practical implementation option for those LPC1788 designs that require external RAM to run code from - SDRAM provides a reasonable compromize for configurations where high density, low cost and performance are all requirements.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here comes the issue however. The Cortex-M3 memory map, to which LPC1788 of course adheres, defines 0xA0000000-0xDFFFFFFF as a "nonexecutable external device" region. In other words, an attempt to execute code from an SDRAM device results in an exception, as long as the default memory map is in action.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The solution is to use the Cortex-M3 Memory Protection Unit (MPU). The MPU sets up the protection and memory attributes by defining the default memory map as a number of regions. Up to eight regions of varying size can be defined, each with its own protection and memory attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To return to the specific uClinux implementation, before passing control to the Linux kernel loaded into external RAM, the U-Boot firmware enables the MPU and defines a single region allowing read/write/execute accesses to the entire 4G of the memory space. This allows running code from everywhere in the memory space, including "external devices" that reside in the 0xA0000000-0xDFFFFFFF region.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The described approach has been successfully validated in Emcraft Systems' port of uClinux for LPC1788. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:00:28 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:00:28Z</dc:date>
    <item>
      <title>Using dynamic RAM with uClinux on LPC1788</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-dynamic-RAM-with-uClinux-on-LPC1788/m-p/523234#M5870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Vladimir Khusainov on Wed Feb 08 09:14:00 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;To run on the LPC1788 devices, Linux (uClinux) requires external RAM. The on-chip Flash and SRAM are just not large enough to host the bulky Linux kernel, let alone various user-space tools and applications a practical Linux configuration may require.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Being able to execute code from external RAM is, thus, a pre-requisite for running uClinux on the LPC1788. This however is not an issue that is specific to uClinux only. Up to 512 KBytes of the on-chip Flash may be sufficient for some embedded configurations however for an application that requires "features", fitting all code that is needed into the integrated Flash may be a challenge. An obvious solution here would be to run some code from external RAM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The LPC1788 memory map allocates the address region of 0xA0000000-0xDFFFFFFF to dynamic memory devices. Using an SDRAM device may indeed be a practical implementation option for those LPC1788 designs that require external RAM to run code from - SDRAM provides a reasonable compromize for configurations where high density, low cost and performance are all requirements.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here comes the issue however. The Cortex-M3 memory map, to which LPC1788 of course adheres, defines 0xA0000000-0xDFFFFFFF as a "nonexecutable external device" region. In other words, an attempt to execute code from an SDRAM device results in an exception, as long as the default memory map is in action.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The solution is to use the Cortex-M3 Memory Protection Unit (MPU). The MPU sets up the protection and memory attributes by defining the default memory map as a number of regions. Up to eight regions of varying size can be defined, each with its own protection and memory attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To return to the specific uClinux implementation, before passing control to the Linux kernel loaded into external RAM, the U-Boot firmware enables the MPU and defines a single region allowing read/write/execute accesses to the entire 4G of the memory space. This allows running code from everywhere in the memory space, including "external devices" that reside in the 0xA0000000-0xDFFFFFFF region.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The described approach has been successfully validated in Emcraft Systems' port of uClinux for LPC1788. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:00:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-dynamic-RAM-with-uClinux-on-LPC1788/m-p/523234#M5870</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using dynamic RAM with uClinux on LPC1788</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-dynamic-RAM-with-uClinux-on-LPC1788/m-p/523235#M5871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by EReyes on Wed Feb 08 19:31:05 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Cortex-M3 devices with external memory interfaces typically experience a performance loss when executing code out of external memory. Is there any reference about this for the LPC1788?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:00:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-dynamic-RAM-with-uClinux-on-LPC1788/m-p/523235#M5871</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using dynamic RAM with uClinux on LPC1788</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-dynamic-RAM-with-uClinux-on-LPC1788/m-p/523236#M5872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Vladimir Khusainov on Fri Feb 10 04:30:33 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Running code from external RAM is of course slower than running code from the integrated Flash of Cortex-M3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is possible to build the uClinux kernel in such a way that kernel components of user's choice would be linked into an address region corresponding to the built-in Flash (and hence run from embedded Flash), while the rest of the kernel code would run from external RAM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another possibility is to put a romfs filesystem into embedded Flash and run critical user-space applications from there in XIP (eXecute-In-Place) mode. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Even without those optimizations though, uClinux appears to be sufficiently performant on LPC1788. I invite you to watch the "Linux LPC17xx: Shell, Networking and Journalled Flash Filesystem" at &lt;A href="https://community.nxp.com/www.emcraft.com" target="test_blank"&gt;www.emcraft.com&lt;/A&gt;. It shows uClinux running on Embedded Artists' LPC1788 board from a 32 MBytes SDRAM device ... At the user shell level, when running various Unix commands, there is no sluggishness or delays one may fear when running software on a slow microprocessor. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course performance needs to be measured against requirements of a specific application however I would think that uClinux on an 120MHz LPC1788 running from external RAM device should be performant enough for kind of things that are expected from a Cortex-M3 based device. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As they say, "whatever works". &lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:00:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-dynamic-RAM-with-uClinux-on-LPC1788/m-p/523236#M5872</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:00:30Z</dc:date>
    </item>
  </channel>
</rss>

