Hello everyone,
after reading the book twice and every post in this group, encouraged by your super support i finaly decided to post here.
I am preety new to the embedded world, but not a total noob. Unfortunately i am a complete noob when it comes to C++ or the CrossStudio, Crossworks form Rowley.
Until now i tried to follow and to understand the succes stories of implementing CppUtest in IAR, Keil and ATmel Studio.
In little steps i managed to get the CppUTest and CppUtestExt to compile creating a library. The UtestPlatform.cpp i used was the one from src\Platforms\Iar. It compiles but i
am not completely sure if i need to change something in there to get it working for Crossworks.
The first problem was that with the gcc compiler chosen hundreds od erros would come up.
Many of them in such form: declaration of C function 'long int abs(long int)' conflicts with stdlib.h
The solution was to choose the clang compiler. One other thing was to enable excpetion support in the code generation options.
In the compiler options this command had to be included: -fno-threadsafe-statics. It had something to do with no safe threads. For a C++ noob like me this is a little bit unclear to understand. And i am not sure if this option will break something in CppUTest.
That was the first part. After that i tried to add the second project like described in the stories, the CppUTest_Tests project. Offcourse that after adding all the .cpp's and .c's it didnt compile. After adding the memory map file that i found in this group for the Cortex M3 things started getting better.
The first problem was
the "Undefined reference to '__cxa_guard_acquire'" error message. Solved also with the parameter: -fno-threadsafe-statics
Next was the
"undefined reference to 'abort'" error message. Solved with following code:
extern "C" void abort(void)
{
while (1);
}
Next error was "Undefined reference to '__cxa_pure_virtual'" error message, solved in a similar way:
extern "C" void __cxa_pure_virtual()
{
while (1);
}
After that folowed the undefined clock() function. I solved that by implementing the clock() function mentione in the Keil succes story.
One of the problems is that i dont know if all those sollution are realy working, they just helped me compile the tests.
Now after the tests are compiling i cant see any result and i dont realy understand how to do that. I amanged to get it working on visual studio,
but this crossworks is killing me. I tried to implement something similar to the Keil semihosting thing to retarget the fputc, but that didnt seem to help.
I hope this isnt to much text for you, but i simply dont know what to do next. Thanks in forward for everyone who wants to help.