Add some debug assembly
This commit is contained in:
parent
b6aae3384e
commit
8985f3d3a3
75
Makefile
75
Makefile
@ -34,9 +34,9 @@ BUILD_DIR = build
|
|||||||
# source
|
# source
|
||||||
######################################
|
######################################
|
||||||
# C sources
|
# C sources
|
||||||
C_SOURCES = \
|
C_SOURCES = \
|
||||||
Core/Src/main.c \
|
Core/Src/main.c \
|
||||||
Core/Src/stm32f1xx_it.c \
|
Core/Src/stm32f1xx_it.c \
|
||||||
Core/Src/hal_interface.c \
|
Core/Src/hal_interface.c \
|
||||||
Core/Src/axp2101.c \
|
Core/Src/axp2101.c \
|
||||||
Core/Src/backlight.c \
|
Core/Src/backlight.c \
|
||||||
@ -44,31 +44,31 @@ Core/Src/batt.c \
|
|||||||
Core/Src/eeprom.c \
|
Core/Src/eeprom.c \
|
||||||
Core/Src/fifo.c \
|
Core/Src/fifo.c \
|
||||||
Core/Src/keyboard.c \
|
Core/Src/keyboard.c \
|
||||||
Core/Src/regs.c \
|
Core/Src/regs.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rtc.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rtc.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c \
|
||||||
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c \
|
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c \
|
||||||
Core/Src/system_stm32f1xx.c
|
Core/Src/system_stm32f1xx.c
|
||||||
|
|
||||||
# ASM sources
|
# ASM sources
|
||||||
ASM_SOURCES = \
|
ASM_SOURCES = \
|
||||||
startup_stm32f103xb.s
|
startup_stm32f103xb.s
|
||||||
|
|
||||||
# ASM sources
|
# ASM sources
|
||||||
@ -115,9 +115,9 @@ MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
|
|||||||
AS_DEFS =
|
AS_DEFS =
|
||||||
|
|
||||||
# C defines
|
# C defines
|
||||||
C_DEFS = \
|
C_DEFS = \
|
||||||
-DUSE_FULL_LL_DRIVER \
|
-DUSE_FULL_LL_DRIVER \
|
||||||
-DUSE_HAL_DRIVER \
|
-DUSE_HAL_DRIVER \
|
||||||
-DSTM32F103xB
|
-DSTM32F103xB
|
||||||
|
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
@ -133,11 +133,11 @@ endif
|
|||||||
AS_INCLUDES =
|
AS_INCLUDES =
|
||||||
|
|
||||||
# C includes
|
# C includes
|
||||||
C_INCLUDES = \
|
C_INCLUDES = \
|
||||||
-ICore/Inc \
|
-ICore/Inc \
|
||||||
-IDrivers/STM32F1xx_HAL_Driver/Inc \
|
-IDrivers/STM32F1xx_HAL_Driver/Inc \
|
||||||
-IDrivers/STM32F1xx_HAL_Driver/Inc/Legacy \
|
-IDrivers/STM32F1xx_HAL_Driver/Inc/Legacy \
|
||||||
-IDrivers/CMSIS_Device_ST_STM32F1xx/Include \
|
-IDrivers/CMSIS_Device_ST_STM32F1xx/Include \
|
||||||
-IDrivers/CMSIS/Include
|
-IDrivers/CMSIS/Include
|
||||||
|
|
||||||
|
|
||||||
@ -152,6 +152,7 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
# Generate dependency information
|
# Generate dependency information
|
||||||
|
CFLAGS_ASM := $(CFLAGS)
|
||||||
CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)"
|
CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)"
|
||||||
|
|
||||||
|
|
||||||
@ -175,6 +176,7 @@ all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET
|
|||||||
#######################################
|
#######################################
|
||||||
# list of objects
|
# list of objects
|
||||||
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
|
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
|
||||||
|
OBJECTS_ASM = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.s)))
|
||||||
vpath %.c $(sort $(dir $(C_SOURCES)))
|
vpath %.c $(sort $(dir $(C_SOURCES)))
|
||||||
# list of ASM program objects
|
# list of ASM program objects
|
||||||
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
|
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
|
||||||
@ -185,12 +187,15 @@ vpath %.S $(sort $(dir $(ASMM_SOURCES)))
|
|||||||
$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
|
$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
|
||||||
$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
|
$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
|
||||||
|
|
||||||
|
$(BUILD_DIR)/%.s: %.c Makefile | $(BUILD_DIR)
|
||||||
|
$(CC) $(CFLAGS_ASM) -fverbose-asm -S $< -o $@
|
||||||
|
|
||||||
$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
|
$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
|
||||||
$(AS) -c $(CFLAGS) $< -o $@
|
$(AS) -c $(CFLAGS) $< -o $@
|
||||||
$(BUILD_DIR)/%.o: %.S Makefile | $(BUILD_DIR)
|
$(BUILD_DIR)/%.o: %.S Makefile | $(BUILD_DIR)
|
||||||
$(AS) -c $(CFLAGS) $< -o $@
|
$(AS) -c $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
|
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) $(OBJECTS_ASM) Makefile
|
||||||
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
|
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
|
||||||
$(SZ) $@
|
$(SZ) $@
|
||||||
|
|
||||||
@ -214,4 +219,4 @@ clean:
|
|||||||
#######################################
|
#######################################
|
||||||
-include $(wildcard $(BUILD_DIR)/*.d)
|
-include $(wildcard $(BUILD_DIR)/*.d)
|
||||||
|
|
||||||
# *** EOF ***
|
# *** EOF ***
|
||||||
|
Loading…
x
Reference in New Issue
Block a user