SAM D21 – sprint issue

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I’d like to use sprintf function in my program. But unfortunately if I add something like this:

sprintf(bufor, "%5lu b/s, %5lu pix/s", counter/8, counter/8/10);

I cannot compile the program. Linking fails with:

Error      undefined reference to `_sbrk'

I use Atmel Studio 7. If I’ll add to the linker: --specs=nosys.specs the error changes to:

Error      undefined reference to `end’.

Do you have any Ideas how to solve the problem?

TIA

This topic has a solution.
Last Edited: Thu. Jan 5, 2017 - 08:46 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have a look at the example program in Atmel Studio that does printf.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Thanks, adding syscalls.c from ASF examples did the trick.