Skip to content

Commit

Permalink
Migrate to Mbed CE
Browse files Browse the repository at this point in the history
1.  Common change for migration to Mbed CE from Mbed CLI 1/2
    (1) Remove *.lib originally for library import. Replace with git submodule.
    (2) Rename mbed_app.json/mbed_lib.json to mbed_app.json5/mbed_lib.json5
    (3) Add/update CMakeLists.txt
    (4) Remove .mbedignore originally for Mbed CLI 1
    (5) Update document
2.  Support VS Code development
3.  Temporary fix to build profile inconsistent with mbed-lora library build
    See: mbed-ce/mbed-os#407
  • Loading branch information
ccli8 committed Jan 10, 2025
1 parent 62497c8 commit 9350b97
Show file tree
Hide file tree
Showing 8 changed files with 215 additions and 213 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.build
.mbed
projectfiles
*.py*
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cmake.buildDirectory": "${workspaceFolder}/build",
"cmake.generator": "Ninja",
"cmake.configureOnOpen": false
}
65 changes: 65 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright (c) 2022 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.19)
cmake_policy(VERSION 3.19)

set(MBED_OS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "")

# Set default path for mbed_app.json5 (no force-write for override)
set(MBED_APP_JSON_PATH mbed_app.json5 CACHE INTERNAL "")

# Set default path for custom_targets.json5 (no force-write for override)
set(CUSTOM_TARGETS_PATH custom_targets CACHE INTERNAL "")
set(CUSTOM_TARGETS_JSON_PATH ${CUSTOM_TARGETS_PATH}/custom_targets.json5 CACHE INTERNAL "")

# Load Mbed CE toolchain file and basic build system
include(${MBED_OS_PATH}/tools/cmake/app.cmake)

set(APP_PROJECT NUMAKER_MBED_CE_LORAWAN_EXAMPLE)
set(APP_TARGET NuMaker-mbed-ce-lorawan-example)

# Set up project name
project(${APP_PROJECT})

# Add Nuvoton CMake list files to CMake default module path
#
# Normally, this is added in ${MBED_OS_PATH}, but ${CUSTOM_TARGETS_PATH}
# is in front and needs it.
list(APPEND CMAKE_MODULE_PATH
${MBED_OS_PATH}/targets/TARGET_NUVOTON/scripts
)

# Add Mbed OS library
add_subdirectory(${MBED_OS_PATH})

# User-provided MBEDTLS_USER_CONFIG_FILE for mbedtls
target_include_directories(mbed-mbedtls
PUBLIC
.
)

add_executable(${APP_TARGET})

target_include_directories(${APP_TARGET}
PRIVATE
.
)

target_sources(${APP_TARGET}
PRIVATE
main.cpp
trace_helper.cpp
)

target_link_libraries(${APP_TARGET}
PRIVATE
mbed-os
mbed-lorawan
)

# Must call this for each target to set up bin file creation, code upload, etc
mbed_set_post_build(${APP_TARGET})

# Make sure this is the last line of the top-level build script
mbed_finalize_build()
158 changes: 0 additions & 158 deletions Jenkinsfile

This file was deleted.

Loading

0 comments on commit 9350b97

Please sign in to comment.