8763b25839
- Remove CMSIS-RTOS v1 (cmsis_os.h/cmsis_os.c), add CMSIS-RTOS v2 (cmsis_os2.c/freertos_os2.h/mpool.h) - Update FreeRTOS kernel, port, and headers to match v2 integration - Remove unused heap implementations, keep heap_4 - Update CubeMX project config (.mxproject, .ioc, CMakeLists.txt) - Update FreeRTOSConfig.h, freertos.c, main.c, stm32h7xx_it.c - Update application modules (master_machine, dmmotor) - Add CMSIS-RTOS2 headers, mpu_syscall_numbers.h, newlib/picolibc support
158 lines
3.6 KiB
CMake
158 lines
3.6 KiB
CMake
cmake_minimum_required(VERSION 3.22)
|
|
|
|
#
|
|
# This file is generated only once,
|
|
# and is not re-generated if converter is called multiple times.
|
|
#
|
|
# User is free to modify the file as much as necessary
|
|
#
|
|
|
|
# Setup compiler settings
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
set(CMAKE_C_EXTENSIONS ON)
|
|
|
|
|
|
# Define the build type
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
|
endif()
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
add_compile_definitions(DISABLE_LOG_SYSTEM)
|
|
endif()
|
|
|
|
# Set the project name
|
|
set(CMAKE_PROJECT_NAME Basic_Framework_MC02)
|
|
|
|
# Enable compile command to ease indexing with e.g. clangd
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
|
|
|
|
# Core project settings
|
|
project(${CMAKE_PROJECT_NAME})
|
|
message("Build type: " ${CMAKE_BUILD_TYPE})
|
|
|
|
# Enable CMake support for ASM and C languages
|
|
enable_language(C ASM)
|
|
|
|
# Create an executable object type
|
|
add_executable(${CMAKE_PROJECT_NAME})
|
|
|
|
# Add STM32CubeMX generated sources
|
|
add_subdirectory(cmake/stm32cubemx)
|
|
|
|
# Link directories setup
|
|
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
|
Drivers/CMSIS/DSP/Lib/GCC
|
|
)
|
|
|
|
# Add sources to executable
|
|
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
|
|
# SEGGER RTT
|
|
Middlewares/Third_Party/SEGGER/RTT/SEGGER_RTT_printf.c
|
|
Middlewares/Third_Party/SEGGER/RTT/SEGGER_RTT.c
|
|
Middlewares/Third_Party/SEGGER/RTT/SEGGER_RTT_ASM_ARMv7M.s
|
|
|
|
# Core (CubeMX generated but not in stm32cubemx)
|
|
Core/Src/freertos.c
|
|
|
|
# bsp
|
|
bsp/dwt/bsp_dwt.c
|
|
bsp/pwm/bsp_pwm.c
|
|
bsp/gpio/bsp_gpio.c
|
|
bsp/spi/bsp_spi.c
|
|
bsp/iic/bsp_iic.c
|
|
bsp/can/bsp_can.c
|
|
bsp/usart/bsp_usart.c
|
|
bsp/log/bsp_log.c
|
|
bsp/bsp_tools.c
|
|
|
|
# modules - algorithm
|
|
modules/algorithm/controller.c
|
|
modules/algorithm/kalman_filter.c
|
|
modules/algorithm/QuaternionEKF.c
|
|
modules/algorithm/crc8.c
|
|
modules/algorithm/crc16.c
|
|
modules/algorithm/user_lib.c
|
|
# modules - sensors
|
|
modules/BMI088/bmi088.c
|
|
modules/imu/BMI088driver.c
|
|
modules/imu/BMI088Middleware.c
|
|
modules/imu/ins_task.c
|
|
# modules - communication
|
|
modules/master_machine/master_machine.c
|
|
modules/timachine/board_comm.c
|
|
# modules - motor
|
|
modules/motor/DMmotor/dmmotor.c
|
|
modules/motor/motor_task.c
|
|
# modules - system
|
|
modules/message_center/message_center.c
|
|
modules/daemon/daemon.c
|
|
modules/alarm/buzzer.c
|
|
modules/vofa/vofa.c
|
|
|
|
# application
|
|
application/gimbal/gimbal.c
|
|
application/cmd/robot_cmd.c
|
|
application/robot.c
|
|
)
|
|
|
|
# Add include paths
|
|
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
|
# FreeRTOS
|
|
Middlewares/Third_Party/FreeRTOS/Source/include
|
|
Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS
|
|
Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F
|
|
|
|
# SEGGER RTT
|
|
Middlewares/Third_Party/SEGGER/RTT
|
|
Middlewares/Third_Party/SEGGER/Config
|
|
|
|
# bsp
|
|
bsp/dwt
|
|
bsp/can
|
|
bsp/usart
|
|
bsp/gpio
|
|
bsp/spi
|
|
bsp/iic
|
|
bsp/log
|
|
bsp/pwm
|
|
bsp
|
|
|
|
# modules
|
|
modules/algorithm
|
|
modules/BMI088
|
|
modules/imu
|
|
modules/master_machine
|
|
modules/motor/DMmotor
|
|
modules/motor
|
|
modules/message_center
|
|
modules/daemon
|
|
modules/alarm
|
|
modules/vofa
|
|
modules/timachine
|
|
modules
|
|
|
|
# application
|
|
application/gimbal
|
|
application/cmd
|
|
application
|
|
)
|
|
|
|
# Add project symbols (macros)
|
|
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
|
|
ARM_MATH_CM7
|
|
)
|
|
|
|
# Remove wrong libob.a library dependency when using cpp files
|
|
list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_LIBRARIES ob)
|
|
|
|
# Add linked libraries
|
|
target_link_libraries(${CMAKE_PROJECT_NAME}
|
|
stm32cubemx
|
|
c
|
|
m
|
|
nosys
|
|
arm_cortexM7lfdp_math
|
|
)
|