Search code examples
cstandard-libraryavr-gccatmelavr-studio6

System calls not working in Atmel AVR Studio (with ASF)


I am not getting answers on the AVR Freaks forum and wonder if someone here could help me.

The answer might lie in this SO question, but I am not sure why it would be necessary.

Basically, I have my fist ever Atmel project (AVR studio 6, UC3 processor). The code compiles and links and I can load it to the Atmel board and step through in the debugger.

However, when I try to step over (or run until a breakpoint on the line after) a (valid) call to sprintf(), malloc() or memcpy() (there may be more, which I have not yet discovered), the IDE never returns to the next line of my code, just seeming to hang, or run forever.

[Note] Compiler optimization is off

Do I need to set some linker options (e.g link static (which I tried & it didn't help)? Or build with some library?

What confuses me is that the code compilers and links - what is being linked when I call these standard functions? If I need something else I would expect a compiler or linker error, but get none - so why won't my code run?

Sorry for such a stupid n00nb question, but it is my first micro-controller project.


Solution

  • I discovered that the CPU on my board is an Engineering Sample and not supported by Atmel Studio without a new io.h file.

    I sort of figured that out from this question: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=106652

    Sorry to have troubled you.