Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.tags*
*.o
*.d
cscope*
*.bin
*.elf
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ before_install:
- sudo apt-get install gcc-arm-none-eabi

script:
- cd program/
- make
- arm-none-eabi-size firmware.elf
73 changes: 73 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
export WORKSPACE_DIR=./program

#Primary firmware target
export FIRMWARE=./firmware

#
#include .mk
include $(WORKSPACE_DIR)/makefiles/toolchain.mk
include $(WORKSPACE_DIR)/makefiles/workspace.mk

#
#object file dir
include $(WORKSPACE_DIR)/board/vertigo-v2/board_config.mk

OBJS = $(sort $(patsubst %c, %o, $(SRCS) ))



#
#make target
all: $(FIRMWARE).bin $(FIRMWARE).elf

include $(WORKSPACE_DIR)/makefiles/rules.mk

clean:
rm -rf $(STARTUP_OBJ)
rm -rf $(FIRMWARE).elf
rm -rf $(FIRMWARE).bin
rm -f $(OBJS)
rm -f $(DEPS)
#
#upload firmware through st-flash
flash:
st-flash write $(FIRMWARE).bin 0x8000000

#
#create gdb server through openocd
openocd: flash
openocd -f ../debug/openocd.cfg

#
#execute cgdb
cgdb:
cgdb -d $(GDB) -x ./st_util_init.gdb

#
#execute gdbtui
gdbtui:
$(GDB) -tui -x ./st_util_init.gdb

#
#upload firmware through black magic probe
flash_bmp:
$(GDB) firmware.elf -x ./gdb_black_magic.gdb
#
#execute and connect to black magic gdb server, no needs to open a
#local sever in PC
cgdb_bmp:
cgdb -d $(GDB) firmware.elf -x ./bmp_gdbinit.gdb
flash_openocd:
openocd -f interface/stlink-v2.cfg \
-f target/stm32f4x_stlink.cfg \
-c "init" \
-c "reset init" \
-c "halt" \
-c "flash write_image erase $(PROJECT).elf" \
-c "verify_image $(FIRMWARE).elf" \
-c "reset run" -c shutdown
#automatically formate
astyle:
astyle -r --exclude=lib *.c *.h

.PHONY:all clean flash openocd gdbauto gdbtui cgdb astyle
223 changes: 0 additions & 223 deletions program/Makefile

This file was deleted.

85 changes: 85 additions & 0 deletions program/board/vertigo-v2/board_config.mk
Original file line number Diff line number Diff line change
@@ -1 +1,86 @@
TARGET_BOARD='Vertigo v2.0'

STARTUP_SRCS=$(WORKSPACE_DIR)/startup_stm32f427xx.c
EXTERNAL_DEVICE_SRCS = $(EXTERNAL_DEVICE)/AT24C04C.c \
$(EXTERNAL_DEVICE)/mpu9250.c \
$(EXTERNAL_DEVICE)/hmc5983.c \
$(EXTERNAL_DEVICE)/lea6h_ubx.c \
$(EXTERNAL_DEVICE)/ADS1246_MPX6115A.c

MCU_PERIPH_SRCS = \
$(MCU_PERIPH)/i2c.c \
$(MCU_PERIPH)/spi.c \
$(MCU_PERIPH)/gpio.c \
$(MCU_PERIPH)/tim.c \
$(MCU_PERIPH)/led.c \
$(MCU_PERIPH)/usart.c \
$(MCU_PERIPH)/input_capture.c \
$(MCU_PERIPH)/system_time.c

ACTUATORS_SRCS = $(ACTUATORS)/pwm.c

RADIO_CONTROLLER_SRCS = $(RADIO_CONTROLLER)/radio_control.c \
$(RADIO_CONTROLLER)/pwm_decoder.c

COMMON_SRCS =$(COMMON)/test_common.c \
$(COMMON)/memory.c \
$(COMMON)/io.c \
$(COMMON)/std.c

CONTROLLER_SRCS = $(CONTROLLER)/attitude_stabilizer.c \
$(CONTROLLER)/vertical_stabilizer.c \
$(CONTROLLER)/navigation.c \
$(CONTROLLER)/flight_controller.c \
$(CONTROLLER)/controller.c

FREERTOS_SRCS=$(FREERTOS)/Source/croutine.c \
$(FREERTOS)/Source/list.c \
$(FREERTOS)/Source/queue.c \
$(FREERTOS)/Source/tasks.c \
$(FREERTOS)/Source/timers.c \
$(FREERTOS)/Source/portable/MemMang/heap_1.c \
$(FREERTOS)/Source/portable/GCC/ARM_CM4F/port.c

MAVLINK_SRCS=$(MAVLINK)/communication.c \
$(MAVLINK)/mission.c \
$(MAVLINK)/parameter.c \
$(MAVLINK)/command_parser.c \
$(MAVLINK)/global.c

CMSIS_SRCS= \
$(CMSIS)/FastMathFunctions/arm_cos_f32.c \
$(CMSIS)/FastMathFunctions/arm_sin_f32.c

STMF4_STD_DRIVER_SRCS= \
$(WORKSPACE_DIR)/system_stm32f4xx.c \
$(ST)/src/misc.c \
$(ST)/src/stm32f4xx_rcc.c \
$(ST)/src/stm32f4xx_dma.c \
$(ST)/src/stm32f4xx_flash.c \
$(ST)/src/stm32f4xx_gpio.c \
$(ST)/src/stm32f4xx_usart.c \
$(ST)/src/stm32f4xx_tim.c \
$(ST)/src/stm32f4xx_spi.c \
$(ST)/src/stm32f4xx_i2c.c \
$(ST)/src/stm32f4xx_sdio.c

BASIC_SRCS= \
$(WORKSPACE_DIR)/interrupt.c \
$(WORKSPACE_DIR)/main.c \


#
#generate the source file list
#
SRCS += $(STARTUP_SRCS)
SRCS += $(EXTERNAL_DEVICE_SRCS)
SRCS += $(MCU_PERIPH_SRCS)
SRCS += $(ACTUATORS_SRCS)
SRCS += $(RADIO_CONTROLLER_SRCS)
SRCS += $(COMMON_SRCS)
SRCS += $(CONTROLLER_SRCS)
SRCS += $(FREERTOS_SRCS)
SRCS += $(MAVLINK_SRCS)
SRCS += $(CMSIS_SRCS)
SRCS += $(STMF4_STD_DRIVER_SRCS)
SRCS += $(BASIC_SRCS)
Loading