• 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 » Embedded Software » StarterWare » StarterWare forum » StarterWare code documentation
Share
StarterWare
  • Forum
Options
  • Subscribe via RSS

Forums

StarterWare code documentation

  • Jay Larson
    Posted by Jay Larson
    on May 02 2012 03:38 AM
    Prodigy220 points

    Hi,

    Background: I have been using starterware on the AM335x as both a bare metal platform starting point for a project prototype and as a way of learning about the processor and its peripherals.  StarterWare seemed a good place to start.

    In my learing process I have been delving into the implementation.  I'm trying to understand why some things are done in Starterware they way they are.  It seems to me that much of the code that I have run across is difficult to follow, and poorly commented, which doesn't help the learning process.  Here is an example (I could provide many):

    In startup.c, we have the declaration for the exception vector table:

    static unsigned int const vecTbl[14]=
    {
        0xE59FF018,
        0xE59FF018,
        0xE59FF018,
        0xE59FF018,
        0xE59FF014,
        0xE24FF008,
        0xE59FF010,
        0xE59FF010,
        (unsigned int)Entry,
        (unsigned int)UndefInstHandler,
        (unsigned int)SVCHandler,
        (unsigned int)AbortHandler,
        (unsigned int)IRQHandler,
        (unsigned int)FIQHandler
    };

    In the start_boot function (also in startup.c) we copy this vector table to 0x4030FC00 and set the cpu to use this address.  So, the questions are:

    1. Why relocate the vector table to this address?  Absolutely no clue in the code as to where this address comes from.  Its just a seemingly arbetrary address in the onchip ram?
    2. Why relocated it at all?  When I leave it in DRAM, it seems to works fine.
    3. Why were machine language instructions used?  Yes, I can dissassemble the E59FF018 to a LDR PC instruction.  But comment in the code would really help the understanding of what is going on.  Should this have been done using the inline assembler or a .asm module?

    I guess 1 and 2 are real questions.  3 is really a bit of a rant, sorry.  But it seems that the quality of the code documentation could be improved to help with what I think the purpose of starterware is:  Get new users started!

    Cheers,

    -Jay

    am3359 AM335x StarterWare
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Valentin Ivanov
    Posted by Valentin Ivanov
    on May 02 2012 17:27 PM
    Intellectual380 points

    Hi Jay,

    Check this thread it was answered there:

    http://e2e.ti.com/support/embedded/starterware/f/790/p/179868/647892.aspx#647892

    Regards,

    Valentin

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Sujith KV
    Posted by Sujith KV
    on May 02 2012 23:40 PM
    Intellectual2505 points

    Hi Jay/Valentin,

    Many thanks for your interest in StarterWare and for the valuable review comments !

    As Jay pointed out, it will make a difference if we give proper comments, as at some places its not clear why the code is written that way.

    Regarding the vector table relocation; Yes, we can have the vector table in DDR as well, defining them in a .asm file as well. But current StarterWare code places in OCMC RAM because by default, the vector table will be in OCMC RAM, and in StarterWare, we preferred the default place, but moved to the end of OCMC RAM.

    Secondly, in some other platforms, say ARM9 based, the vector table cannot be placed anywhere other than 0xFFFF0000 and 0x00000000. In such case, we will have to relocate the vector table since we are supporting bootloader which will .bin file. To make it consistent, we kept it similar for AM335x also. (May be it can now be made depending on the platform).

    Cheers,

    Sujith.

    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