diff --git a/notes.md b/notes.md index 6716e68..2c8d816 100644 --- a/notes.md +++ b/notes.md @@ -22,7 +22,8 @@ build an flashable binary that blinks an led correctly on my development board. - [X] Remove RTOS stuff -- [ ] Remove CMSIS stuff -- [ ] Remove Unity test framework stuff. -- [ ] Remove HAL stuff. +- [X] Remove CMSIS stuff +- [X] Remove Unity test framework stuff. +- [X] Remove HAL stuff. +- [ ] Check through debuging flags in toolchain file. diff --git a/stm32-toolchain.cmake b/stm32-toolchain.cmake index 955ec75..bcdbda9 100644 --- a/stm32-toolchain.cmake +++ b/stm32-toolchain.cmake @@ -50,22 +50,6 @@ set(LINKER_SCRIPT linker.ld) #set(PROGRAMMER serialupdi) #set(PORT /dev/ttyU0) -#------------------- -# HAL Setup -#------------------- -# Select 1 if STM32 HAL library is to be used. This will add -DUSE_HAL_DRIVER=1 to the CFLAGS -# If enabled then set the correct path of the HAL Driver folder -#set(USE_HAL = 1 -#ifeq (1,$(USE_HAL)) -set(HAL_DIR components/STM32F4xx_HAL_Driver) -#endif - -#------------------- -# CMSIS Setup -#------------------- -# Set the path to the CMSIS folder -#set(CMSIS_DIR components/CMSIS/CMSIS) - ################################################## # Advanced Section ################################################## @@ -105,6 +89,10 @@ set(CMAKE_EXE_LINKER_FLAGS " \ #------------------ # Debug Flags #------------------ + +# "-Og":: Optimizes for debugging expirence. +# "-g":: Debugging options +# "-gdwarf-3":: set(CMAKE_C_FLAGS_DEBUG "-Og -g -gdwarf-3 -gstrict-dwarf " CACHE INTERNAL "C Compiler options for debug build type") set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -gdwarf-3 -gstrict-dwarf " CACHE INTERNAL "C++ Compiler options for debug build type") set(CMAKE_ASM_FLAGS_DEBUG "-Og -g -gdwarf-3 -gstrict-dwarf " CACHE INTERNAL "ASM Compiler options for debug build type") @@ -225,29 +213,6 @@ if(TARGET_GROUP STREQUAL production) # @Brief: Build the actual elf file of the project ###################################################################### - #------------------- - # HAL library - #------------------- - file(GLOB HAL_SRC - "${HAL_DIR}/Src/*.c" - ) - add_library(hal STATIC - ${HAL_SRC} - ) - target_include_directories(hal - PUBLIC - ${HAL_DIR}/Inc - ${MCU_DIR}/Include - #${CMSIS_DIR}/Core/Include - PRIVATE - ${PROJECT_SOURCE_DIR}/include - ) - target_compile_definitions(hal - PUBLIC - ${MCU} - HSE_VALUE=${HSE_VAL} - ) - #------------------- # Main elf #------------------- @@ -332,29 +297,6 @@ if(TARGET_GROUP STREQUAL production) "${CMAKE_CURRENT_BINARY_DIR}/html" "${CMAKE_CURRENT_BINARY_DIR}/latex" ) - -elseif(TARGET_GROUP STREQUAL test) - - add_library(unity STATIC - components/unity/unity.c - ) - - target_include_directories(unity PUBLIC - components/unity/ - ) - - enable_testing() - include(CTest) - add_subdirectory(test) - - set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) - include(CodeCoverage) - setup_target_for_coverage_lcov( - NAME coverage - EXCLUDE "/usr/include/x86_64-linux-gnu/*" "components/unity/*" - EXECUTABLE ctest -V - DEPENDENCIES simple_module - ) else() message(FATAL_ERROR "Given TARGET_GROUP unknown") endif()