• 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 » LM-3S9B96 simple errors
Share
Stellaris® ARM® Microcontrollers
  • Forum
Options
  • Subscribe via RSS
Helpful Stellaris® LM4F Series Links
  • LM4F Series
  • Stellaris PinMux Utility
  • Stellaris® LM4F120 LaunchPad
  • LM4F MCU Applications
  • LM4F MCU Video
  • ARM Cortex-M4F Whitepaper
  • Stellaris MCU Brochure
  • LM4F232 Eval Kit
  • LM-3S9B96 simple errors

    LM-3S9B96 simple errors

    • Tomasz Rogalski
      Posted by Tomasz Rogalski
      on Jul 06 2010 04:12 AM
      Intellectual530 points

      Hi everyone,

      I try to import project which was written in IAR to Sourcery G++. It worked there but now it doesn't. I still have problems with libaries but I think that I've added already all.

      Now i've got problem like this:

       

      **** Build of configuration Debug for project OBS_2010 ****

      cs-make all
      'Building file: ../startup_ewarm.c'
      'Invoking: Sourcery G++ C Compiler'
      arm-stellaris-eabi-gcc -O0 -g3 -Wall -c -fmessage-length=0 -fcommon -MMD -MP -MF"startup_ewarm.d" -MT"startup_ewarm.d" -mcpu=cortex-m3 -mthumb -o"startup_ewarm.o" "../startup_ewarm.c"
      ../startup_ewarm.c:31: warning: ignoring #pragma language
      ../startup_ewarm.c:64: error: stray '@' in program
      ../startup_ewarm.c:64: error: expected '=', ',', ';', 'asm' or '__attribute__' before string constant
      ../startup_ewarm.c:86: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'const'
      ../startup_ewarm.c:86: error: stray '@' in program
      cs-make: *** [startup_ewarm.o] Error 1

       

      line 64:  static unsigned long pulStack[256] @ ".noinit";

       

      line 86:

      _root const uVectorEntry __vector_table[] @ ".intvec" =
      {
          { .ulPtr = (unsigned long)pulStack + sizeof(pulStack) },
                                                  // The initial stack pointer
          __iar_program_start,                    // The reset handler
          NmiSR,                                  // The NMI handler
          FaultISR,                               // The hard fault handler
          IntDefaultHandler,                      // The MPU fault handler
          IntDefaultHandler,                      // The bus fault handler
          IntDefaultHandler,                      // The usage fault handler
          0,                                      // Reserved
          0,                                      // Reserved
          0,                                      // Reserved
          0,                                      // Reserved
          IntDefaultHandler,                      // SVCall handler
          IntDefaultHandler,                      // Debug monitor handler
          0,                                      // Reserved
          IntDefaultHandler,                      // The PendSV handler
          SysTickHandler,                         // The SysTick handler
          IntDefaultHandler,                      // GPIO Port A
          IntDefaultHandler,                      // GPIO Port B
          IntDefaultHandler,                      // GPIO Port C
          IntDefaultHandler,                      // GPIO Port D
          IntDefaultHandler,                      // GPIO Port E
          UARTStdioIntHandler,                    // UART0 Rx and Tx
          IntDefaultHandler,                      // UART1 Rx and Tx
          IntDefaultHandler,                      // SSI0 Rx and Tx
          IntDefaultHandler,                      // I2C0 Master and Slave
          IntDefaultHandler,                      // PWM Fault
          IntDefaultHandler,                      // PWM Generator 0
          IntDefaultHandler,                      // PWM Generator 1
          IntDefaultHandler,                      // PWM Generator 2
          IntDefaultHandler,                      // Quadrature Encoder 0
          IntDefaultHandler,                      // ADC Sequence 0
          IntDefaultHandler,                      // ADC Sequence 1
          IntDefaultHandler,                      // ADC Sequence 2
          TouchScreenIntHandler,                  // ADC Sequence 3
          IntDefaultHandler,                      // Watchdog timer
          IntDefaultHandler,                       // Timer 0 subtimer A
          IntDefaultHandler,                      // Timer 0 subtimer B
          IntDefaultHandler,                      // Timer 1 subtimer A
          IntDefaultHandler,                      // Timer 1 subtimer B
          IntDefaultHandler,                      // Timer 2 subtimer A
          IntDefaultHandler,                      // Timer 2 subtimer B
          IntDefaultHandler,                      // Analog Comparator 0
          IntDefaultHandler,                      // Analog Comparator 1
          IntDefaultHandler,                      // Analog Comparator 2
          IntDefaultHandler,                      // System Control (PLL, OSC, BO)
          IntDefaultHandler,                      // FLASH Control
          IntDefaultHandler,                      // GPIO Port F
          IntDefaultHandler,                      // GPIO Port G
          IntDefaultHandler,                      // GPIO Port H
          IntDefaultHandler,                      // UART2 Rx and Tx
          IntDefaultHandler,                      // SSI1 Rx and Tx
          IntDefaultHandler,                      // Timer 3 subtimer A
          IntDefaultHandler,                      // Timer 3 subtimer B
          IntDefaultHandler,                      // I2C1 Master and Slave
          IntDefaultHandler,                      // Quadrature Encoder 1
          IntDefaultHandler,                      // CAN0
          IntDefaultHandler,                      // CAN1
          IntDefaultHandler,                      // CAN2
          IntDefaultHandler,                      // Ethernet
          IntDefaultHandler,                      // Hibernate
          IntDefaultHandler,                      // USB0
          IntDefaultHandler,                      // PWM Generator 3
          IntDefaultHandler,                      // uDMA Software Transfer
          IntDefaultHandler,                      // uDMA Error
          IntDefaultHandler,                      // ADC1 Sequence 0
          IntDefaultHandler,                      // ADC1 Sequence 1
          IntDefaultHandler,                      // ADC1 Sequence 2
          IntDefaultHandler,                      // ADC1 Sequence 3
          IntDefaultHandler,                      // I2S0
          IntDefaultHandler,                      // External Bus Interface 0
          IntDefaultHandler                       // GPIO Port J
      };

       

      Any ideas what is wrong? I try to solve this problem but can't figure out what is wrong.

      Regards.

      Tomasz

      LM3S9B96
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Andy Neil
      Posted by Andy Neil
      on Jul 06 2010 05:29 AM
      Guru31975 points

      All compilers provide some proprietary extensions to the standard 'C' language, and this is especially true of embedded compilers.

      Also, the 'C' standard itself states that many things are implementation-defined.

      Therefore you cannot simply take code written specifically for one compiler (eg, IAR) and assume that it will "just work" on another (eg, GCC).

      You need to port the code from being IAR-specific to being acceptable to GCC; this means:

      1. Removing (or replacing) all the IAR proprietary extensions;
      2. Ensuring that everything which depends upon IAR's implementation-defined behaviours will still work with GCC's implementation-defined behaviours.
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Tomasz Rogalski
      Posted by Tomasz Rogalski
      on Jul 06 2010 06:18 AM
      Intellectual530 points

      So I guess that now I should look for some informations about what from IAR I can import and what I can't. Because unfortunetly I don't know.

      Maybe you know where can I find such as informations?

       

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Andy Neil
      Posted by Andy Neil
      on Jul 06 2010 06:48 AM
      Guru31975 points

      Tomasz Rogalski
      Maybe you know where can I find such as informations?

      Yes, it will be in the Manuals for each compiler.

      Most compilers have a "Strict ANSI" option to disable their proprietary extensions. Assuming IAR has it, you could try building the code using IAR with this option enabled - this will identify all the IAR proprietary extensions for you.

      You will then have to study the IAR Manuals to determine what each extension does.

      You will then have to study the GCC Manuals to determine how to achieve the same effect in GCC.

       

      Similarly, you will have to check both sets Manuals for their Implementation-Defined behaviours...

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Tomasz Rogalski
      Posted by Tomasz Rogalski
      on Jul 06 2010 08:36 AM
      Intellectual530 points

      All right, so if I compiled file in IAR with option strict ISO/ANSI on and it is done without any errors that means that file is all right and I should look somwhere else to find solution of my problems. Am I right? Maybe the problem is that still some files are missing.

      By the way thank you for your help Andy.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Andy Neil
      Posted by Andy Neil
      on Jul 06 2010 09:05 AM
      Guru31975 points

       

      Tomasz Rogalski
      if I compiled file in IAR with option strict ISO/ANSI on and it is done without any errors that means that file is all right

      If that were the case, then, yes - that should be true.

      But it clearly cannot be the case!

      From the code you originally posted:

       

      Tomasz Rogalski
      line 64:  static unsigned long pulStack[256] @ ".noinit";

       line 86:

      _root const uVectorEntry __vector_table[] @ ".intvec" =
      {
          { .ulPtr = (unsigned long)pulStack + sizeof(pulStack) },

      The red highlighted items are clearly not standard ANSI 'C' - are they?!

      And those were the things that GCC was complaining about, weren't they?

      Tomasz Rogalski
      Maybe the problem is that still some files are missing

      No, that does not follow at all from the error messages that you posted.

      The error messages that you posted most definitely are to do with syntax errors in the files that you do have!

      If the problems were due to missing files, you would be getting Linker erors - not Compiler errors.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Tomasz Rogalski
      Posted by Tomasz Rogalski
      on Jul 07 2010 06:36 AM
      Intellectual530 points

      I will not start another topic because I think that I will have much more problems.

      I try to set some bits in registers and I have got error like this:

      error: lvalue required as left operand of assignment

      Line looks like that:

      SYSCTL_RCGC1_SSI0=1;

       

      I know that is simple error but I am really beginner and now I have got a lot problems.

      Regards

      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 Jul 07 2010 10:49 AM
      Mastermind9510 points

      SYSCTL_RCGC1_SSI0 is not a register.  It is a constant definition of a bit field value in a register.

      If you wanted to set the bit in the register, you would do something more like:

      HWREG(SYSCTL_RCGC1) = HWREG(SYSCTL_RCGC1) | SYSCTL_RCGC1_SSI0;

      if you wanted to clear the bit, you would do something like:

      HWREG(SYSCTL_RCGC1) = HWREG(SYSCTL_RCGC1) & ~SYSCTL_RCGC1_SSI0;

      But more likely, what you really want to do is call the SysCtlPeripheralEnable()  or SysCtlPeripheralDisable() function for the peripheral you want to enable or disable.  In this case it would be:

      SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Tomasz Rogalski
      Posted by Tomasz Rogalski
      on Jul 08 2010 03:01 AM
      Intellectual530 points

      OK, thank you very much.

      To sum up:

      If I have got in documentation that I should set some bit:

      HWREG(SYSCTL_RCGC1) = HWREG(SYSCTL_RCGC1) | SYSCTL_RCGC1_SSI0;

      to enable:

      SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);

      to disable:

      SysCtlPeripheralDisable(SYSCTL_PERIPH_SSI0);

      to clear register just disable?

      To set any value to register ?

      And the:

      What does it mean to write register?

      Thank for your help.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Andy Neil
      Posted by Andy Neil
      on Jul 08 2010 03:44 AM
      Guru31975 points

      Tomasz Rogalski
      What does it mean to write register?

      Writing a register (or memory location) means to send data to it;

      Reading means to get data from it.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Tomasz Rogalski
      Posted by Tomasz Rogalski
      on Jul 08 2010 04:07 AM
      Intellectual530 points

      OK, and how to set value 0x00000000 to register SSI_CR1?

      SSI_CR1|=0x00000000;   <= doesn't work

      The name of register is SSI_0_CR1 but compiler says that:

      'SSI_O_CR1' undeclared (first use in this function)

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Andy Neil
      Posted by Andy Neil
      on Jul 08 2010 04:14 AM
      Guru31975 points

      Tomasz Rogalski
      SSI_CR1 |= 0x00000000;   <= doesn't work

      Even if this compiled without error, it would not set the register to zero!

      I think you need to look again at the meaning of the |= operator in the 'C' programming language.

      Keil provide a useful book list - they are not all Keil-specific: http://www.keil.com/books/

      For an online 'C' textbook, see: http://publications.gbdirect.co.uk/c_book/

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Tomasz Rogalski
      Posted by Tomasz Rogalski
      on Jul 09 2010 05:09 AM
      Intellectual530 points

      Thank you Andy, I've read some about setting bites, registers etc.

      Now, when I compile my project I've got error like this:

      unrecognised emulation mode: cpu=cortex-m3
      Supported emulations: armelf

      Should I change emulation mode? Is it possible? In settings?

      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