[mynewt-mcumgr] 11/42: Sample app - smp_svr
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git commit 854e66b3540f33059cc4ff57fe171a7f4787e9e3 Author: Christopher CollinsAuthorDate: Wed Jan 17 17:18:13 2018 -0800 Sample app - smp_svr --- samples/smp_svr/README.md | 64 +++ samples/smp_svr/mynewt/pkg.yml| 43 + samples/smp_svr/mynewt/src/main.c | 320 ++ samples/smp_svr/mynewt/syscfg.yml | 39 + samples/smp_svr/zephyr/CMakeLists.txt | 42 + samples/smp_svr/zephyr/README.rst | 41 + samples/smp_svr/zephyr/dts.overlay| 13 ++ samples/smp_svr/zephyr/prj.conf | 30 samples/smp_svr/zephyr/src/main.c | 108 9 files changed, 700 insertions(+) diff --git a/samples/smp_svr/README.md b/samples/smp_svr/README.md new file mode 100644 index 000..cb9d3e7 --- /dev/null +++ b/samples/smp_svr/README.md @@ -0,0 +1,64 @@ +# smp_svr + +This sample application implements a simple SMP server with the following +transports: +* Shell +* Bluetooth + +`smp_svr` enables support for the following command groups: +* fs_mgmt +* img_mgmt +* os_mgmt + +## Mynewt + +The Mynewt port of `smp_svr` is a regular Mynewt app. The below example uses the nRF52dk as the BSP, so you may need to adjust accordingly if you are using different hardware. + +0. Create a Mynewt project and upload the Apache mynewt boot loader to your +board as described here: http://mynewt.apache.org/latest/os/tutorials/nRF52/ + +1. Add the mcumgr repo to your `project.yml` file: + +``` +repository.mynewt-mcumgr: +type: git +vers: 0-latest +url: 'g...@github.com:apache/mynewt-mcumgr.git' +``` + +2. Create a target that ties the `smp_svr` app to your BSP of choice (nRF52dk in this example): + +``` +$ newt target create smp_svr-nrf52dk +$ newt target set smp_svr-nrf52dk app=@mynewt-mcumgr/samples/smp_svr/apache \ + bsp=@apache-mynewt-core/hw/bsp/nrf52dk\ + build_profile=debug +``` + +3. Build, upload, and run the application on your board: + +``` +$ newt run smp_svr-nrf52dk +``` + +## Zephyr + +The Zephyr port of `smp_svr` is configured to run on an nRF52 MCU. The +application should build and run for other platforms without modification, but +the file system management commands will not work. To enable file system +management for a different platform, adjust the `CONFIG_FS_NFFS_FLASH_DEV_NAME` +setting in `prj.conf` accordingly. + +In addition, the MCUBoot boot loader (https://github.com/runtimeco/mcuboot) is +required for img_mgmt to function properly. + +### Building + +The Zephyr port of `smp_svr` can be built using the usual procedure: + +``` +$ cd samples/smp_svr/zephyr +$ mkdir build && cd build +$ cmake -DBOARD= .. +$ make +``` diff --git a/samples/smp_svr/mynewt/pkg.yml b/samples/smp_svr/mynewt/pkg.yml new file mode 100644 index 000..83d38d5 --- /dev/null +++ b/samples/smp_svr/mynewt/pkg.yml @@ -0,0 +1,43 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +pkg.name: samples/smp_svr/mynewt +pkg.type: app +pkg.description: Simple BLE peripheral running an mcumgr SMP server. +pkg.author: "Apache Mynewt " +pkg.homepage: "http://mynewt.apache.org/; +pkg.keywords: + +pkg.deps: +- '@apache-mynewt-core/boot/bootutil' +- '@apache-mynewt-core/mgmt/newtmgr/transport/ble' +- '@apache-mynewt-core/mgmt/newtmgr/transport/nmgr_shell' +- '@apache-mynewt-core/net/nimble/controller' +- '@apache-mynewt-core/net/nimble/host' +- '@apache-mynewt-core/net/nimble/host/services/ans' +- '@apache-mynewt-core/net/nimble/host/services/gap' +- '@apache-mynewt-core/net/nimble/host/services/gatt' +- '@apache-mynewt-core/net/nimble/host/store/config' +- '@apache-mynewt-core/net/nimble/transport/ram' +- '@apache-mynewt-core/sys/console/full' +- '@apache-mynewt-core/sys/log/full' +- '@apache-mynewt-core/sys/stats/full' +- '@mynewt-mcumgr/cmd/fs_mgmt' +- '@mynewt-mcumgr/cmd/img_mgmt' +- '@mynewt-mcumgr/cmd/os_mgmt' +-
[mynewt-mcumgr] 11/42: Sample app - smp_svr
This is an automated email from the ASF dual-hosted git repository. ccollins pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git commit 22bba90da5c1909663581eedd691d0bed2ed07c3 Author: Christopher CollinsAuthorDate: Wed Jan 17 17:18:13 2018 -0800 Sample app - smp_svr --- samples/smp_svr/README.md | 64 +++ samples/smp_svr/mynewt/pkg.yml| 43 + samples/smp_svr/mynewt/src/main.c | 320 ++ samples/smp_svr/mynewt/syscfg.yml | 39 + samples/smp_svr/zephyr/CMakeLists.txt | 42 + samples/smp_svr/zephyr/README.rst | 41 + samples/smp_svr/zephyr/dts.overlay| 13 ++ samples/smp_svr/zephyr/prj.conf | 30 samples/smp_svr/zephyr/src/main.c | 108 9 files changed, 700 insertions(+) diff --git a/samples/smp_svr/README.md b/samples/smp_svr/README.md new file mode 100644 index 000..cb9d3e7 --- /dev/null +++ b/samples/smp_svr/README.md @@ -0,0 +1,64 @@ +# smp_svr + +This sample application implements a simple SMP server with the following +transports: +* Shell +* Bluetooth + +`smp_svr` enables support for the following command groups: +* fs_mgmt +* img_mgmt +* os_mgmt + +## Mynewt + +The Mynewt port of `smp_svr` is a regular Mynewt app. The below example uses the nRF52dk as the BSP, so you may need to adjust accordingly if you are using different hardware. + +0. Create a Mynewt project and upload the Apache mynewt boot loader to your +board as described here: http://mynewt.apache.org/latest/os/tutorials/nRF52/ + +1. Add the mcumgr repo to your `project.yml` file: + +``` +repository.mynewt-mcumgr: +type: git +vers: 0-latest +url: 'g...@github.com:apache/mynewt-mcumgr.git' +``` + +2. Create a target that ties the `smp_svr` app to your BSP of choice (nRF52dk in this example): + +``` +$ newt target create smp_svr-nrf52dk +$ newt target set smp_svr-nrf52dk app=@mynewt-mcumgr/samples/smp_svr/apache \ + bsp=@apache-mynewt-core/hw/bsp/nrf52dk\ + build_profile=debug +``` + +3. Build, upload, and run the application on your board: + +``` +$ newt run smp_svr-nrf52dk +``` + +## Zephyr + +The Zephyr port of `smp_svr` is configured to run on an nRF52 MCU. The +application should build and run for other platforms without modification, but +the file system management commands will not work. To enable file system +management for a different platform, adjust the `CONFIG_FS_NFFS_FLASH_DEV_NAME` +setting in `prj.conf` accordingly. + +In addition, the MCUBoot boot loader (https://github.com/runtimeco/mcuboot) is +required for img_mgmt to function properly. + +### Building + +The Zephyr port of `smp_svr` can be built using the usual procedure: + +``` +$ cd samples/smp_svr/zephyr +$ mkdir build && cd build +$ cmake -DBOARD= .. +$ make +``` diff --git a/samples/smp_svr/mynewt/pkg.yml b/samples/smp_svr/mynewt/pkg.yml new file mode 100644 index 000..83d38d5 --- /dev/null +++ b/samples/smp_svr/mynewt/pkg.yml @@ -0,0 +1,43 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +pkg.name: samples/smp_svr/mynewt +pkg.type: app +pkg.description: Simple BLE peripheral running an mcumgr SMP server. +pkg.author: "Apache Mynewt " +pkg.homepage: "http://mynewt.apache.org/; +pkg.keywords: + +pkg.deps: +- '@apache-mynewt-core/boot/bootutil' +- '@apache-mynewt-core/mgmt/newtmgr/transport/ble' +- '@apache-mynewt-core/mgmt/newtmgr/transport/nmgr_shell' +- '@apache-mynewt-core/net/nimble/controller' +- '@apache-mynewt-core/net/nimble/host' +- '@apache-mynewt-core/net/nimble/host/services/ans' +- '@apache-mynewt-core/net/nimble/host/services/gap' +- '@apache-mynewt-core/net/nimble/host/services/gatt' +- '@apache-mynewt-core/net/nimble/host/store/config' +- '@apache-mynewt-core/net/nimble/transport/ram' +- '@apache-mynewt-core/sys/console/full' +- '@apache-mynewt-core/sys/log/full' +- '@apache-mynewt-core/sys/stats/full' +- '@mynewt-mcumgr/cmd/fs_mgmt' +- '@mynewt-mcumgr/cmd/img_mgmt' +- '@mynewt-mcumgr/cmd/os_mgmt' +-