Skip to content

Commit 8eaebc0

Browse files
authored
Merge pull request drowe67#247 from drowe67/dr-spare-ram
stm32 maintenance
2 parents dcf7d67 + 86a4168 commit 8eaebc0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+7
-8268
lines changed

src/dump.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@
3232
#include <string.h>
3333
#include <math.h>
3434

35-
#ifdef __EMBEDDED__
36-
#include "gdb_stdio.h"
37-
#define fprintf gdb_stdio_fprintf
38-
#define fopen gdb_stdio_fopen
39-
#define fclose gdb_stdio_fclose
40-
#endif
41-
4235
#ifdef DUMP
4336
static int dumpon = 0;
4437

stm32/CMakeLists.txt

Lines changed: 6 additions & 227 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# stm32f4 Codec2 test programs
2+
# stm32f4 support for Codec2
33
#
44
# CMake configuration contributed by Richard Shaw (KF5OIM)
55
# Please report questions, comments, problems, or patches to the freetel
@@ -81,15 +81,6 @@ if(VERIFY_OPT)
8181
add_definitions(-DDUMP)
8282
endif()
8383

84-
#option(SEMIHOSTING "Enable for standard arm semihosting." OFF)
85-
#if(SEMIHOSTING)
86-
# link_libraries(rdimon)
87-
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --specs=rdimon.specs")
88-
#else()
89-
# link_libraries(nosys)
90-
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -specs=nosys.specs")
91-
#endif()
92-
9384
# Set default build type
9485
if(NOT CMAKE_BUILD_TYPE)
9586
set(CMAKE_BUILD_TYPE "Debug")
@@ -107,13 +98,11 @@ set(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf")
10798
set(CMAKE_EXECUTABLE_SUFFIX_ASM ".elf")
10899
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp")
109100

110-
111101
# Check build flags
112102

113103
message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS})
114104
message(STATUS "CMAKE_ASM_FLAGS: " ${CMAKE_ASM_FLAGS})
115105

116-
117106
###################################################
118107

119108
# STM32F4 Standard Peripheral Library
@@ -158,8 +147,6 @@ include_directories(../src ../unittest inc ${PROJECT_BINARY_DIR})
158147

159148
add_subdirectory(unittest/src)
160149

161-
162-
163150
# Codec 2
164151

165152
# Output path is such that #include <codec2/version.h> in codec2.h works
@@ -223,15 +210,13 @@ src/stm32f4_dac.c
223210
../src/codec2_fifo.c
224211
)
225212
add_library(stm32f4_adac STATIC ${STM32F4_ADAC_SRCS})
226-
227213
add_library(codec2 STATIC ${CODEC2_SRCS})
228214
add_library(codec2_prof STATIC ${CODEC2_SRCS})
229215
target_compile_definitions(codec2_prof PRIVATE PROFILE)
230216

231217
set(SYSTEM_SRCS
232218
src/system_stm32f4xx.c
233219
src/startup_stm32f4xx.s
234-
src/gdb_stdio.c
235220
)
236221

237222
add_library(sm1000base STATIC src/sm1000_leds_switches.c src/debugblinky.c ${SYSTEM_SRCS})
@@ -242,120 +227,26 @@ src/stm32f4_machdep.c
242227

243228
list(APPEND PROFILE_SYSTEM_SRCS ${SYSTEM_SRCS})
244229

245-
set(FFT_TEST_SRCS
246-
src/fft_test.c
247-
../src/kiss_fft.c
248-
)
249-
250-
add_mapped_executable(fft_test ${FFT_TEST_SRCS} ${PROFILE_SYSTEM_SRCS})
251-
target_link_libraries(fft_test stm32f4 CMSIS)
252-
elf2bin(fft_test)
253-
254-
255-
# Rule for programming the SM1000
256-
#%.pgm: %.bin
257-
# $(SUDO) dfu-util -d 0483:df11 -c 1 -i 0 -a 0 -s 0x08000000 -D $<
258-
####################################################
259-
260-
set(CODEC2_PROFILE_SRCS
261-
src/codec2_profile.c
262-
)
263-
264-
add_mapped_executable(codec2_profile ${CODEC2_PROFILE_SRCS} ${PROFILE_SYSTEM_SRCS})
265-
target_link_libraries(codec2_profile codec2_prof stm32f4 CMSIS)
266-
target_compile_definitions(codec2_profile PRIVATE PROFILE)
267-
elf2bin(codec2_profile)
230+
#----------------------------
268231

269232
set(DAC_UT_SRCS
270233
src/dac_ut.c
271234
)
272-
273235
add_mapped_executable(dac_ut ${DAC_UT_SRCS})
274236
target_link_libraries(dac_ut stm32f4_adac stm32f4 sm1000base)
275237
elf2bin(dac_ut)
276238

