trouble with printf on Cortex-M3 (STM32)

OP #1328183
Rate this post
• ▲ useful
▼ not useful
Hi,

I am trying to use yagarto (arm-elf-gcc 4.3.3) for STM32.
Everything works ok if I don't use printf.
But I need to use printf, so #included <stdio.h>. It produced error:
1
In file included from main.c:31:
2
C:\SCARM\GNUARM\arm-elf\include/stdio.h:190: error: expected declaration specifiers or '...' before '__gnuc_va_list'

Did not know the right way to overcome this error. So I added these
lines in main.c before #include <stdio.h>
1
#ifndef __GNUC_VA_LIST
2
#define __GNUC_VA_LIST
3
typedef void *__gnuc_va_list;
4
#endif

Then I could compile without errors, but linker produced many errors of
this type:
1
../arm-elf/bin/ld.exe: ERROR: stm32f10x_gpio.o uses FPA instructions, whereas Hello.elf does not

Does it mean that the newlib that came with yagarto is compiled using
FPA? Does it mean it can not be used for Cortex-M3? Is there a solution?

Thanks and Best Regards,

Ajeet

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.