From: drowe67 Date: Wed, 22 May 2013 12:15:45 +0000 (+0000) Subject: updated Makefile to dl std periph lib X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=9daaf42c2793fd30917628a76f1cdf886b6cb912;p=freetel-svn-tracking.git updated Makefile to dl std periph lib git-svn-id: https://svn.code.sf.net/p/freetel/code@1260 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/stm32/Makefile b/codec2-dev/stm32/Makefile index a8b74c06..3946dc5f 100644 --- a/codec2-dev/stm32/Makefile +++ b/codec2-dev/stm32/Makefile @@ -29,6 +29,8 @@ endif # 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) @@ -69,7 +71,10 @@ $(CODEC2_SRC)/codebookge.c \ $(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 @@ -107,7 +112,15 @@ OBJS = $(SRCS:.c=.o) 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 diff --git a/codec2-dev/stm32/README.txt b/codec2-dev/stm32/README.txt index fbd2cadd..d5829679 100644 --- a/codec2-dev/stm32/README.txt +++ b/codec2-dev/stm32/README.txt @@ -2,28 +2,34 @@ README.txt 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 @@ -37,11 +43,11 @@ make 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