277-
set(FAST_DAC_UT_SRCS
278-
src/fast_dac_ut.c
279-
../src/codec2_fifo.c
280-
src/iir_duc.c
281-
src/stm32f4_dacduc.c
282-
src/debugblinky.c
283-
)
284-
285-
add_mapped_executable(fast_dac_ut ${FAST_DAC_UT_SRCS} ${SYSTEM_SRCS})
286-
target_link_libraries(fast_dac_ut stm32f4)
287-
target_compile_options(fast_dac_ut PRIVATE "-O3")
288-
elf2bin(fast_dac_ut)
289-
290-
set(ADCDAC_UT_SRCS
291-
src/adcdac_ut.c
292-
)
293-
294-
add_mapped_executable(adcdac_ut ${ADCDAC_UT_SRCS} ${STM32F4_ADAC_SRCS} ${SYSTEM_SRCS})
295-
target_link_libraries(adcdac_ut stm32f4 sm1000base)
296-
target_compile_options(adcdac_ut PRIVATE "-O0")
297-
elf2bin(adcdac_ut)
298-
299-
300-
set(DAC_PLAY_SRCS
301-
src/dac_play.c
302-
../src/codec2_fifo.c
303-
src/stm32f4_dac.c
304-
)
305-
306-
add_mapped_executable(dac_play ${DAC_PLAY_SRCS} ${SYSTEM_SRCS})
307-
target_link_libraries(dac_play stm32f4 sm1000base)
308-
target_compile_options(dac_play PRIVATE "-O0")
309-
elf2bin(dac_play)
310-
311-
set(ADC_REC_SRCS
312-
src/adc_rec.c
313-
)
314-
315-
add_mapped_executable(adc_rec ${ADC_REC_SRCS})
316-
target_link_libraries(adc_rec stm32f4_adac stm32f4 sm1000base)
317-
elf2bin(adc_rec)
318-
319-
set(ADC_SD_SRCS
320-
src/adc_sd.c
321-
)
322-
323-
add_mapped_executable(adc_sd ${ADC_SD_SRCS})
324-
target_link_libraries(adc_sd stm32f4_adac stm32f4 sm1000base)
325-
elf2bin(adc_sd)
326-
327-
set(PWM_UT_SRCS
328-
src/stm32f4_pwm.c
329-
)
330-
331-
add_mapped_executable(pwm_ut ${PWM_UT_SRCS})
332-
target_link_libraries(pwm_ut stm32f4 sm1000base)
333-
elf2bin(pwm_ut)
334-
335-
# ------------------------------------------------
239+
#----------------------------
336240

337241
set(USART_UT_SRCS
338242
src/stm32f4_usart.c
339243
src/usart_ut.c
340244
)
341-
342245
add_mapped_executable(usart_ut ${USART_UT_SRCS})
343246
target_link_libraries(usart_ut stm32f4 sm1000base)
344247
elf2bin(usart_ut)
345248

346-
# ------------------------------------------------
347-
348-
349-
set(POWER_UT_SRCS
350-
src/power_ut.c
351-
)
352-
353-
list(APPEND POWER_UT_SRCS ${CODEC2_SRCS})
354-
355-
# stm32/src/power_ut.c:124:5: error: too few arguments to function 'adc_open'
356-
# stm32/src/power_ut.c:125:5: error: too few arguments to function 'dac_open'
357-
#add_mapped_executable(power_ut ${POWER_UT_SRCS})
358-
#target_link_libraries(power_ut stm32f4_adac stm32f4 sm1000base)
249+
#----------------------------
359250

