element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum LPC4357 EVB: setup for external RAM using Keil-tools
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 2 replies
  • Subscribers 472 subscribers
  • Views 417 views
  • Users 0 members are here
Related

LPC4357 EVB: setup for external RAM using Keil-tools

Former Member
Former Member over 9 years ago

I am using the LPC4357 EVB using the Keil-IDE.

There is an external 32 MBits-DRAM onboard ( MT48LC16M16A2 ),

but the demo-examples available are configured for the 64 MBits-RAM IS42S16400D and therefore not working straight-forward for the board in use,in case of using the external RAM.

Has anyone available an example-driver-file working with the MT48LC16M16A2 instead of the IS42S16400D ?

Thanks in advance...

  • Sign in to reply
  • Cancel
Parents
  • clem57
    clem57 over 9 years ago

    I have no example, but I would look at the datasheets and compare for differences.

    http://www.issi.com/WW/pdf/42S16400D.pdf

    https://www.micron.com/parts/dram/sdram/mt48lc16m16a2p-6a

    They will give you clues to what to change in the examples.

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 9 years ago in reply to clem57

    I have found now a working configuration for my application using the LPC4357 with the mentioned external 32 MB-SDRAM ( 256 Mbits ).

     

    I am using a scatter-loading description-file, this is recommended in case the application is more complex.

    ( The scatter-file will be found under "Options for Target -> Linker" in uVision, using this feature requires a full-version ).

     

    For my application this file actualy looks like this:

    ( The decimal-point is only for better readability )

     

     

    LR_IROM1  0x1A00.0000  0x0008.0000  {

      ER_IROM1  0x1A00.0000  0x0008.0000   {

         *.o (RESET, +FIRST)

         *(InRoot$$Sections)

         .ANY (+RO)

    }

    RW_IRAM1  0x1000.0000  0x0000.8000 {

       system_lpc43xx.o  (+RW )

    }

    RW_IRAM2  0x2000.0000  0x0001.0000 {

       startup_lpc43xx.o  (+RW +ZI)

    }

    RW_RAM1  0x2800.0000  0x01F0.0000 {

       .ANY  (+RW +ZI)

    }

    }

     

    The Framepointer required for LCD-output ( if used ) is located at 0x29F0.0000 using the last 1 MB of the available SDRAM.

    ( working well for my aplication, however the demand on RAM is not clarified ).

     

    In general, the problem using the LPC4357 is that the SDRAM needs to be initialized before it can be used for the application.

    The initialisation is done in startup_lpc43xx.s together with system_lpc43xx.c and execution must be done in internal RAM.

    For applications with large demands on heap-space the internal RAM is usualy not big enough, external RAM must be used.

    It is possible to assign system_lpc43xx.o and startup_lpc43xx.o to 2 different internal RAM-regions like shown in the example.

    This has the advantage of having nearly 64 K of stack-space available within IRAM2 in case this is required ( like in my application ).

    In most cases it should be sufficient to place both files only in 1 IRAM-region and leave the other empty.

     

    Inside startup_lpc43xx.s I have assigned now for heap and stack:

     

    Stack_Size    EQU   0x0000.F000

    Heap_Size    EQU   0x0000.0400

     

    The stack is defined here with 60 K, nearly the limit of what is possible.

     

    The critical point now is, that all this is still not working until there will be placed a command for initialising the heap.

    This command I have added to the end of system_LPC43xx.c, after the external memory-Controller will be configured:

     

    ...

    /*  Configure External memory Controller */

        SystemInit_ExtMemCtl ();

     

    /* Configure external heap */

       _init_alloc(0x2880.1000, 0x29F0.0000);        // allocation of heap inside region RW_RAM1 ( base, top ).   

     

     

    This range spans nearly 24 MB heap in my application but all may need to be adjusted according to the requirements.

    The first 8 MB inside RW_RAM1 is reserved for program-data ( this is the range from 0x2800.0000 to 0x2880.0000 ).

    It is important not to start with heap-allocation directly at the boundary ( 0x2880.0000 ), this fails for my application.

    Therefore the heap starts at 0x2880.1000 ( as an example ).

     

    Of course to make all this working it is required to have working files for system_lpc43xx.c and startup_lpc43xx.s available,

    Esspecialy the timing-setup for the SDRAM in use must be in order of course.

    For the 32 MB-SDRAM in use I made 1 additional change inside the configuration:

     

    LPC_EMC->DYNAMICCONFIG0  =  (0x05)<<7;

     

    My application ( a modern chess-engine ) using nearly the 32 MB RAM available ( mainly for hash-tables ) has proved to be working very well now.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 9 years ago in reply to clem57

    I have found now a working configuration for my application using the LPC4357 with the mentioned external 32 MB-SDRAM ( 256 Mbits ).

     

    I am using a scatter-loading description-file, this is recommended in case the application is more complex.

    ( The scatter-file will be found under "Options for Target -> Linker" in uVision, using this feature requires a full-version ).

     

    For my application this file actualy looks like this:

    ( The decimal-point is only for better readability )

     

     

    LR_IROM1  0x1A00.0000  0x0008.0000  {

      ER_IROM1  0x1A00.0000  0x0008.0000   {

         *.o (RESET, +FIRST)

         *(InRoot$$Sections)

         .ANY (+RO)

    }

    RW_IRAM1  0x1000.0000  0x0000.8000 {

       system_lpc43xx.o  (+RW )

    }

    RW_IRAM2  0x2000.0000  0x0001.0000 {

       startup_lpc43xx.o  (+RW +ZI)

    }

    RW_RAM1  0x2800.0000  0x01F0.0000 {

       .ANY  (+RW +ZI)

    }

    }

     

    The Framepointer required for LCD-output ( if used ) is located at 0x29F0.0000 using the last 1 MB of the available SDRAM.

    ( working well for my aplication, however the demand on RAM is not clarified ).

     

    In general, the problem using the LPC4357 is that the SDRAM needs to be initialized before it can be used for the application.

    The initialisation is done in startup_lpc43xx.s together with system_lpc43xx.c and execution must be done in internal RAM.

    For applications with large demands on heap-space the internal RAM is usualy not big enough, external RAM must be used.

    It is possible to assign system_lpc43xx.o and startup_lpc43xx.o to 2 different internal RAM-regions like shown in the example.

    This has the advantage of having nearly 64 K of stack-space available within IRAM2 in case this is required ( like in my application ).

    In most cases it should be sufficient to place both files only in 1 IRAM-region and leave the other empty.

     

    Inside startup_lpc43xx.s I have assigned now for heap and stack:

     

    Stack_Size    EQU   0x0000.F000

    Heap_Size    EQU   0x0000.0400

     

    The stack is defined here with 60 K, nearly the limit of what is possible.

     

    The critical point now is, that all this is still not working until there will be placed a command for initialising the heap.

    This command I have added to the end of system_LPC43xx.c, after the external memory-Controller will be configured:

     

    ...

    /*  Configure External memory Controller */

        SystemInit_ExtMemCtl ();

     

    /* Configure external heap */

       _init_alloc(0x2880.1000, 0x29F0.0000);        // allocation of heap inside region RW_RAM1 ( base, top ).   

     

     

    This range spans nearly 24 MB heap in my application but all may need to be adjusted according to the requirements.

    The first 8 MB inside RW_RAM1 is reserved for program-data ( this is the range from 0x2800.0000 to 0x2880.0000 ).

    It is important not to start with heap-allocation directly at the boundary ( 0x2880.0000 ), this fails for my application.

    Therefore the heap starts at 0x2880.1000 ( as an example ).

     

    Of course to make all this working it is required to have working files for system_lpc43xx.c and startup_lpc43xx.s available,

    Esspecialy the timing-setup for the SDRAM in use must be in order of course.

    For the 32 MB-SDRAM in use I made 1 additional change inside the configuration:

     

    LPC_EMC->DYNAMICCONFIG0  =  (0x05)<<7;

     

    My application ( a modern chess-engine ) using nearly the 32 MB RAM available ( mainly for hash-tables ) has proved to be working very well now.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube