From 83ec6fa500b688d9a92cab9d2666781c816b8b1e Mon Sep 17 00:00:00 2001 From: Jan Kamidra Date: Sun, 18 Feb 2024 23:58:30 +0100 Subject: [PATCH 01/13] json to json5 --- custom_targets.json => custom_targets/custom_targets.json5 | 0 mbed_app.json => mbed_app.json5 | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename custom_targets.json => custom_targets/custom_targets.json5 (100%) rename mbed_app.json => mbed_app.json5 (100%) diff --git a/custom_targets.json b/custom_targets/custom_targets.json5 similarity index 100% rename from custom_targets.json rename to custom_targets/custom_targets.json5 diff --git a/mbed_app.json b/mbed_app.json5 similarity index 100% rename from mbed_app.json rename to mbed_app.json5 From a8f6de398b600b8f47c04ea576efeb3d4ffa6b84 Mon Sep 17 00:00:00 2001 From: Jan Kamidra Date: Sun, 18 Feb 2024 23:59:01 +0100 Subject: [PATCH 02/13] add new files --- cmake-variants.yaml | 23 +++++++++++++++++++ .../L452RE_CUSTOM_CLOCK.cmake | 12 ++++++++++ .../L452RE_CUSTOM_PINMAP.cmake | 13 +++++++++++ main.cpp | 11 +++++++++ 4 files changed, 59 insertions(+) create mode 100644 cmake-variants.yaml create mode 100644 custom_targets/upload_method_cfg/L452RE_CUSTOM_CLOCK.cmake create mode 100644 custom_targets/upload_method_cfg/L452RE_CUSTOM_PINMAP.cmake create mode 100644 main.cpp diff --git a/cmake-variants.yaml b/cmake-variants.yaml new file mode 100644 index 0000000..8cf8f71 --- /dev/null +++ b/cmake-variants.yaml @@ -0,0 +1,23 @@ +buildType: + default: Develop + choices: + Develop: + short: Develop + long: Emit debug information but also optimize + buildType: Develop + Debug: + short: Debug + long: Emit debug information and don't optimize + buildType: Debug + Release: + short: Release + long: Optimize generated code + buildType: Release +board: + default: L452RE_CUSTOM_PINMAP + choices: + YOUR_MBED_TARGET: + short: L452RE_CUSTOM_PINMAP + settings: + MBED_TARGET: L452RE_CUSTOM_PINMAP ## One name of targer in custom_targets.json5 file + UPLOAD_METHOD: STM32CUBE ## NONE, MBED, STLINK, JLINK, PYOCD, OPENOCD, STM32CUBE \ No newline at end of file diff --git a/custom_targets/upload_method_cfg/L452RE_CUSTOM_CLOCK.cmake b/custom_targets/upload_method_cfg/L452RE_CUSTOM_CLOCK.cmake new file mode 100644 index 0000000..b4c3c3c --- /dev/null +++ b/custom_targets/upload_method_cfg/L452RE_CUSTOM_CLOCK.cmake @@ -0,0 +1,12 @@ +## Example of custom uploud method for L452RE_CUSTOM_CLOCK + + +# General config parameters +# ------------------------------------------------------------- +set(UPLOAD_METHOD_DEFAULT OPENOCD) + +# Config options for OPENOCD +# ------------------------------------------------------------- +set(OPENOCD_UPLOAD_ENABLED TRUE) +set(OPENOCD_CHIP_CONFIG_COMMANDS + -f ${CMAKE_CURRENT_LIST_DIR}/openocd_cfgs/stm32l452re.cfg) \ No newline at end of file diff --git a/custom_targets/upload_method_cfg/L452RE_CUSTOM_PINMAP.cmake b/custom_targets/upload_method_cfg/L452RE_CUSTOM_PINMAP.cmake new file mode 100644 index 0000000..c05f101 --- /dev/null +++ b/custom_targets/upload_method_cfg/L452RE_CUSTOM_PINMAP.cmake @@ -0,0 +1,13 @@ +## Example of custom uploud method for L452RE_CUSTOM_PINMAP + + +# General config parameters +# ------------------------------------------------------------- +set(UPLOAD_METHOD_DEFAULT STM32CUBE) + +# Config options for STM32Cube +# ------------------------------------------------------------- + +set(STM32CUBE_UPLOAD_ENABLED TRUE) +set(STM32CUBE_CONNECT_COMMAND -c port=SWD reset=HWrst) +set(STM32CUBE_GDBSERVER_ARGS --swd) \ No newline at end of file diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..1545687 --- /dev/null +++ b/main.cpp @@ -0,0 +1,11 @@ +#include "mbed.h" + +DigitalOut led(LED1); // fill your pin + +int main(){ + printf("mbed-ce-custom-targets\n"); + while(1){ + led = !led; + thread_sleep_for(500); + } +} \ No newline at end of file From cf6f222a45b535cdc53f3e9dc4eaa47bab3d0449 Mon Sep 17 00:00:00 2001 From: Jan Kamidra Date: Sun, 18 Feb 2024 23:59:15 +0100 Subject: [PATCH 03/13] mbed-os update --- mbed-os | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mbed-os b/mbed-os index eda766e..e6a63d9 160000 --- a/mbed-os +++ b/mbed-os @@ -1 +1 @@ -Subproject commit eda766ec8f224ab93cfdb5fc96e0fead1931fedf +Subproject commit e6a63d96234ddae3916e3e8811144d070f9473f9 From 5c61f59c27bcf48da2fac2787806f9b1d220b184 Mon Sep 17 00:00:00 2001 From: Jan Kamidra Date: Mon, 19 Feb 2024 00:00:01 +0100 Subject: [PATCH 04/13] Modified and updated --- CMakeLists.txt | 72 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78dddff..72c9f83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,21 +1,79 @@ cmake_minimum_required(VERSION 3.19) cmake_policy(VERSION 3.19) -# Initialize Mbed OS build system. -# Note: This block must be before the include of app.cmake -set(MBED_APP_JSON_PATH mbed_app.json) -set(CUSTOM_TARGETS_JSON_PATH custom_targets.json) # This activates the custom targets in custom_targets.json +#### Initialize Mbed OS build system. #### +###################################################################################################### +### Block of including .json files. Files of this block must be included before the app.cmake +#[[ Set path of mbed_app.json (necessary everytime if mbed_app.json is in project) ]] +set(MBED_APP_JSON_PATH mbed_app.json5) + +###--------------------------------------------------------------------------------------------------- +#[[ This part is intended to custom targets and activates the custom_targets.json +and upload method config otherwise functions below should be commented ]] + +#[[ Here set path for custom_targets.json (this is our default) ]] + set(CUSTOM_TARGETS_JSON_PATH custom_targets/custom_targets.json5) + + #[[ Note: For custom target you need also an upload method and we have few options how you can do that + - use the variable CUSTOM_UPLOAD_CFG_PATH below + - use default expected path for custom targets upload methods where you create your own config + MY_PROJECT/custom_targets/upload_method_cfg + + For regular targets we have note you an check for an insperation + https://github.com/mbed-ce/mbed-os/tree/master/targets/upload_method_cfg ]] + +#[[ Here you can set path for custom upload config .cmake (optional example) ]] +# set(CUSTOM_UPLOAD_CFG_PATH ${CMAKE_SOURCE_DIR}/${MBED_TARGET}/${MBED_TARGET}.cmake) + +### End of block +###################################################################################################### + +### include app.cmake (necessary everytime) ### include(mbed-os/tools/cmake/app.cmake) -# Include folder with the custom targets. -# This needs to be done before add_subdirectory(mbed-os). +###################################################################################################### +### Block of including project folders + +#[[ In case of custom targets must be the folder included before mbed-os subdirectory +otherwise should be the next line commented]] add_subdirectory(custom_targets) +###-------------------------------------------------------------------------------------------------- +## Add mbed-os subdirectory (necessary everytime) add_subdirectory(mbed-os) +###-------------------------------------------------------------------------------------------------- +## Add another subdirectory, for example subdirectory of a library (if needed) +#add_subdirectory(YourLibrary) + +### End of block +###################################################################################################### + +### Set up your project name (necessary everytime) project(mbed-ce-custom-targets) -# add subdirectories and build targets here +### add executable (necessary everytime) +add_executable(main main.cpp) + +###################################################################################################### +### Link libraries block + +#[[For more about this configuraion visit wiki page +https://github.com/mbed-ce/mbed-os/wiki/MbedOS-configuration#configuration-via-cmake-files]] + +#[[link MbedOS and its libraries (necessary everytime)]] +target_link_libraries(main mbed-os) + +### link user library (if needed) +#target_link_libraries(main YourLibrary) + +### End of block +###################################################################################################### + +### Set post build (necessary everytime) +mbed_set_post_build(main) + +### Build finalize does necessary configuration for debug in most cases (necessary everytime) mbed_finalize_build() \ No newline at end of file From b420603806f5a7a86488545969e21ee058b75da0 Mon Sep 17 00:00:00 2001 From: Jan Kamidra Date: Mon, 19 Feb 2024 23:02:32 +0100 Subject: [PATCH 05/13] add up for simple --- .../upload_method_cfg/L452RE_SIMPLE.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 custom_targets/upload_method_cfg/L452RE_SIMPLE.cmake diff --git a/custom_targets/upload_method_cfg/L452RE_SIMPLE.cmake b/custom_targets/upload_method_cfg/L452RE_SIMPLE.cmake new file mode 100644 index 0000000..7ad6fb2 --- /dev/null +++ b/custom_targets/upload_method_cfg/L452RE_SIMPLE.cmake @@ -0,0 +1,13 @@ +## Example of custom uploud method for L452RE_SIMPLE + + +# General config parameters +# ------------------------------------------------------------- +set(UPLOAD_METHOD_DEFAULT STM32CUBE) + +# Config options for STM32Cube +# ------------------------------------------------------------- + +set(STM32CUBE_UPLOAD_ENABLED TRUE) +set(STM32CUBE_CONNECT_COMMAND -c port=SWD reset=HWrst) +set(STM32CUBE_GDBSERVER_ARGS --swd) \ No newline at end of file From 731bdc594cc009e672a2e589f4f66adc0f75b2ef Mon Sep 17 00:00:00 2001 From: Jan Kamidra Date: Mon, 19 Feb 2024 23:02:42 +0100 Subject: [PATCH 06/13] update --- CMakeLists.txt | 24 +++++++++++------------- README.md | 8 +++++--- cmake-variants.yaml | 12 ++++++++---- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72c9f83..449097b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,28 +3,28 @@ cmake_policy(VERSION 3.19) #### Initialize Mbed OS build system. #### ###################################################################################################### -### Block of including .json files. Files of this block must be included before the app.cmake +### Block of including .json5 files. Files of this block must be included before the app.cmake -#[[ Set path of mbed_app.json (necessary everytime if mbed_app.json is in project) ]] +#[[ Set path of mbed_app.json (necessary everytime if mbed_app.json5 is in project) ]] set(MBED_APP_JSON_PATH mbed_app.json5) ###--------------------------------------------------------------------------------------------------- -#[[ This part is intended to custom targets and activates the custom_targets.json +#[[ This part is intended to custom targets5 and activates the custom_targets.json5 and upload method config otherwise functions below should be commented ]] -#[[ Here set path for custom_targets.json (this is our default) ]] +#[[ Here set path for custom_targets.json5 (this is our default) ]] set(CUSTOM_TARGETS_JSON_PATH custom_targets/custom_targets.json5) - #[[ Note: For custom target you need also an upload method and we have few options how you can do that +#[[ Here you can set path for custom upload config .cmake (optional example) ]] +# set(CUSTOM_UPLOAD_CFG_PATH ${CMAKE_SOURCE_DIR}/${MBED_TARGET}/${MBED_TARGET}.cmake) + +#[[ Note: For custom target you need also an upload method and we have few options how you can do that - use the variable CUSTOM_UPLOAD_CFG_PATH below - use default expected path for custom targets upload methods where you create your own config MY_PROJECT/custom_targets/upload_method_cfg + - of course you can do it by your self dierectly via cmake in this file - For regular targets we have note you an check for an insperation - https://github.com/mbed-ce/mbed-os/tree/master/targets/upload_method_cfg ]] - -#[[ Here you can set path for custom upload config .cmake (optional example) ]] -# set(CUSTOM_UPLOAD_CFG_PATH ${CMAKE_SOURCE_DIR}/${MBED_TARGET}/${MBED_TARGET}.cmake) + For regular targets we use mbed-os/tree/master/targets/upload_method_cfg ]] ### End of block ###################################################################################################### @@ -59,9 +59,7 @@ add_executable(main main.cpp) ###################################################################################################### ### Link libraries block - -#[[For more about this configuraion visit wiki page -https://github.com/mbed-ce/mbed-os/wiki/MbedOS-configuration#configuration-via-cmake-files]] +#[[For more about this configuraion visit wiki page MbedOS-configuration ]] #[[link MbedOS and its libraries (necessary everytime)]] target_link_libraries(main mbed-os) diff --git a/README.md b/README.md index 99b9dca..017aab4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Mbed CE Custom Targets Example -This project shows how to use Mbed OS Community Edition to create custom targets. +This project shows how to use Mbed OS Community Edition to create custom targets and also defines the standard structure of custom target project from Mbed CE perspective. This repo includes three different custom targets you can use based on the `NUCLEO_L452RE_P` target. (No real reason it's this target in particular, it's just a board I happen to use). @@ -10,9 +10,11 @@ This repo includes three different custom targets you can use based on the `NUCL ## How to set up this project: -1. Clone it to your machine. Don't forget to use `--recursive` to clone the submodules: `git clone --recursive https://github.com/mbed-ce/mbed-ce-custom-targets.git` +1. Clone it to your machine. Don't forget to use `--recursive` to clone the submodules: `git clone --recursive https://github.com/mbed-ce/mbed-ce-custom-targets.git`and update MbedOS with `git submodule update --remote mbed-os` (call it in project folder) 2. Set up the GNU ARM toolchain (and other programs) on your machine using [the toolchain setup guide](https://github.com/mbed-ce/mbed-os/wiki/Toolchain-Setup-Guide). -3. Set up the CMake project for editing. Use one of the target names listed above. We have three ways to do this: +3. Set up the CMake project for editing. We have three ways to do this: - On the [command line](https://github.com/mbed-ce/mbed-os/wiki/Project-Setup:-Command-Line) - Using the [CLion IDE](https://github.com/mbed-ce/mbed-os/wiki/Project-Setup:-CLion) - Using the [VS Code IDE](https://github.com/mbed-ce/mbed-os/wiki/Project-Setup:-VS-Code) +4. Use one of the target names listed above and choose an [upload method](https://github.com/mbed-ce/mbed-os/wiki/Upload-Methods) according to your requirments. Default settings is target L452RE_SIMPLE and upload method STM32CUBE. + diff --git a/cmake-variants.yaml b/cmake-variants.yaml index 8cf8f71..e93f8ff 100644 --- a/cmake-variants.yaml +++ b/cmake-variants.yaml @@ -14,10 +14,14 @@ buildType: long: Optimize generated code buildType: Release board: - default: L452RE_CUSTOM_PINMAP + # Fill name of your targer which has to corespond to + # target name in custom_targets.json5 file + default: L452RE_SIMPLE choices: YOUR_MBED_TARGET: - short: L452RE_CUSTOM_PINMAP + short: L452RE_SIMPLE settings: - MBED_TARGET: L452RE_CUSTOM_PINMAP ## One name of targer in custom_targets.json5 file - UPLOAD_METHOD: STM32CUBE ## NONE, MBED, STLINK, JLINK, PYOCD, OPENOCD, STM32CUBE \ No newline at end of file + MBED_TARGET: L452RE_SIMPLE + # Fill your upload method + # variants are: NONE, MBED, STLINK, JLINK, PYOCD, OPENOCD, STM32CUBE + UPLOAD_METHOD: STM32CUBE \ No newline at end of file From 16f9207ca80abecdd9420d883c346018f215184c Mon Sep 17 00:00:00 2001 From: JohnK1987 Date: Wed, 21 Feb 2024 06:26:17 +0100 Subject: [PATCH 07/13] Update compile.yml --- .github/workflows/compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 99a9ce8..d95aa7d 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -30,5 +30,5 @@ jobs: - name: Build project for ${{ matrix.mbed_target }} run: | mkdir build && cd build - cmake .. -GNinja -DMBED_TARGET=${{ matrix.mbed_target }} + cmake .. -GNinja -DMBED_TARGET=NONE ninja mbed-os # need to build mbed-os explicitly, or it will not be compiled because there are no executables that use it. From 742ede19ed4e81ccb84cbcd7d76f05a1ddacac32 Mon Sep 17 00:00:00 2001 From: JohnK1987 Date: Wed, 21 Feb 2024 06:35:55 +0100 Subject: [PATCH 08/13] Update compile.yml --- .github/workflows/compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index d95aa7d..74790a3 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -30,5 +30,5 @@ jobs: - name: Build project for ${{ matrix.mbed_target }} run: | mkdir build && cd build - cmake .. -GNinja -DMBED_TARGET=NONE + cmake .. -GNinja -DUPLOAD_METHOD=NONE -DMBED_TARGET=${{ matrix.mbed_target }} ninja mbed-os # need to build mbed-os explicitly, or it will not be compiled because there are no executables that use it. From 49ed86b88f4a427464a8bb5385bf0b114cee56f8 Mon Sep 17 00:00:00 2001 From: JohnK1987 Date: Fri, 1 Mar 2024 09:53:12 +0100 Subject: [PATCH 09/13] Update CMakeLists.txt --- CMakeLists.txt | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 449097b..d9e3c6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,8 @@ cmake_policy(VERSION 3.19) set(MBED_APP_JSON_PATH mbed_app.json5) ###--------------------------------------------------------------------------------------------------- -#[[ This part is intended to custom targets5 and activates the custom_targets.json5 -and upload method config otherwise functions below should be commented ]] +#[[ This part is dedicated for custom targets only! Settings below activate targets from + custom_targets.json5 and upload method config, otherwise functions below should be commented. ]] #[[ Here set path for custom_targets.json5 (this is our default) ]] set(CUSTOM_TARGETS_JSON_PATH custom_targets/custom_targets.json5) @@ -19,13 +19,12 @@ and upload method config otherwise functions below should be commented ]] # set(CUSTOM_UPLOAD_CFG_PATH ${CMAKE_SOURCE_DIR}/${MBED_TARGET}/${MBED_TARGET}.cmake) #[[ Note: For custom target you need also an upload method and we have few options how you can do that - - use the variable CUSTOM_UPLOAD_CFG_PATH below + - use the variable CUSTOM_UPLOAD_CFG_PATH above - use default expected path for custom targets upload methods where you create your own config MY_PROJECT/custom_targets/upload_method_cfg - - of course you can do it by your self dierectly via cmake in this file - - For regular targets we use mbed-os/tree/master/targets/upload_method_cfg ]] - + - of course you can do it by yourself directly via cmake in this file + Fro more visit https://github.com/mbed-ce/mbed-os/wiki/Upload-Methods ]] + ### End of block ###################################################################################################### @@ -35,8 +34,8 @@ include(mbed-os/tools/cmake/app.cmake) ###################################################################################################### ### Block of including project folders -#[[ In case of custom targets must be the folder included before mbed-os subdirectory -otherwise should be the next line commented]] +#[[ If using a custom target, the subdirectory containing the custom target must be included before + the mbed-os subdir, otherwise should be the next line commented]] add_subdirectory(custom_targets) ###-------------------------------------------------------------------------------------------------- @@ -57,6 +56,9 @@ project(mbed-ce-custom-targets) ### add executable (necessary everytime) add_executable(main main.cpp) +### Set post build (necessary everytime) +mbed_set_post_build(main) + ###################################################################################################### ### Link libraries block #[[For more about this configuraion visit wiki page MbedOS-configuration ]] @@ -70,8 +72,5 @@ target_link_libraries(main mbed-os) ### End of block ###################################################################################################### -### Set post build (necessary everytime) -mbed_set_post_build(main) - ### Build finalize does necessary configuration for debug in most cases (necessary everytime) -mbed_finalize_build() \ No newline at end of file +mbed_finalize_build() From fdf6dc5682fefaa41245d26dac82ae6acea18605 Mon Sep 17 00:00:00 2001 From: JohnK1987 Date: Fri, 1 Mar 2024 10:02:57 +0100 Subject: [PATCH 10/13] Update cmake-variants.yaml --- cmake-variants.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake-variants.yaml b/cmake-variants.yaml index e93f8ff..4c9dc39 100644 --- a/cmake-variants.yaml +++ b/cmake-variants.yaml @@ -22,6 +22,8 @@ board: short: L452RE_SIMPLE settings: MBED_TARGET: L452RE_SIMPLE - # Fill your upload method - # variants are: NONE, MBED, STLINK, JLINK, PYOCD, OPENOCD, STM32CUBE - UPLOAD_METHOD: STM32CUBE \ No newline at end of file + # Fill your upload method according to variants below + # - universal: NONE, MBED, JLINK, PYOCD, OPENOCD + # - target specific: STLINK, STM32CUBE, LINKSERVER, PICOTOOL, ARDUINO_BOSSAC + # For more visit - https://github.com/mbed-ce/mbed-os/wiki/Upload-Methods#upload-method-list + UPLOAD_METHOD: STM32CUBE From 1664d8aefe47b0fc1aae305acac3f1b8acda819c Mon Sep 17 00:00:00 2001 From: JohnK1987 Date: Fri, 1 Mar 2024 10:10:22 +0100 Subject: [PATCH 11/13] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 017aab4..04dead7 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ This repo includes three different custom targets you can use based on the `NUCL ## How to set up this project: -1. Clone it to your machine. Don't forget to use `--recursive` to clone the submodules: `git clone --recursive https://github.com/mbed-ce/mbed-ce-custom-targets.git`and update MbedOS with `git submodule update --remote mbed-os` (call it in project folder) +1. Clone it to your machine. Don't forget to use `--recursive` to clone the submodules: `git clone --recursive https://github.com/mbed-ce/mbed-ce-custom-targets.git`and update MbedOS with `git submodule update --remote mbed-os` (run this command from the mbed-ce-custom-targets folder) 2. Set up the GNU ARM toolchain (and other programs) on your machine using [the toolchain setup guide](https://github.com/mbed-ce/mbed-os/wiki/Toolchain-Setup-Guide). 3. Set up the CMake project for editing. We have three ways to do this: - On the [command line](https://github.com/mbed-ce/mbed-os/wiki/Project-Setup:-Command-Line) - Using the [CLion IDE](https://github.com/mbed-ce/mbed-os/wiki/Project-Setup:-CLion) - Using the [VS Code IDE](https://github.com/mbed-ce/mbed-os/wiki/Project-Setup:-VS-Code) -4. Use one of the target names listed above and choose an [upload method](https://github.com/mbed-ce/mbed-os/wiki/Upload-Methods) according to your requirments. Default settings is target L452RE_SIMPLE and upload method STM32CUBE. +4. Use one of the target names listed above and choose an [upload method](https://github.com/mbed-ce/mbed-os/wiki/Upload-Methods) according to your requirements. Default settings is target L452RE_SIMPLE and upload method STM32CUBE. From eea7fc85efecedca0fb5881a93727395dc7902f0 Mon Sep 17 00:00:00 2001 From: JohnK1987 Date: Fri, 1 Mar 2024 14:04:22 +0100 Subject: [PATCH 12/13] Update L452RE_CUSTOM_CLOCK.cmake --- custom_targets/upload_method_cfg/L452RE_CUSTOM_CLOCK.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_targets/upload_method_cfg/L452RE_CUSTOM_CLOCK.cmake b/custom_targets/upload_method_cfg/L452RE_CUSTOM_CLOCK.cmake index b4c3c3c..821e4ec 100644 --- a/custom_targets/upload_method_cfg/L452RE_CUSTOM_CLOCK.cmake +++ b/custom_targets/upload_method_cfg/L452RE_CUSTOM_CLOCK.cmake @@ -7,6 +7,8 @@ set(UPLOAD_METHOD_DEFAULT OPENOCD) # Config options for OPENOCD # ------------------------------------------------------------- +# We set TRUE to enable OpenOCD set(OPENOCD_UPLOAD_ENABLED TRUE) +# Here set a path to requested OpenOCD config. In this case we use already implemented one. set(OPENOCD_CHIP_CONFIG_COMMANDS - -f ${CMAKE_CURRENT_LIST_DIR}/openocd_cfgs/stm32l452re.cfg) \ No newline at end of file + -f ${CMAKE_SOURCE_DIR}/mbed-os/targets/upload_method_cfg/openocd_cfgs/s/stm32l452re.cfg) From 3136df5f1d6aeefbd5d1b962ce96c1255a650a63 Mon Sep 17 00:00:00 2001 From: JohnK1987 Date: Sat, 2 Mar 2024 20:38:16 +0100 Subject: [PATCH 13/13] Update CMakeLists.txt --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9e3c6f..da66435 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ set(MBED_APP_JSON_PATH mbed_app.json5) - use default expected path for custom targets upload methods where you create your own config MY_PROJECT/custom_targets/upload_method_cfg - of course you can do it by yourself directly via cmake in this file - Fro more visit https://github.com/mbed-ce/mbed-os/wiki/Upload-Methods ]] + For more visit https://github.com/mbed-ce/mbed-os/wiki/Upload-Methods ]] ### End of block ###################################################################################################### @@ -35,7 +35,7 @@ include(mbed-os/tools/cmake/app.cmake) ### Block of including project folders #[[ If using a custom target, the subdirectory containing the custom target must be included before - the mbed-os subdir, otherwise should be the next line commented]] + the mbed-os subdir, otherwise the next line should be commented]] add_subdirectory(custom_targets) ###--------------------------------------------------------------------------------------------------