diff --git a/low_level_platform/api/CMakeLists.txt b/low_level_platform/api/CMakeLists.txt index b143b9a1f..4092f6411 100644 --- a/low_level_platform/api/CMakeLists.txt +++ b/low_level_platform/api/CMakeLists.txt @@ -14,41 +14,8 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Rp2040") target_link_libraries(lf-low-level-platform-api INTERFACE pico_stdlib) target_link_libraries(lf-low-level-platform-api INTERFACE pico_multicore) target_link_libraries(lf-low-level-platform-api INTERFACE pico_sync) -elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Stm32") - if(DEFINED ENV{STM_SDK_DIR}) - message(STATUS "STM_SDK_DIR is set to $ENV{STM_SDK_DIR}") - else() - message(FATAL_ERROR "The STM_SDK_DIR environment variable must be set to point to the directory generated by CUBEMX for you project.") - endif() - set(STM_SDK_DIR $ENV{STM_SDK_DIR}) - set(MCU_FAMILY STM32F4xx) - set(MCU_MODEL STM32F446xx) - set(CPU_PARAMETERS -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp) - - file(GLOB_RECURSE STM32CUBEMX_SOURCES ${STM_DIR}/Core/*.c ${STM_DIR}/Drivers/${MCU_FAMILY}_HAL_Driver/*.c) - set(CUBEMX_INCLUDE_DIRECTORIES - ${STM_DIR}/Core/Inc - ${STM_DIR}/Drivers/${MCU_FAMILY}_HAL_Driver/Inc - ${STM_DIR}/Drivers/CMSIS/Device/ST/${MCU_FAMILY}/Include - ${STM_DIR}/Drivers/CMSIS/Include - ) - target_compile_options(lf-low-level-platform-api INTERFACE - ${CPU_PARAMETERS} - -Wall - -Wextra - -Wpedantic - -Wno-unused-parameter - $<$: - -Wno-volatile - -Wold-style-cast - -Wuseless-cast - -Wsuggest-override> - $<$:-Og -g3 -ggdb> - $<$:-Og -g0>) - +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "STM32F4") target_compile_definitions(lf-low-level-platform-api INTERFACE PLATFORM_STM32F4) - target_include_directories(lf-low-level-platform-api INTERFACE ${CUBEMX_INCLUDE_DIRECTORIES}) - target_compile_definitions(lf-low-level-platform-api INTERFACE ${MCU_MODEL} USE_HAL_DRIVER) elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FlexPRET") target_compile_definitions(lf-low-level-platform-api INTERFACE PLATFORM_FLEXPRET) target_link_libraries(lf-low-level-platform-api INTERFACE fp-sdk) diff --git a/low_level_platform/api/platform/lf_STM32f4_support.h b/low_level_platform/api/platform/lf_STM32f4_support.h index 061fbe449..19ff2cfa7 100644 --- a/low_level_platform/api/platform/lf_STM32f4_support.h +++ b/low_level_platform/api/platform/lf_STM32f4_support.h @@ -11,7 +11,6 @@ #define PRINTF_TIME "%lld" #define PRINTF_MICROSTEP "%d" -#define LF_TIME_BUFFER_LENGTH 80 #define _LF_TIMEOUT 1 #ifdef LF_THREADED diff --git a/low_level_platform/impl/CMakeLists.txt b/low_level_platform/impl/CMakeLists.txt index 01d76d66e..32cd760c2 100644 --- a/low_level_platform/impl/CMakeLists.txt +++ b/low_level_platform/impl/CMakeLists.txt @@ -39,7 +39,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Rp2040") ${CMAKE_CURRENT_LIST_DIR}/src/lf_rp2040_support.c ${CMAKE_CURRENT_LIST_DIR}/src/lf_atomic_irq.c ) -elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Stm32") +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "STM32F4") set(LF_LOW_LEVEL_PLATFORM_FILES ${CMAKE_CURRENT_LIST_DIR}/src/lf_STM32f4_support.c ${CMAKE_CURRENT_LIST_DIR}/src/lf_atomic_irq.c @@ -55,7 +55,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Patmos") ${CMAKE_CURRENT_LIST_DIR}/src/lf_atomic_irq.c ) else() - message(FATAL_ERROR "Your platform is not supported! The C target supports FlexPRET, Patmos, Linux, MacOS, nRF52, RP2040, Windows, and Zephyr.") + message(FATAL_ERROR "Your platform is not supported! The C target supports FlexPRET, Patmos, Linux, MacOS, nRF52, RP2040, STM32F4, Windows, and Zephyr.") endif() list(APPEND LF_LOW_LEVEL_PLATFORM_FILES ${CMAKE_CURRENT_LIST_DIR}/src/lf_platform_util.c)