Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# Copyright 2016-2020
#
# Timo Kortbrae,
# Jan Heitmann,
# Bernd-Christian Renner, and
# Hamburg University of Technology (TUHH).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
PRJ_PATH = .
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FLASH=0x8000000
CSRCS = \
hal/mcu/stm32f4/lib/src/ahoi/vectors_stm32f446xx.c \
hal/mcu/stm32f4/lib/src/ahoi/initialize_hardware.c \
hal/mcu/stm32f4/lib/src/ahoi/reset_hardware.c \
hal/mcu/stm32f4/lib/src/ahoi/startup.c \
hal/mcu/stm32f4/lib/src/cmsis/system_stm32f4xx.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_cortex.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_dma.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_gpio.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_uart.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_adc.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_adc_ex.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_rcc_ex.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_rcc.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_i2c.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_spi.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_tim.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_pwr_ex.c \
hal/mcu/stm32f4/lib/src/stm32f4-hal/stm32f4xx_hal_pwr.c \
hal/mcu/stm32f4/stm32f4_board.c \
hal/mcu/stm32f4/stm32f4_bootloader.c \
hal/mcu/stm32f4/stm32f4_adc.c \
hal/mcu/stm32f4/stm32f4_gpio.c \
hal/mcu/stm32f4/stm32f4_spi.c \
hal/mcu/stm32f4/stm32f4_timer.c \
hal/mcu/stm32f4/stm32f4_uart.c \
hal/mcu/stm32f4/stm32f4_i2c.c \
hal/mcu/mcu_init.c \
hal/mcu/mcu_adda.c \
hal/mcu/mcu_debug.c \
hal/mcu/mcu_modem_config.c \
hal/boards/${TXAMP}/txamp.c \
hal/boards/${RXAMP}/filterraw.c \
hal/boards/${RXAMP}/filter.c \
INC_PATH = \
hal/mcu/stm32f4/lib/include/stm32f4-hal/Legacy/ \
hal/mcu/stm32f4/lib/include/stm32f4-hal/ \
hal/mcu/stm32f4/lib/include/cmsis/ \
hal/mcu/stm32f4/lib/include/ \
hal/mcu/stm32f4/lib/config/ \
hal/mcu/stm32f4/ \
hal/mcu/interface/ \
hal/mcu/ \
hal/dev/ \
# GCC optimization levels
OPTIMIZATION = -flto -funroll-loops -finline-functions -O2
# extra compiler flags
CFLAGS = -std=gnu99 -Wall -I. -I./config
# STM32 HAL options
CFLAGS += -DSTM32F446xx -DSTM -DUSE_HAL_DRIVER
CFLAGS += -DHSE_VALUE=16000000U
CFLAGS += -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16
# setup sampling rate for receiving (SAMPLING_FREQ) and sending (TX_FACTOR)
# supported combinations
CFLAGS += -DSAMPLING_FREQ=200000 -DTX_FACTOR=1
# linker setup
LINKER_SCRIPT = $(PRJ_PATH)/hal/mcu/stm32f4/lib/linker_scripts
# linker flags
LDFLAGS = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16
#LDFLAGS += -T mem.ld -T libs.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L$(LINKER_SCRIPT) -Wl,-Map,"$(BUILD_DIR)/$(PROJ_NAME).map"
LDFLAGS += -T STM32F446RETx_FLASH.ld -nostartfiles -Xlinker --gc-sections -L$(LINKER_SCRIPT) -Wl,-Map,"$(BUILD_DIR)/$(PROJ_NAME).map"