Compiling CppUTest

526 views
Skip to first unread message

Alex Pabouctsidis

unread,
Jan 25, 2016, 3:46:39 PM1/25/16
to cpputest
Hello,

I'm in the process of setting up CppUTest for an embedded environment. We are currently working on a STM32F4 or similar and are heavily using eclipse CDT to develop and build our code.

After a couple days of trial and error, I've managed to compile and run our current firmware on a host PC using MinGW. I've also managed to compile CppUTest with Cygwin, and have it run on a test eclipse project, and everything seems to be working as it should.

The issue I'm having is that i'm unable to either compile our firmware using Cygwin, or CppUtest with MinGW. One of the main issues with compiling our firmware is that we are using FreeRTOS, and it turns out that FreeRTOS have a windows port which makes it much easier to compile the firmware for windows. The problem is that the port is only for MinGW.

I noticed that The 3.7.1 release notes on github have following:

"Two corrections to 3.7:
  • MinGW compilation (now automated)
  • MakefileHelper compilation error on OsX"

I was hoping that this meant that there was an easy was to compile it using MinGW. Unfortunately i'm unable to figure it out. I've tried compiling CppUTest with MinGW by generating the make files with Cmake, but that didn't work.

I was wondering if someone could guide me on how to build it with MinGW?

Thanks,
Alex

Denis Dantas

unread,
May 6, 2016, 2:49:52 PM5/6/16
to cpputest
Hey there Alex,

I also have a firmware based on freeRTOS, and stepped onto this same issue. Have you got any advance?

Best Regards,

Denis

Alex Pabouctsidis

unread,
May 9, 2016, 4:17:28 AM5/9/16
to cppu...@googlegroups.com
Hi Dennis,

It wasn't easy to get it working.I did manage to have it work with Cygwin, but the compilation+linking time was too slow to be practical.

In the end i managed to get it work with mingw-32 using msys2. You install msys2 and then add the mingw (32bit) compiler suite + autotools/autoreconf using the command line interface.

In order to compile our project with FreeRTOS, i just created a stub file of the port.c and portmacro.h, which contains empty declarations of all the required port functions.

Hope this helps,
Alex

--
You received this message because you are subscribed to a topic in the Google Groups "cpputest" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cpputest/WWN9sLo8VR4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cpputest+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alex Pabouctsidis
Lead Firmware Engineer
Flyability | Place du Nord 8 | 1005 Lausanne | Switzerland | Map
Mobile: +41 79 698 20 51
alex.pab...@flyability.com

Denis Dantas

unread,
May 10, 2016, 9:20:50 AM5/10/16
to cpputest
Hey there,

so in the end have you decided to compile your test environment with Cygwin or MinGW? I compiled freeRTOS with Cygwin in this project: http://www.freertos.org/FreeRTOS-simulator-for-Linux.html . I didn't manage to port it to my test environment yet though. And I was also thinking that the compile time of the freeRTOS is not cool, so I was thinking about adding the object files of freeRTOS only. I'm still figuring out the best strategy.

I have a few questions if you don't mind... What folders and files do you add to your project? What version of freeRTOS are you using? Are you using your own makefile (adding MakefileWorker.mk and so on...)? Is the compile & link time still long? Why do you use a stub file of port.c and macro.h?

Have a nice day!!

Denis
Reply all
Reply to author
Forward
0 new messages