Problem compiling project

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

Moderators: barthess, RoccoMarco

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

Problem compiling project

Postby Joerg-SH » Thu Aug 08, 2013 1:52 pm

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: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: Problem compiling project

Postby Tectu » Thu Aug 08, 2013 1:59 pm

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

Postby Joerg-SH » Fri Aug 09, 2013 8:44 am

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 2809 times

User avatar
Giovanni
Site Admin
Posts: 13115
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 765 times
Been thanked: 647 times
Contact:

Re: Problem compiling project

Postby Giovanni » Fri Aug 09, 2013 9:30 am

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

Postby Joerg-SH » Fri Aug 09, 2013 9:37 am

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: 13115
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 765 times
Been thanked: 647 times
Contact:

Re: Problem compiling project

Postby Giovanni » Fri Aug 09, 2013 9:41 am

What ChibiOS version are you using?

Giovanni

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

Re: Problem compiling project

Postby Joerg-SH » Fri Aug 09, 2013 9:45 am

The one downloaded with Chibistudio (latest)

Joerg

resset
Posts: 31
Joined: Thu Dec 20, 2012 11:57 pm
Location: Poland
Contact:

Re: Problem compiling project

Postby resset » Fri Aug 09, 2013 9:59 am

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

Postby Joerg-SH » Fri Aug 09, 2013 11:38 am

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: 13115
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 765 times
Been thanked: 647 times
Contact:

Re: Problem compiling project

Postby Giovanni » Fri Aug 09, 2013 1:01 pm

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


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 5 guests