cancel
Showing results for 
Search instead for 
Did you mean: 

[HELP]STM32F4-DISCOVERY with MP3 Player

dree86
Associate II
Posted on March 02, 2016 at 08:02

Hei there

Is there any working mp3 player using this eval board ?

Right now I try helix mp3 decoder but cannot compile using keil v4.

There are some error on assembly.h i cannot understand.

Please guide me thanks.

#mp3-stm32f4 #mp3-player
16 REPLIES 16
AvaTar
Lead
Posted on March 02, 2016 at 13:13

> Is there any working mp3 player using this eval board ?

 

Didn't try it myself, but my favorite search engine told me this (amongst others):

http://vedder.se/2012/12/stm32f4-discovery-usb-host-and-mp3-player/

http://www.codeforge.com/s/0/STM32F4-MP3-codec

https://github.com/vanbwodonk/STM32F4_USB_MP3

>There are some error on assembly.h i cannot understand.

 

>Please guide me thanks.

 

Posting the compiler/assembler/linker output would be really helpful. Not much clairvoyants here ...

dree86
Associate II
Posted on March 03, 2016 at 01:42

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6kH&d=%2Fa%2F0X0000000buU%2F3KnRTbkChjuP.IuDzWJztQjUgxKrhdzwzvIPYWfA78M&asPdf=false
AvaTar
Lead
Posted on March 03, 2016 at 07:23

I don't mess with an assembler often, but IMHO, the source (

..\Src\helix
eal\assembly.h

) seems to use the gas (Gnu Assembler) syntax, which is incompatible with the Keil assembler syntax.
dree86
Associate II
Posted on March 04, 2016 at 01:59

Hello Avatar

So what do you suggest for me?

AvaTar
Lead
Posted on March 04, 2016 at 07:43

>So what do you suggest for me?

I don't know this Cortex-M port, but if this assembler routines are actually gcc code, you have two option.

The first is to port those assembler routines to Keil.

The second one is to use a gcc-based toolchain to build your application.

Or perhaps, you can use such a toolchain to build a library, and link it into your Keil project.

dree86
Associate II
Posted on March 04, 2016 at 10:38

Hello Avatar

Thanks for your suggestion.

I manage to compile the helix mp3 codec with gnu toolchain and got libhelix.a file.

But i am kinda a puzzle how to include and use this library file into my keil project. Can you tell me how to do it ?

Thank you

AvaTar
Lead
Posted on March 04, 2016 at 11:45

> Can you tell me how to do it ?

 

Only in general terms - I'm no uVision user.

But usually, you have to add the library to the project. In a usual make-file base build, one would add ''

-lhelix

'' to the linker flags, to include the library

libhelix.a

for linking. And you will need to add the helix header file (*.h) that declares the Helix API to your project, too.

You might consult the uVision help/documentation or the Keil user forum, too.

This assumes that Keil uVision can link against this format, and you have matching floating point ABIs for both the library and the rest of the application.

dree86
Associate II
Posted on March 07, 2016 at 08:25

Man this stuff really killing me!!

OK, i succeed compile my project using libhelix.a by adding --wchar32 option to C/C++ project like u said to match ABIs library and rest of application. When I download my mp3 .hex file using ST LINK Utility produce error. It said

Programming error @: 0x00008000.

I thought my board was NG. But when I download another hex is fine. So there something wrong with my mp3 .hex file. Do you have any idea why? I also try by adding linker --fpu=[listname] but none of fpu work. here's the make file I didn't change anything still original from site.

#BINPATH=~/sat/bin
CC=arm-none-eabi-gcc
AR=arm-none-eabi-ar
###################################################
# Check for valid float argument
ifneq ($(FLOAT_TYPE), hard)
ifneq ($(FLOAT_TYPE), soft)
override FLOAT_TYPE = hard
#override FLOAT_TYPE = soft
endif
endif
###################################################
vpath %.c real
CFLAGS = -g -O2 -Wall
CFLAGS += -mlittle-endian -mthumb -mthumb-interwork -mcpu=cortex-m4
ifeq ($(FLOAT_TYPE), hard)
CFLAGS += -fsingle-precision-constant -Wdouble-promotion
CFLAGS += -mfpu=fpv4-sp-d16 -mfloat-abi=hard
#CFLAGS += -mfpu=fpv4-sp-d16 -mfloat-abi=softfp
else
CFLAGS += -msoft-float
endif
#-nostdlib
CFLAGS += -ffreestanding -nostdlib
CFLAGS += -Ireal -Ipub
SRCS = mp3dec.c mp3tabs.c bitstream.c buffers.c dctc dequant.c dqchan.c
SRCS += huffman.c hufftabs.c imdct.c polyphase.c scalfact.c
SRCS += stproc.c subband.c trigtabs_fixpt.c
OBJS = $(SRCS:.c=.o)
.PHONY: libhelix.a
all: libhelix.a
%.o : %.c
$(CC) $(CFLAGS) -c -o $@ $^
libhelix.a: $(OBJS)
$(AR) -r $@ $(OBJS)
clean:
rm -f $(OBJS) libhelix.a

AvaTar
Lead
Posted on March 07, 2016 at 12:07

> It said 

Programming error @: 0x00008000.

 

Definitely not a issue with the downloaded code, but with the toolchain /IDE, which is for some reason unable to put the code into the Flash.

Perhaps some Keil user here can help you, or you try the Keil support forum.