Recent Changes - Search:

Menu?

PmWiki

pmwiki.org

edit SideBar

SoundPipeOnSTM32F407GDiscoverBoard

Installing SoundPipe on the STM32F407G Discover Board

Installing the Toolchain for STM32/ARM

On Mac OSX

http://www.erikandre.org/2015/09/getting-started-with-openstm32-on-osx.html

You might have trouble in step 3, In my case the AC6 toolchain was installed in a folder called .pt in /{HOME}

On Linux

http://www.wolinlabs.com/blog/linux.stm32.discovery.gcc.html

Blink an LED

Simple Saw Wave

Took code from here - http://www.mind-dump.net/configuring-the-stm32f4-discovery-for-audio to generate a simple saw wave audio output. Had problems with the Makefile borrowed from the blinky example above.

Got a lot of undefined reference errors, which was solved by adding certain files to the compiled sources.

Essentially these:

    SRCS += $(STM_COMMON)/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
    SRCS += $(STM_COMMON)/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
    SRCS += $(STM_COMMON)/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
    SRCS += $(STM_COMMON)/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_i2c.c

Also got undefined reference to assert_param which was solved by adding this flag:

CFLAGS += -DUSE_STDPERIPH_DRIVER

The Makefile and all other files used to build the code have been committed here - https://github.com/theisro/stm32sawwave

Oscillator Experiments

Here is a tutorial from STM on using the DAC http://stm32.eefocus.com/download/index.php?act=down&id=949

Various experiments for oscillators using the STM32F4xx discovery board have been committed to github here - https://github.com/theisro/oscillators

Compiling Soundpipe for STM32F4 Discovery Board There are some corrections and changes that needed to be made to cross-compile Soundpipe for STM32F4 board. These have been made in a forked repository from Soundpipe available here - https://github.com/theisro/Soundpipe

Clone the repository with

    $ git clone https://github.com/theisro/Soundpipe

Change to the directory

    $ cd Soundpipe

Export the following environment variables in your shell.

    export CC=arm-none-eabi-gcc
    export CXX=arm-none-eabi-g++
    export AR=arm-none-eabi-ar
    export LD=arm-none-eabi-ld
    export LDFLAGS="--specs=nosys.specs"

Paul the author of Soundpipe recommended adding NO_LIBSNDFILE=1 to the top of config.mk. But I still got errors while trying to compile with missing libsndfile.

I have not been able to get libsndfile cross-compiled to STM32F4. I have raised a github issue, but I obviously don't have enough experience in developing cross-compiled tools and libraries. The issue is here - https://github.com/erikd/libsndfile/issues/382 . If anyone knows how to properly cross-compile libsndfile for STM32F4 please post your responses there or here in this wiki.

Now run make

     $ make

After running for a while it will fail complaining that it is not able to find libsndfile. But the main libsoundpipe library will be compiled and present in your root Soundpipe directory.

Now clone https://github.com/theisro/soundpipe-stm32f4 and modify src/Makefile. The line that reads LDFLAGS = -L/home/arun/build/Soundpipe should be modified to point to the path where you cloned Soundpipe.

Change to the src directory.

    $ cd src

Now make burn to burn the example to your STM32F4 Discovery Board.

    $ make burn

The repository had other directories like experimentsnn/ where various experiments with soundpipe can be found. They can be built the same way. The LDFLAG in the Makefile must be changed to point to the path of the Soundpipe library.

Ubuntu 18.04

If you see the error 'Conflicting CPU architectures 13/1' when compiling on Ubuntu 18.04, there is a known bug. Follow the instructions here - https://github.com/bbcmicrobit/micropython/issues/514#issuecomment-404759614 and download and install the .deb files mentioned there.

Edit - History - Print - Recent Changes - Search
Page last modified on August 30, 2018, at 03:11 PM