• 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 » Development Tools » Code Composer Studio » Code Composer Forum » LM3S8962 Basic Assembly Project
Share
Code Composer Studio
  • Forum
  • Announcements
Options
  • Subscribe via RSS
Common Questions
  • Code Composer Studio Forum Usage Guidelines

  • Resources
  • Code Composer Studio (CCStudio) Product Folder
  • Troubleshooting CCS
  • CCS Wiki
  • Download CCS
  • Order CCS
  • Tools Insider Blog
  • Bug Tracking
  • LM3S8962 Basic Assembly Project

    LM3S8962 Basic Assembly Project

    This question is answered
    mouka zwina
    Posted by mouka zwina
    on Dec 21 2012 22:04 PM
    Prodigy70 points

    Hi All,

    I am trying to get a simple assembly language program setup in Code Composer 5. I have the option to start an empty assembly language project. And I am trying something very simple:

                      .text

    start:         ld   r0,#2

                      ld    r1,#3

                      add r2,r1,r0

    stop:          b stop

    It's as simple as it gets. But I can't get it to compile properly. It keeps complaining about stack and other stuff as well.

    I know that I am missing something very simple. The stack for once that needs to be initialized. And maybe some other stuff too.

    All I am trying to do is get some very simple assembly code up and running and debug it on my LM3S8962 board.

    Any help is greatly appreciated.

    Thanks! 

    Code Composer Assembly LM3Sxxxx
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • AartiG
      Posted by AartiG
      on Dec 25 2012 20:56 PM
      Guru68895 points

      mouka zwina
      But I can't get it to compile properly. It keeps complaining about stack and other stuff as well.

      What are the exact errors you are getting? If you can copy and paste the full error message from the CCS build console that will be helpful.

      When you create the new project are you selecting the "Empty Assembly-only Project" template from the list of templates? This would be the appropriate one to select for a project that is going to contain only assembly source files and no C source file. From there on you should be able to add your source file and build.


      If a post answers your question please mark it with the "Verify Answer" button

      Search the wikis for common questions: CGT, BIOS,  CCSv3, CCSv4
      Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • mouka zwina
      Posted by mouka zwina
      on Dec 26 2012 14:40 PM
      Prodigy70 points

      That's exactly what I did.

      1. I created a new Empty Assembly Project.

      2. CCS did create an empty project for me.

      3. I added a simple .asm file containing the code I showed before.

      4. I tried assembling, but the assembler, or the compiler, complained about all kinds of things missing or undefined.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • AartiG
      Posted by AartiG
      on Dec 26 2012 15:41 PM
      Guru68895 points

      If you can post the complete output of the CCS build view we can try to explain what the errors mean and what could be causing them.

      Was the code snippet you attached the full assembly source file? When you created the new project in CCS, did you pick Stellaris LM3S8962 as the device variant?


      If a post answers your question please mark it with the "Verify Answer" button

      Search the wikis for common questions: CGT, BIOS,  CCSv3, CCSv4
      Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • mouka zwina
      Posted by mouka zwina
      on Dec 26 2012 16:26 PM
      Prodigy70 points

      Here's all the code I had in my main.asm:

                   .text
      start:
                    mov r0,#1234
                    mov r1,#5678
                    add r2,r1,r0
      stop:     b stop

      here are the errors:

      warning #10204-D: automatic RTS selection: could not resolve index library "libc.a" to a compatible library
      error #10198-D: no input section is linked in

      "../lm3s8962.cmd", line 44: error #10104: undefined symbol "__stack" used in expression
      >> Compilation failure
      warning #10202-D: no suitable entry-point found; setting to 0
      error #10010: errors encountered during linking; "junk.out" not built
      gmake: *** [junk.out] Error 1
      gmake: Target `all' not remade because of errors.

      **** Build Finished ****

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Archaeologist
      Posted by Archaeologist
      on Dec 26 2012 17:29 PM
      Mastermind40550 points

      The quick-and-dirty answer is to change "start" to "main", and add a ".global main" directive (don't forget to indent it).  You'll get a bunch of startup code that you don't really need, but that's probably the easiest path for now.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • mouka zwina
      Posted by mouka zwina
      on Dec 26 2012 21:30 PM
      Prodigy70 points

      I just did. I added ".global main" directive. Without the double quotes obviously. But I am getting the same error messages as I did before.

      I think it is compiling my project as if it were a C project. The reason I am saying this is because it is trying to link the object code with libc.a. 

      I don't even know if CCS is capable of assembling simple projects. It seems that gcc is always trying to compile stuff as a C project.

      I tried several blank projects. But I am always getting the same errors. I tried changing stuff to address the errors I am getting, only to generate a lot more errors.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Archaeologist
      Posted by Archaeologist
      on Dec 27 2012 08:20 AM
      Mastermind40550 points

      Please do a "build all" and show us the entire contents of the build console window.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • mouka zwina
      Posted by mouka zwina
      on Dec 27 2012 10:59 AM
      Prodigy70 points

      **** Build of configuration Debug for project Test ****

      "C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
      'Building file: ../main.asm'
      'Invoking: ARM Compiler'
      "C:/ti/ccsv5/tools/compiler/arm_5.0.1/bin/armcl" -mv7M3 --code_state=16 --abi=eabi -me -g --include_path="C:/ti/ccsv5/tools/compiler/arm_5.0.1/include" --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="main.pp" "../main.asm"
      'Finished building: ../main.asm'
      ' '
      'Building target: Test.out'
      'Invoking: ARM Linker'
      "C:/ti/ccsv5/tools/compiler/arm_5.0.1/bin/armcl" -mv7M3 --code_state=16 --abi=eabi -me -g --diag_warning=225 --display_error_number --diag_wrap=off -z --stack_size=0 -m"Test.map" --heap_size=0 -i"C:/ti/ccsv5/tools/compiler/arm_5.0.1/lib" -i"C:/ti/ccsv5/tools/compiler/arm_5.0.1/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off -o "Test.out" "./main.obj" -l"libc.a" "../lm3s8962.cmd"
      <Linking>
      warning #10204-D: automatic RTS selection: could not resolve index library "libc.a" to a compatible library

      >> Compilation failure
      error #10198-D: no input section is linked in
      "../lm3s8962.cmd", line 44: error #10104: undefined symbol "__stack" used in expression
      warning #10202-D: no suitable entry-point found; setting to 0
      error #10010: errors encountered during linking; "Test.out" not built
      gmake: *** [Test.out] Error 1
      gmake: Target `all' not remade because of errors.

      **** Build Finished ****

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • mouka zwina
      Posted by mouka zwina
      on Dec 27 2012 11:30 AM
      Prodigy70 points

      Just for clarification: I went into the lm3s8962.cmd and I removed any references to the stack since I don't need it to be configured in an assembly project. But then I started getting errors relating to libc.a

      I removed any reference to libc.a from my project settings, and I still couldn't build the project properly.

      I have Googled CCS and I have found some stuff online relating to CCS 4. I have installed CCS 5. I don't know what happened when stuff got moved from version 4 to version 5. But I know for sure that an assembly project selected from the default CCS 5 templates does not work. Too many settings were not done properly.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • AartiG
      Posted by AartiG
      on Dec 27 2012 12:26 PM
      Verified Answer
      Verified by mouka zwina
      Guru68895 points

      Please take a look at this related thread. http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/176351/637520.aspx#637520

      Although that one is for a MSP430 device the errors noted there are similar. If you add the .retain directive in your asm source file you should be able to get rid of the "no input sections linked in" error. You would also need to set the entry point in the linker options (--entry_point) probably to "start" in your case. And comment out the line that sets __STACK_TOP in the linker command file lm3s8962.cmd. I beleive this should allow you to build without errors.

      Most users begin with C programs, and the out of box templates and examples are set up to work better with C projects rather than assembly only projects. If you plan to run code on a Stellaris LM3S8962 eval kit, the Stellarisware examples are a great starting point.  I would advise taking a look at and starting with the examples there as they are specifically targeted to run on the eval kit.


      If a post answers your question please mark it with the "Verify Answer" button

      Search the wikis for common questions: CGT, BIOS,  CCSv3, CCSv4
      Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • mouka zwina
      Posted by mouka zwina
      on Dec 27 2012 13:02 PM
      Prodigy70 points

      I got the project to build properly. I was even able to trace (debug) my small program and the registers were changing exactly the way they were supposed to.

      Thanks a LOT for your help.

      I think we should put SOLVED for this thread.

      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