Compare commits
No commits in common. "b55d737e8938c393caaee06705d2c67156f2a92a" and "23b5166c3223d01050472f8190f3875fc65eff16" have entirely different histories.
b55d737e89
...
23b5166c32
@ -1,14 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
|
||||||
|
|
||||||
set(TARGET_TRIPLET arm-none-eabi)
|
|
||||||
set(CMAKE_SYSTEM_NAME Generic)
|
|
||||||
|
|
||||||
set(BLACKBOARD_MACHINE_FLAGS "-mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard")
|
|
||||||
|
|
||||||
set(CMAKE_ASM_FLAGS_INIT "${BLACKBOARD_MACHINE_FLAGS}")
|
|
||||||
set(CMAKE_C_FLAGS_INIT "${BLACKBOARD_MACHINE_FLAGS}")
|
|
||||||
set(CMAKE_CXX_FLAGS_INIT "${BLACKBOARD_MACHINE_FLAGS}")
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "${BLACKBOARD_MACHINE_FLAGS} -ffreestanding -nostdlib -nostdlib++")
|
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/clang.cmake")
|
|
||||||
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
|
||||||
|
|
||||||
find_program(CMAKE_ASM_COMPILER clang)
|
|
||||||
find_program(CMAKE_C_COMPILER clang)
|
|
||||||
find_program(CMAKE_CXX_COMPILER clang++)
|
|
||||||
|
|
||||||
# Get host triplet, in case the target isn't set we'll use it as a default
|
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE HOST_TRIPLET)
|
|
||||||
message(STATUS "Host target triplet: ${HOST_TRIPLET}")
|
|
||||||
|
|
||||||
if(NOT TARGET_TRIPLET)
|
|
||||||
message(WARNING "TARGET_TRIPLET not set, defaulting to host system (${HOST_TRIPLET})")
|
|
||||||
set(TARGET_TRIPLET ${HOST_TRIPLET})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Get target processor from target triplet (first in triplet, ex. for arm-none-eabi -> arm)
|
|
||||||
string(REGEX MATCH "^[^-]*" TARGET_ARCHITECTURE ${TARGET_TRIPLET})
|
|
||||||
|
|
||||||
# We need to tell clang what our target is
|
|
||||||
set(CMAKE_ASM_COMPILER_TARGET ${TARGET_TRIPLET})
|
|
||||||
set(CMAKE_C_COMPILER_TARGET ${TARGET_TRIPLET})
|
|
||||||
set(CMAKE_CXX_COMPILER_TARGET ${TARGET_TRIPLET})
|
|
||||||
|
|
||||||
if(NOT CMAKE_SYSTEM_NAME)
|
|
||||||
# Cmake uses Generic as system name for embedded systems, use that here if
|
|
||||||
# working on embedded systems
|
|
||||||
message(WARNING "CMAKE_SYSTEM_NAME name not set, defaulting to host system name (${CMAKE_HOST_SYSTEM_NAME})")
|
|
||||||
set(CMAKE_SYSTEM_NAME ${CMAKE_HOST_SYSTEM_NAME})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT CMAKE_SYSTEM_VERSION)
|
|
||||||
set(CMAKE_SYSTEM_VERSION ${CMAKE_HOST_SYSTEM_VERSION})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT CMAKE_SYSTEM_PROCESSOR)
|
|
||||||
# Getting architecture from target triplet, should not be setting CMAKE_SYSTEM_PROCESSOR
|
|
||||||
set(CMAKE_SYSTEM_PROCESSOR ${TARGET_ARCHITECTURE})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
message(STATUS "Target: ${TARGET_TRIPLET}")
|
|
||||||
message(STATUS "Target system name: ${CMAKE_SYSTEM_NAME}")
|
|
||||||
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
.text
|
.text
|
||||||
.global _start
|
.global main
|
||||||
|
|
||||||
@define constants, these can be used as symbols in your code
|
@define constants, these can be used as symbols in your code
|
||||||
.equ LED_CTL, 0x41210000
|
.equ LED_CTL, 0x41210000
|
||||||
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
@the set and equ directives are equivalent and can be used interchangeably
|
@the set and equ directives are equivalent and can be used interchangeably
|
||||||
|
|
||||||
_start:
|
main:
|
||||||
ldr r1,=SW_DATA @load switch address from constant
|
ldr r1,=SW_DATA @load switch address from constant
|
||||||
ldr r2,=LED_CTL @load LED address from constant
|
ldr r2,=LED_CTL @load LED address from constant
|
||||||
loop:
|
loop:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user