Kristofer Jonsson | 43ce491 | 2020-11-20 09:42:53 +0100 | [diff] [blame^] | 1 | # |
| 2 | # Copyright (c) 2020 Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the License); you may |
| 7 | # not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # |
| 18 | |
| 19 | ############################################################################# |
| 20 | # Toolchain |
| 21 | ############################################################################# |
| 22 | |
| 23 | set(TARGET_CPU "cortex-m55") |
| 24 | |
| 25 | if (NOT CMAKE_TOOLCHAIN_FILE) |
| 26 | set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/toolchain/armclang.cmake") |
| 27 | endif() |
| 28 | |
| 29 | ############################################################################# |
| 30 | # Project |
| 31 | ############################################################################# |
| 32 | |
| 33 | cmake_minimum_required(VERSION 3.15.6) |
| 34 | |
| 35 | project(ethos-u-corstone-300 VERSION 0.0.1) |
| 36 | |
| 37 | include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/helpers.cmake) |
| 38 | |
| 39 | ############################################################################# |
| 40 | # Configuration |
| 41 | ############################################################################# |
| 42 | |
| 43 | set(ETHOS_U_CORE_SOFTWARE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../core_software" CACHE PATH "Path to Arm Ethos-U Core Software") |
| 44 | |
| 45 | ############################################################################# |
| 46 | # Core software |
| 47 | ############################################################################# |
| 48 | |
| 49 | set(CORE_SOFTWARE_RTOS "FreeRTOS" CACHE STRING "") |
| 50 | |
| 51 | add_subdirectory(${ETHOS_U_CORE_SOFTWARE_PATH} core_software) |
| 52 | |
| 53 | ############################################################################# |
| 54 | # Corstone-300 |
| 55 | ############################################################################# |
| 56 | |
| 57 | add_executable(ethosu_corstone_300) |
| 58 | |
| 59 | target_sources(ethosu_corstone_300 PRIVATE |
| 60 | main.cpp |
| 61 | retarget.c |
| 62 | uart.c) |
| 63 | |
| 64 | target_link_libraries(ethosu_corstone_300 PRIVATE |
| 65 | ethosu_core |
| 66 | $<TARGET_OBJECTS:cmsis_startup> |
| 67 | cmsis_device) |
| 68 | |
| 69 | add_dependencies(ethosu_corstone_300 cmsis_startup) |
| 70 | |
| 71 | target_link_options(ethosu_corstone_300 PRIVATE |
| 72 | --entry Reset_Handler) |
| 73 | |
| 74 | ethosu_link_options(ethosu_corstone_300 PRIVATE |
| 75 | LINK_FILE platform) |