• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » Stellaris® ARM® Microcontrollers » Stellaris® ARM® LM3S Microcontrollers Forum » LM3S9B96 Create binaries code in internal and external memory.
Share
Stellaris® ARM® Microcontrollers
  • Forum
Options
  • Subscribe via RSS

LM3S9B96 Create binaries code in internal and external memory.

LM3S9B96 Create binaries code in internal and external memory.

This question is answered
Tekkon Hayden
Posted by Tekkon Hayden
on Feb 17 2012 09:51 AM
Intellectual610 points

Hi 

I am using LM3S9B96 evaluation board and FLASH/SRAM/LCD IF external board.     IDE: CrossStudio for ARM 2.0

How to generate the binary files which are located partly in the internal memory (flash&sram) and partly in the external memory(external flash & sram)?  And is there any examples on the LM3S9xxx processors to do that? 

I was able to get the modified blinky example running from external flash, but can not figure out how to generate code for both internal and external and running the main application in internal memory.  

Thanks!

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Bobby Bradford
    Posted by Bobby Bradford
    on Feb 17 2012 10:41 AM
    Verified Answer
    Verified by Tekkon Hayden
    Genius9120 points

    We do not have any examples for setting up applications to run from both internal memory and external memory on the EPI interface.  The difficulty would be getting the toolchain to generate two separate binary images, one to be loaded into internal memory, using standard tools, and the other to be loaded into the external memory, using a loader app running on the device.  Each toolchain supported (e.g. Keil, IAR, etc.) would need to be configured differently.

    If you need to run code from external memory, I would recommend writing the code for the external memory as a library, with a function table located at the beginning of the memory.  You would then simply need to write a header file that maps "function names" to the appropriate lookup table in the external memory.  This would be similar to what has been done with DriverLib API's that have been placed into ROM.  You could refer to the "rom.h" header file for more details about how this was implemented.

    This would remove the direct link between the main application in internal memory and the functions residing in external memory and simplify the build process.

    --Bobby

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Tekkon Hayden
    Posted by Tekkon Hayden
    on Feb 17 2012 12:35 PM
    Intellectual610 points

    Thank you for your help Bobby!

    Sounds like building the external code as library is much easier than struggling with the toolchain.

    In my understanding, the procedure should be :

    1:Write the code for external memory as a library and generate the binary image.

    2.Modify the "boot_eth_ext" demo to load the binary image which is generated in step1 to external flash/sarm, and NOT running from external flash.

    3.Write the main application code with the mapping files to lookup table in the external memory.

    4.Erase the internal memory (where the bootloader reside in) before loading the main application binary image.

    5.Load the internal binary image.

    Is the above procedure sounds correct and practical?  Thank you!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Bobby Bradford
    Posted by Bobby Bradford
    on Feb 17 2012 12:44 PM
    Genius9120 points

    That process sounds correct.  As always, the details will probably be more involved, but it should get you going in the right direction.

    --Bobby

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Tekkon Hayden
    Posted by Tekkon Hayden
    on Feb 21 2012 13:45 PM
    Intellectual610 points

    Bobby, you are right, there are always more details involved. 

    I tried to build a application for the external flash which just toggle the LED.  And my main application in the internal flash will call the EXT_ToggleLED( ) function just like calling a ROM_  function. But it keeps falling into Fault_ISR( ).

    #define EXT_LEDTESTTABLE  ((unsigned long *) 0x60000320)        // 0x60000320 is where the linker placed the EXT_ToggleLED( ) function into external flash           

    #define EXT_ToggleLED            ( (void (*) ( ) ) EXT_LEDTESTTABLE)

    I am not sure the above way that linking the external function is correct and I guess I must missed something when building the external "library" binary image.  Do you have any documents or suggestion on building the ROM_ like binary image for the external memory and relate it to the internal caller function? Thank you!  Appreciated!

    -Tekkon

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Tekkon Hayden
    Posted by Tekkon Hayden
    on Feb 27 2012 11:07 AM
    Intellectual610 points

    Bobby,

    I finally succeed in toggling a led in the external flash just like calling a ROM_ function. 

    From the generated memory map file of external application, the actual address of the EXT_ToggleLED( ) function in external memory is 0x600002D4. But  I have to define EXT_ToggleLED  ((void(*)( )) 0x600002D5) in my internal main application, otherwise, it will keep falling into ISR if I use 0x600002D4. Still do not understand why the address branch to is always the true address plus one ?  I checked the ROM_ like function, they are doing the same thing. 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • slandrum
    Posted by slandrum
    on Feb 27 2012 16:53 PM
    Verified Answer
    Verified by Tekkon Hayden
    Mastermind9640 points

    The least significant bit of the instruction address is the processor mode to execute the instruction in.  The Cortex-M3/M4 only operate in the extended Thumb instruction mode, and do not support 32 bit ARM instructions (except for those included in the extended Thumb instruction set).

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Tekkon Hayden
    Posted by Tekkon Hayden
    on Feb 27 2012 17:07 PM
    Intellectual610 points

    slandrum,

    Thank you for your help. By following what you posted, I did a little research. The blx instruction can change the processor state, either from ARM to Thumb, or from Thumb to ARM.  The bit[0] of the instruction address is 1, just means the processor changes to, or remains in Thumb mode.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use