• 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 2.00.00.05 Initialization and c++
Share
StarterWare
  • Forum
Options
  • Subscribe via RSS

StarterWare 2.00.00.05 Initialization and c++

StarterWare 2.00.00.05 Initialization and c++

This question is answered
Jay Larson
Posted by Jay Larson
on Mar 14 2012 05:04 AM
Prodigy220 points

Hi,

I am now having some limited sucess in using StarterWare on the BeagleBone using c++.  Compiling, debugging and running the examples was more or less straightforward.  Creating my own project based on Starterware, was less so, but achievable. 

I now have a question about the Startup code.  The code I found in init.asm and startup.c does not seem to call any of my constructors of global/static c++ objects.  It seems that starterware redirects the entry point from the default c_int00() to Entry().  Does this bypass 'normal' c++ initialization?  Can c++ be supported in StarterWare?

What is the best way to make sure that my c++ globals are initialized at startup? 

Cheers,

-Jay

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Baskaran Chidambaram
    Posted by Baskaran Chidambaram
    on Mar 14 2012 13:01 PM
    Expert4385 points

    Hi Jay,

              StarterWare is aimed at providing no-os low level peripheral programming. So we couldnt envision using C++ for this, as there no OO programming or high level design involved.

               Considering that customers can come with different background, we will look at changes needed to support C++ and probably come up with the steps required to enable C++. But i couldnt see the need for supporting C++ in StarterWare deliverable.

    Regards

    Baskaran

    StarterWare
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jay Larson
    Posted by Jay Larson
    on Mar 15 2012 02:47 AM
    Prodigy220 points

    Thank you Baskaran for the quick reply.

    Looking further into it, it seems that the standard library call into the runtime library's perform_cinit() (in auto_init.asm) has been bypassed.  It looks like this was done by avoiding the default entry point of c_init00 to Entry in the linker file. 

    Anyway, I look forward to using c++ fully under starterWare.  I find that c++ in an embedded envronment is effecient and more re-usable than the equivilent C. 

     

    Cheers,

    -Jay

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jay Larson
    Posted by Jay Larson
    on Apr 18 2012 02:35 AM
    Prodigy220 points

    Looks like version 2.00.00.06 silently fixed this issue.  There was no notification in the release notes, but I can confirm now that init.asm now calls __TI_auto_init where it had not in 2.00.00.05.  This will properly cause all c++ objects declared in the global scope to have their constructors called. 

    Thank you for the change.  It really would be best if you documented these kind of changes in the future. 

    Cheers,

    -Jay

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Baskaran Chidambaram
    Posted by Baskaran Chidambaram
    on Apr 18 2012 04:13 AM
    Verified Answer
    Verified by Jay Larson
    Expert4385 points

    Jay,

          In 05 release we only had load time init of global variables. We have indeed added __TI_auto_init to support runtime initialization of global variables (in C), so that it will work for both the models. The intention here was not to add C++ support and we have not tested for C++ environment.

    Anyway good that it works for C++ too..:)

    Regards

    Baskaran

    StarterWare
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Yaoming Qin
    Posted by Yaoming Qin
    on Nov 07 2012 04:03 AM
    Intellectual1015 points

    Hi Baskaran,

      When I trace the starterware code, occasionally, I found your post here. According to your description as above,  the __TI_auto_init will do the initialization for the .bss section, which is not done in GCC.  Is my understanding right? please confirm it.

    Thanks!

    Yaoming                        

      

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Baskaran Chidambaram
    Posted by Baskaran Chidambaram
    on Nov 07 2012 08:34 AM
    Expert4385 points

    Yaoming,

                  You are correct.

    Regards

    Baskaran

    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