# Definitions for the STM32F4 Standard Peripheral Library
+PERIPHLIBURL = http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/firmware/
+PERIPHLIBZIP = stm32f4_dsp_stdperiph_lib.zip
PERIPHLIBVER = V1.1.0
PERIPHLIBNAME = STM32F4xx_DSP_StdPeriph_Lib
PERIPHLIBDIR = $(PERIPHLIBNAME)_$(PERIPHLIBVER)
$(CODEC2_SRC)/dump.c
CFLAGS += -D__EMBEDDED__ -DTIMER
+
+#enable this for dump files to help verify optimisation
#CFLAGS += -DDUMP
+
CFLAGS += -I/home/david/codec2-dev/src
CFLAGS += -I/home/david/codec2-dev/unittest
CFLAGS += -Iinc
all: libstm32f4.a $(PROJ_NAME).elf fft_test.elf
-libstm32f4.a:
+dl/$(PERIPHLIBZIP):
+ mkdir -p dl
+ cd dl; wget $(PERIPHLIBURL)/$(PERIPHLIBZIP)
+
+$(PERIPHLIBDIR): dl/$(PERIPHLIBZIP)
+ cd dl; unzip $(PERIPHLIBZIP)
+ mv dl/$(PERIPHLIBDIR) $(PERIPHLIBDIR)
+
+libstm32f4.a: $(PERIPHLIBDIR)
$(MAKE) $(STM32F4TEMPLATE)/system_stm32f4xx.o
for F in $(STM32F4LIB)/src/*.c ; do $(MAKE) $${F%.c}.o ; done
for F in $(CMSIS)/DSP_Lib/Source/*/*.c ; do $(MAKE) $${F%.c}.o ; done
codec2-dev stm32f4
David Rowe May 2013
+TODO
+ + Describe what gdb_stdio does, describe what UT does.
+ + Where raw files end up.
+ + Dump files and how to use them.
+
Getting Started
-------------------------
-Describe what gdb_stdio does, describe what UT does. Where raw files
-end up. Dump files and how to use them.
+. Install arm toolchain binary
-Install arm toolchain binary
+ wget https://launchpadlibrarian.net/126639661/gcc-arm-none-eabi-4_7-2012q4-20121208-linux.tar.bz2
+ untar, I placed it in ~/sat
-Download and untar STM32F4xx_DSP_StdPeriph_Lib_V1.1.0
+. Build codec2 unit test:
-build codec2 unit test, describe what it does
-make
+ cd codec2_dec/stm
+ edit BINPATH for your toolchain locations
+ make
-1. Patching and build stlink:
+. Patching and build stlink:
TBC
-2. start st-util:
+. start st-util:
~/stlink$ sudo ./st-util -f /home/david/codec2-dev/stm32/stm32f4_codec2.elf
-3. Start gdb:
+. Start gdb:
~/codec2-dev/stm32$ ~/sat/bin/arm-none-eabi-gdb stm32f4_codec2.elf
Start address 0x800a885, load size 118572
Transfer rate: 13 KB/sec, 10779 bytes/write.
-4. Power cycle Discovery.
+. Power cycle Discovery.
-5. ctrl-C to stop st-util, then restart st-util
+. ctrl-C to stop st-util, then restart st-util
-6. Back to gdb:
+. Back to gdb:
(gdb) tar ext :4242
A program is being debugged already. Kill it? (y or n) y