Forum: ARM programming with GCC/GNU tools Problems with Code sourcery G++ , audio playback file

Author: (unknown) (Guest)
Posted on:

Rate this post
0 useful
not useful
Dear All,
            Greetings !!!
I am trying to build a code example given with the STM32F4 discovery 
board and am getting the following problems in the console/ after build

ct/Audio_playback_and_record/inc/usb_conf.h:139:6:  error: #error 
"USB_OTG_HS_CORE or USB_OTG_FS_CORE should be defined"
t/Audio_playback_and_record/inc/usb_conf.h:152:6:  error: #error 
"USE_USB_OTG_HS or USE_USB_OTG_FS should be defined"
cs-make: *** [temp_folder/usb_bsp.o] Error 1"

I could find one reference to this problem in one of german version of 
this forum but could not understand the solution well(if it at all it 
was suggested). So can somebody throw some light on this issue?

Tools: Eclipse Indigo
Compiler: Code sourcery G++ Lite
Debugger: Atollic gdb server
Linker, STLink.
Board: STM32F4 Discovery

Toolchain status: I have been able to download and debug a simple LED 
blinking project in this toolchain so I have some idea about what all 
files to include , etc.

One more question:
Although unrelated but, since the Atollic toolchain has a code 
limitation of 32k, would I face a similar problem if I use their 
debugger? I havent reached that far so dont have an idea about the same.


Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Arm user wrote:
> error: #error "USB_OTG_HS_CORE or USB_OTG_FS_CORE should be defined"

Since nobody else anwered so far just a quick hint from someone who has 
not done that much with STM32 und USB: as written in the error-message 
one of these symbols (better: preprocessor macros) needs to be defined. 
Usually the definition is done by a parameter to the compiler (indirect 
to the preprocessor).

IRC the ST-Micro examples come with project-settings for uVision, EWARM 
and Truestudio. Most of these files a human-readable, open them in an 
editor and search for one of Names. Pass this name using the gcc -D 
option. For example -DUSB_OTG_HS_CORE or -DUSB_OTG_FS_CORE . I don't 
know if the example is made for highspeed of fullspeed but it should be 
save to use the same settings as in the examples.

Another option is to define one of the macros in a header-file which is 
included by all USB-codes. IRC there is such a file in the STM library, 
somthing like usbconf.h. Further information should be available in the 
manual of the STM32F-USB-Library. The STM32-forum at st.com might be a 
better place to ask such target-specific questions.

Hope this helps,

Author: (unknown) (Guest)
Posted on:

Rate this post
0 useful
not useful
Hello Martin,
               Many thanks for your reply, I will try both options and 
post my progress.I agree STM32 forum would be a good choice. My choice 
for this forum was based on google results, and the fact that  some one 
had faced similar problem in the german version of the forum.



Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.