Page 1 of 2

Problem compiling project

Posted: Thu Aug 08, 2013 1:52 pm
by Joerg-SH
Hello,
I use the last Chibistudio, works great! :)

I found this http://www.wheeze.plus.com/RPi_and_STM32F4DISCOVERY/

I think is based on a older Version of chibios.

Compiling stops with

Description Resource Path Location Type
fatal error: usb_cdc.h: No such file or directory usbcfg.c /ARMCM4-STM32F407-DISCOVERY-PI line 23 C/C++ Problem


I can´t find usb_cdc.h in the directories. So I think something changes???

Regards

Joerg

Re: Problem compiling project

Posted: Thu Aug 08, 2013 1:59 pm
by Tectu
The USB stuff has been changed with version 2.6. It's correct that there's no usb_cdc.h file anymore. Take a look at the demos to see how it's done now (The code itself changed too [slightly]).


~ Tectu

Re: Problem compiling project

Posted: Fri Aug 09, 2013 8:44 am
by Joerg-SH
Ok I try to add code to a actual sample.

In code chrtclib.c is needed so I add "#include "chrtclib.h"" to main.c

I get compile error (see picture)

Fehler.PNG
Fehler.PNG (102.29 KiB) Viewed 7527 times

Re: Problem compiling project

Posted: Fri Aug 09, 2013 9:30 am
by Giovanni
You need to enable the RTC driver in halconf.h.

Giovanni

Re: Problem compiling project

Posted: Fri Aug 09, 2013 9:37 am
by Joerg-SH
I think I did?

/**
* @brief Enables the RTC subsystem.
*/
#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
#define HAL_USE_RTC TRUE
#endif

Re: Problem compiling project

Posted: Fri Aug 09, 2013 9:41 am
by Giovanni
What ChibiOS version are you using?

Giovanni

Re: Problem compiling project

Posted: Fri Aug 09, 2013 9:45 am
by Joerg-SH
The one downloaded with Chibistudio (latest)

Joerg

Re: Problem compiling project

Posted: Fri Aug 09, 2013 9:59 am
by resset
Have you included chrtclib.c in your Makefile?

Code: Select all

CSRC += $(CHIBIOS)/os/various/chrtclib.c

Re: Problem compiling project

Posted: Fri Aug 09, 2013 11:38 am
by Joerg-SH
Thats was it, thanks a lot.

There is still a warning

main.c: In function 'Thread1':
main.c:276:1: warning: no return statement in function returning non-void [-Wreturn-type]

was before my changes to.


Is it possible to say eclipse to save all changed files before compile?



Joerg

Re: Problem compiling project

Posted: Fri Aug 09, 2013 1:01 pm
by Giovanni
Hi,

That warning is known ad accepted, you can suppress that by putting a "return 0" at the end but doing so the Keil and IAR compiler would start complaining about unreachable code.

Being 2 compilers vs 1 compiler Keil and IAR win and the warning using GCC has to stay.

Giovanni