From 946a1b57cbd9be2fd5c4ecf69e530d4bb5766313 Mon Sep 17 00:00:00 2001 From: Jamie Smith Date: Thu, 20 Jul 2023 09:24:05 -0700 Subject: [PATCH] Fix LoRaWan compile error, add DISCO_L072CZ_LRWAN1 upload method configuration (#170) --- connectivity/CMakeLists.txt | 4 +- .../DISCO_L072CZ_LRWAN1.cmake | 54 +++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 targets/upload_method_cfg/DISCO_L072CZ_LRWAN1.cmake diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt index 81629961a1..953c118973 100644 --- a/connectivity/CMakeLists.txt +++ b/connectivity/CMakeLists.txt @@ -1,17 +1,17 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# These five directories create targets that are then used by buildfiles under drivers/ +# These six directories create targets that are then used by buildfiles under drivers/ add_subdirectory(nanostack) add_subdirectory(cellular) add_subdirectory(mbedtls) add_subdirectory(nfc) +add_subdirectory(lorawan) if("FEATURE_BLE=1" IN_LIST MBED_TARGET_DEFINITIONS) add_subdirectory(FEATURE_BLE) endif() add_subdirectory(drivers) add_subdirectory(libraries) -add_subdirectory(lorawan) add_subdirectory(lwipstack) add_subdirectory(netsocket) \ No newline at end of file diff --git a/targets/upload_method_cfg/DISCO_L072CZ_LRWAN1.cmake b/targets/upload_method_cfg/DISCO_L072CZ_LRWAN1.cmake new file mode 100644 index 0000000000..3f1973e758 --- /dev/null +++ b/targets/upload_method_cfg/DISCO_L072CZ_LRWAN1.cmake @@ -0,0 +1,54 @@ +# Mbed OS upload method configuration file for target DISCO_L072CZ_LRWAN1. +# To change any of these parameters from their default values, set them in your build script between where you +# include app.cmake and where you add mbed os as a subdirectory. + +# Notes: +# 1. To use this target with PyOCD, you need to install a pack: `python -m pyocd pack install STM32L072CZTx`. +# You might also need to run `pyocd pack update` first. +# 2. To use J-Link you must convert your board's ST-Link into a J-Link using the reflash program. + +# General config parameters +# ------------------------------------------------------------- +set(UPLOAD_METHOD_DEFAULT MBED) + +# Config options for MBED +# ------------------------------------------------------------- + +set(MBED_UPLOAD_ENABLED TRUE) +set(MBED_RESET_BAUDRATE 115200) + +# Config options for JLINK +# ------------------------------------------------------------- + +set(JLINK_UPLOAD_ENABLED TRUE) +set(JLINK_CPU_NAME STM32L072CZ) +set(JLINK_CLOCK_SPEED 4000) +set(JLINK_UPLOAD_INTERFACE SWD) + +# Config options for PYOCD +# ------------------------------------------------------------- + +set(PYOCD_UPLOAD_ENABLED TRUE) +set(PYOCD_TARGET_NAME STM32L072CZTx) +set(PYOCD_CLOCK_SPEED 4000k) + +# Config options for OPENOCD +# ------------------------------------------------------------- + +set(OPENOCD_UPLOAD_ENABLED TRUE) +set(OPENOCD_CHIP_CONFIG_COMMANDS +-f ${OpenOCD_SCRIPT_DIR}/board/st_nucleo_l073rz.cfg) + +# Config options for STM32Cube +# ------------------------------------------------------------- + +set(STM32CUBE_UPLOAD_ENABLED TRUE) +set(STM32CUBE_CONNECT_COMMAND -c port=SWD reset=HWrst) +set(STM32CUBE_GDBSERVER_ARGS --swd) + +# Config options for stlink +# ------------------------------------------------------------- + +set(STLINK_UPLOAD_ENABLED FALSE) +set(STLINK_LOAD_ADDRESS 0x8000000) +set(STLINK_ARGS --connect-under-reset)