Problem compiling project

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Joerg-SH
Posts: 29
Joined: Mon Feb 20, 2012 9:00 pm

Problem compiling project

Post 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
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: Problem compiling project

Post 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
Joerg-SH
Posts: 29
Joined: Mon Feb 20, 2012 9:00 pm

Re: Problem compiling project

Post 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 7505 times
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Problem compiling project

Post by Giovanni »

You need to enable the RTC driver in halconf.h.

Giovanni
Joerg-SH
Posts: 29
Joined: Mon Feb 20, 2012 9:00 pm

Re: Problem compiling project

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Problem compiling project

Post by Giovanni »

What ChibiOS version are you using?

Giovanni
Joerg-SH
Posts: 29
Joined: Mon Feb 20, 2012 9:00 pm

Re: Problem compiling project

Post by Joerg-SH »

The one downloaded with Chibistudio (latest)

Joerg
resset
Posts: 32
Joined: Thu Dec 20, 2012 11:57 pm
Has thanked: 2 times
Been thanked: 1 time

Re: Problem compiling project

Post by resset »

Have you included chrtclib.c in your Makefile?

Code: Select all

CSRC += $(CHIBIOS)/os/various/chrtclib.c
Joerg-SH
Posts: 29
Joined: Mon Feb 20, 2012 9:00 pm

Re: Problem compiling project

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Problem compiling project

Post 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
Post Reply