360251
set(USB_VCP
361252
usb_conf/usb_bsp.c
@@ -393,27 +284,17 @@ add_mapped_executable(adc_rec_usb ${ADC_REC_USB_SRCS} ${USB_VCP})
393284
target_link_libraries(adc_rec_usb stm32f4_adac stm32f4 sm1000base)
394285
elf2bin(adc_rec_usb)
395286

396-
397-
set(FDMDV_PROFILE_SRCS
398-
src/fdmdv_profile.c
399-
)
400-
401-
list(APPEND FDMDV_PROFILE_SRCS ${CODEC2_SRCS} ${SYSTEM_SRCS})
402-
403-
# Doesn't compile because M_PITCH is not defined but M_PITCH_S is.
404-
#add_mapped_executable(fdmdv_profile ${FDMDV_PROFILE_SRCS})
405-
#target_link_libraries(fdmdv_profile stm32f4)
406-
#target_compile_definitions(fdmdv_profile PRIVATE PROFILE)
287+
#----------------------------
407288

408289
set(SM1000_LEDS_SWITCHES_UT_SRCS
409290
src/sm1000_leds_switches_ut.c
410291
src/sm1000_leds_switches.c
411292
)
412-
413293
add_mapped_executable(sm1000_leds_switches_ut ${SM1000_LEDS_SWITCHES_UT_SRCS})
414294
target_link_libraries(sm1000_leds_switches_ut stm32f4 sm1000base)
415295
elf2bin(sm1000_leds_switches_ut)
416296

297+
#----------------------------
417298

418299
set(SM1000_SRCS
419300
src/sm1000_main.c
@@ -433,110 +314,8 @@ src/memtools.c
433314

434315
list(APPEND SM1000_SRCS ${CODEC2_SRCS})
435316

436-
437317
add_mapped_executable(sm1000v5 ${SM1000_SRCS} ${SYSTEM_SRCS})
438318
target_link_libraries(sm1000v5 stm32f4_adac stm32f4 CMSIS)
439319
target_compile_options(sm1000v5 PRIVATE "-O3")
440320
elf2bin(sm1000v5)
441321
elf2dfu(sm1000v5)
442-
443-
set(FREEDV_TX_PROFILE_SRCS
444-
src/freedv_tx_profile.c
445-
)
446-
447-
add_mapped_executable(freedv_tx_profile ${FREEDV_TX_PROFILE_SRCS} ${PROFILE_SYSTEM_SRCS})
448-
target_link_libraries(freedv_tx_profile codec2_prof stm32f4 CMSIS)
449-
target_compile_definitions(freedv_tx_profile PRIVATE PROFILE)
450-
elf2bin(freedv_tx_profile)
451-
452-
453-
set(FREEDV_RX_PROFILE_SRCS
454-
src/freedv_rx_profile.c
455-
)
456-
457-
add_mapped_executable(freedv_rx_profile ${FREEDV_RX_PROFILE_SRCS} ${PROFILE_SYSTEM_SRCS})
458-
target_link_libraries(freedv_rx_profile codec2_prof stm32f4 CMSIS)
459-
#target_link_libraries(freedv_rx_base "-Wl,-Map=$<TARGET_PROPERTY:NAME>.map")
460-
elf2bin(freedv_rx_profile)
461-
462-
set(FDMDV_DUMP_RT_SRCS
463-
src/fdmdv_dump_rt.c
464-
)
465-
466-
list(APPEND FDMDV_DUMP_RT_SRCS ${CODEC2_SRCS} ${SYSTEM_SRCS})
467-
468-
# Doesn't build due to FREEDV_NSAMPLES not being defined.
469-
#add_mapped_executable(fdmdv_dump_rt ${FDMDV_DUMP_RT_SRCS})
470-
#target_link_libraries(fdmdv_dump_rt stm32f4_adac stm32f4 sm1000base)
471-
#target_compile_options(fdmdv_dump_rt PRIVATE "-O3")
472-
473-
# ---------------------------------------------------------------------------
474-
475-
set(TUNER_UT_SRCS
476-
src/tuner_ut.c
477-
src/iir_tuner.c
478-
../src/fm.c)
479-
480-
# this needs to be compiled without the optimiser or ugly things happen
481-
# would be nice to work out why as ISRs need to run fast
482-
483-
add_library(stm32f4_adc_tuner STATIC src/stm32f4_adc_tuner.c)
484-
add_mapped_executable(tuner_ut ${TUNER_UT_SRCS} ${SYSTEM_SRCS})
485-
target_compile_options(tuner_ut PRIVATE "-O3")
486-
target_link_libraries(tuner_ut stm32f4_adc_tuner stm32f4_adac stm32f4 sm1000base)
487-
elf2bin(tuner_ut)
488-
489-
# -----------------------------------------------------------------------------
490-
491-
set(ADC_SFDR_UT_SRCS
492-
src/adc_sfdr_ut.c
493-
src/iir_tuner.c
494-
)
495-
496-
add_mapped_executable(adc_sfdr_ut ${ADC_SFDR_UT_SRCS})
497-
target_link_libraries(adc_sfdr_ut stm32f4_adc_tuner stm32f4_adac stm32f4 sm1000base CMSIS)
498-
elf2bin(adc_sfdr_ut)
499-
500-
# -----------------------------------------------------------------------------
501-
502-
#set(FM_LODUC_PLAY_SRCS
503-
#src/fm_loduc_play.c
504-
#gdb_stdio.c
505-
#../src/codec2_fifo.c
506-
#../src/fm.c
507-
#src/debugblinky.c
508-
#src/system_stm32f4xx.c
509-
#src/startup_stm32f4xx.s
510-
#)
511-
512-
#add_library(stm32f4_dacloduc STATIC src/stm32f4_dacloduc.c)
513-
514-
#add_mapped_executable(fm_loduc_play ${FM_LODUC_PLAY_SRCS})
515-
#target_link_libraries(fm_loduc_play stm32f4_dacloduc)
516-
517-
# -----------------------------------------------------------------------------
518-
519-
set(SI5351_UT_SRCS
520-
src/si5351_ut.c
521-
src/new_i2c.c
522-
src/si53xx.c
523-
)
524-
525-
add_mapped_executable(si5351_ut ${SI5351_UT_SRCS})
526-
target_link_libraries(si5351_ut stm32f4 sm1000base)
527-
elf2bin(si5351_ut)
528-
529-
# -----------------------------------------------------------------------------
530-
531-
set(MCO_UT_SRCS
532-
src/mco_ut.c
533-
src/tm_stm32f4_mco_output.c
534-
src/tm_stm32f4_gpio.c
535-
)
536-
537-
add_mapped_executable(mco_ut ${MCO_UT_SRCS})
538-
target_link_libraries(mco_ut stm32f4 sm1000base)
539-
elf2bin(mco_ut)
540-
541-
# -----------------------------------------------------------------------------
542-

stm32/inc/gdb_stdio.h

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)