Updated readme, etc.

This commit is contained in:
PProvost
2020-05-13 11:47:56 -06:00
parent 9f648c4e54
commit 40081863d5
8 changed files with 182 additions and 1 deletions

29
cmake/arm-none-eabi.cmake Normal file
View File

@@ -0,0 +1,29 @@
# Toolchain settings
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(AS arm-none-eabi-as)
set(AR arm-none-eabi-ar)
set(OBJCOPY arm-none-eabi-objcopy)
set(OBJDUMP arm-none-eabi-objdump)
set(SIZE arm-none-eabi-size)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# this makes the test compiles use static library option so that we don't need to pre-set linker flags and scripts
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
set(CMAKE_C_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} ${SPEC_FLAGS} -fdata-sections -ffunction-sections -mlong-calls" CACHE INTERNAL "c compiler flags")
set(CMAKE_CXX_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} -fdata-sections -ffunction-sections -fno-rtti -fno-exceptions -mlong-calls" CACHE INTERNAL "cxx compiler flags")
set(CMAKE_ASM_FLAGS "${MCPU_FLAGS} -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags")
set(CMAKE_EXE_LINKER_FLAGS "${MCPU_FLAGS} ${LD_FLAGS} -Wl,--gc-sections" CACHE INTERNAL "exe link flags")
SET(CMAKE_C_FLAGS_DEBUG "-Og -g -ggdb3" CACHE INTERNAL "c debug compiler flags")
SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g -ggdb3" CACHE INTERNAL "cxx debug compiler flags")
SET(CMAKE_ASM_FLAGS_DEBUG "-g -ggdb3" CACHE INTERNAL "asm debug compiler flags")
SET(CMAKE_C_FLAGS_RELEASE "-O3" CACHE INTERNAL "c release compiler flags")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE INTERNAL "cxx release compiler flags")
SET(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm release compiler flags")

13
cmake/cortex_m0.cmake Normal file
View File

@@ -0,0 +1,13 @@
# Name of the target
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
set(THREADX_ARCH "cortex_m0")
set(THREADX_TOOLCHAIN "gnu")
set(MCPU_FLAGS "-mthumb -mcpu=cortex-m0")
set(VFP_FLAGS "")
set(SPEC_FLAGS "--specs=nosys.specs")
# set(LD_FLAGS "-nostartfiles")
include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake)

13
cmake/cortex_m3.cmake Normal file
View File

@@ -0,0 +1,13 @@
# Name of the target
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
set(THREADX_ARCH "cortex_m3")
set(THREADX_TOOLCHAIN "gnu")
set(MCPU_FLAGS "-mthumb -mcpu=cortex-m3")
set(VFP_FLAGS "")
set(SPEC_FLAGS "--specs=nosys.specs")
# set(LD_FLAGS "-nostartfiles")
include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake)

13
cmake/cortex_m4.cmake Normal file
View File

@@ -0,0 +1,13 @@
# Name of the target
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
set(THREADX_ARCH "cortex_m4")
set(THREADX_TOOLCHAIN "gnu")
set(MCPU_FLAGS "-mthumb -mcpu=cortex-m4")
set(VFP_FLAGS "")
set(SPEC_FLAGS "--specs=nosys.specs")
# set(LD_FLAGS "-nostartfiles")
include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake)

13
cmake/cortex_m7.cmake Normal file
View File

@@ -0,0 +1,13 @@
# Name of the target
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR cortex-m7)
set(THREADX_ARCH "cortex_m7")
set(THREADX_TOOLCHAIN "gnu")
set(MCPU_FLAGS "-mthumb -mcpu=cortex-m7")
set(VFP_FLAGS "")
set(SPEC_FLAGS "--specs=nosys.specs")
# set(LD_FLAGS "-nostartfiles")
include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake)

15
cmake/utilities.cmake Normal file
View File

@@ -0,0 +1,15 @@
# Add the required subdirectory and register it for linkage
function(add_azrtos_component_dir dirname)
# Store the current list in a temp
set(tmp ${azrtos_targets})
# Add the subdir
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/lib/${dirname})
# If there is a linker script defined, use it
if(EXISTS ${LINKER_SCRIPT})
target_link_options(${dirname} INTERFACE -T ${LINKER_SCRIPT})
endif()
# Add this target into the temp
list(APPEND tmp "azrtos::${dirname}")
# Copy the temp back up to the parent list
set(azrtos_targets ${tmp} PARENT_SCOPE)
endfunction()