# This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. cmake_minimum_required(VERSION 3.20.0) set(BOARD "native_sim/native/64") set(ZEPHYR_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/modules/hal/cmsis" "${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/modules/hal/stm32" "${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/modules/crypto/mbedtls" "${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/bootloader/mcuboot" ) string(REPLACE ";" "," ZEPHYR_MODULES_COMMA "${ZEPHYR_MODULES}") include(ExternalProject) ExternalProject_Add( bootloader PREFIX bootloader SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/bootloader/mcuboot/boot/zephyr" BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/bootloader" INSTALL_COMMAND "" LIST_SEPARATOR "," CMAKE_ARGS "-DBOARD=nucleo_f767zi" "-DZEPHYR_MODULES=${ZEPHYR_MODULES_COMMA}" "-DEXTRA_CONF_FILE=${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/bootloader/bootloader.conf" -DCONFIG_BOOT_SIGNATURE_KEY_FILE="${KEY}" ) find_package(Zephyr REQUIRED HINTS "${CMAKE_CURRENT_SOURCE_DIR}/zephyrproject/zephyr" ) project(iot-contact-fw) target_sources(app PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/syslog.c" "${CMAKE_CURRENT_SOURCE_DIR}/src/network.c" "${CMAKE_CURRENT_SOURCE_DIR}/src/http.c" "${CMAKE_CURRENT_SOURCE_DIR}/src/ws.c" "${CMAKE_CURRENT_SOURCE_DIR}/src/heart.c" ) zephyr_linker_sources(SECTIONS sections-rom.ld) zephyr_linker_section(NAME http_resource_desc_http_service KVMA RAM_REGION GROUP RODATA_REGION SUBALIGN ${CONFIG_LINKER_ITERABLE_SUBALIGN}) generate_inc_file_for_target( app src/index.html ${ZEPHYR_BINARY_DIR}/include/generated/index.html.gz.inc --gzip ) generate_inc_file_for_target( app src/iot-contact.js ${ZEPHYR_BINARY_DIR}/include/generated/iot-contact.js.gz.inc --gzip )