Re: TMS470 with IAR C++ Compiler



Hi George! Thanks for the fast response!

I know C and C++ aren't interchangeable. Sorry for bad explanation. I was
at work trying to solve this problems and didn't explained well.

I have got simple code from TI website which configures CAN module (SCC)
to receive any CAN message. This code works well if I use IAR C Compiler
Version 5.1, but if I create another project using IAR C++ Compiler it
doesn't recognizes CAN interruption. In fact, when the message is received
the software stops working, like if there wasn´t an IRQ routine!

In C project all the configurations and register's setups are made in only
one source file (main.c). In C++ project registers setup and configurations
are the same, the difference are, of course, the compiler and a "Can"
class. I'm sure the logic is the same (I've compared all the registers in
both projects and they are identical).

After many attempts to solve this (web researches, reference guide,
datasheets, help files...) I decided to test both codes in IAR Version 4,
which I have installed in an old machine, and both projects (C and C++)
worked well!

Reading IAR documents about the two versions (IAR V4 and V5) I didn't find
any huge difference that could interfere in V5 C++ Compiler. I suspect of
different startup operation (cstartup.s file) between this versions but
didn't find more explanations about it! Does anyone have some material
about startup code?

Summarizing:
- IAR Embedded Workbench V4: C and C++ projects working fine!
- IAR Embedded Workbench V5: Only C version works.
- The source codes used to test the different versions are the same!
- No errors or warnings are shown in either version.
- Code optimization is turned off.
- With IAR Version 5 and C++ project the Interruption Routine seems to be
"ignored" by the compiler (but it don't generate warning or errors).
- I'm using the same IAR Development Board to test both projects.

I'm at home now and don't have the code with me, but tomorrow I'll post
it.

Any idea that could show a new way?

Sorry for huge email and thanks a lot for your attention and time!





On Thu, 22 Jan 2009 10:32:38 -0600, "Hagar"
<mm283729@xxxxxxxxxxxxxxxxxx> wrote:

Hi all.

I'm trying to use C++ and IAR for TMS470 uC's but I'm getting some
weird
troubles with C++.

For example: I have a simple test code to receive CAN frames using
interrupts. It compiles ok but when the frame arrives the application
blows!
If I use the same logic and configurations with C compiler everything
works perfectly.

I did a research for C++ Projects with TMS470 but didn't find
anything...
Do you have a link or a simple C++ IAR project using interrupts?


Any help will be appreciated!

Thanks a lot!

C and C++ aren't interchangeable. Can you post the code?

George

.



Relevant Pages

  • Re: Developing/compiling software
    ... I would be very surprised to see any major ARM compiler generating code at twice the speed of another major ARM compiler, whether we are talking gcc or commercial compilers. ... when entering an interrupt. ... I have no problem believing that an interrupt routine took significantly longer to execute with avr-gcc than with IAR - my issue is only with your reasoning, particularly since you emphasised that "ALL registers" were pushed. ...
    (comp.arch.embedded)
  • Re: 4k limit of IARs MSP430 C compiler
    ... IAR, with a limited C compiler. ... support their products very well, all offer some form of unlimited ... However if I link modules ...
    (comp.arch.embedded)
  • Re: PIC mplab c18 C compiler
    ... It's the only C compiler on PIC that is ... properties of a particular target, either get a new tool or hire someome ... So what anything else is not "real programming"? ... IAR is the only choice. ...
    (comp.arch.embedded)
  • Re: GCC compiler for ARM7-TDMI
    ... Anyone that has experience with some of the lower cost IDE's bassed on ... the GCC? ... I begun my project with the IAR compiler but it is on ice until I can ...
    (comp.arch.embedded)
  • Re: Developing/compiling software
    ... You say Keil has about 80% of the market. ... IAR in many cases. ... companies work with, usually, several of the leading compiler companies. ... The code quality from a Keil compiler for 8051 can not be beaten (some ...
    (comp.arch.embedded)