EmbDev.net

Forum: ARM programming with GCC/GNU tools GNU issues for cpp


Author: Sujit P. (sujit_p)
Posted on:

Rate this post
0 useful
not useful
GCC issue 1:

We are working on the STM32F0 series, where the src code is in C++ and 
the compiler used is the GCC ARM (version 4.4.1) which compiles fine.
However when we changed the GCC compiler to 4.7.3 we are observing 
linker issues as below:
undefined reference to '_isatty'

Can anyone suggest a solution for the same?

*****************************************************

GCC issue 2:

We are working on the STM32F0 series, where the src code is in C++ and 
the compiler used is the GCC ARM (version 4.4.1) which compiles fine.

We are observing that the compiler is behaving weird while dividing 
variables.

i.e.
var1 = var2/2  => OK
var1 = var2/3  => FAIL! (runtime issue, compiles fine)

var1 = var2/8  => OK
var1 = var2/6  => FAIL! (runtime issue, compiles fine)

Seems it behaves weird for some specific values of the divider.
We have verified the issue thru thorough testing so theres no doubt left 
about the observation.
Now we are trying to find a soln/workaround for the same.

Any such experiences with the GCC ARM compiler would be helpful.

Author: Dr. Sommer (Guest)
Posted on:

Rate this post
1 useful
not useful
Sujit P. wrote:
> Can anyone suggest a solution for the same?
Define an empty dummy function:
void _isatty () {}
, compile & link. Then disassemble the code and see where it used, and 
remove that code.

Sujit P. wrote:
> var1 = var2/8  => OK
This will be optimized to a bitshoft (var2 >> 3)
> var1 = var2/6  => FAIL! (runtime issue, compiles fine)
Did you specify the correct ARM Core (Cortex-M0)? That core does not 
have a hardware division unit, you have to ensure the compiler generates 
software division code.

Author: Sujit P. (sujit_p)
Posted on:

Rate this post
0 useful
not useful
Hi,

can any one have a working CPP template.
so that i can use that as an example to proceed.

Author: Meth (Guest)
Posted on:

Rate this post
0 useful
not useful
You don't need a "CPP template", you need a "project template". Correct 
compiler options and linker file etc.

Since you not even replied to the question which core you're using, it's 
obviously not very urgent, and you'll be fine after taking your time 
reading the documentation.

Author: Sujit P. (sujit_p)
Posted on:

Rate this post
0 useful
not useful
Cortex M0
and wrking on STM32F051.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.