Skip to content

Commit 6baf3fa

Browse files
committed
Sample app - smp_svr
1 parent 433ad4e commit 6baf3fa

File tree

9 files changed

+700
-0
lines changed

9 files changed

+700
-0
lines changed

samples/smp_svr/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# smp_svr
2+
3+
This sample application implements a simple SMP server with the following
4+
transports:
5+
* Shell
6+
* Bluetooth
7+
8+
`smp_svr` enables support for the following command groups:
9+
* fs_mgmt
10+
* img_mgmt
11+
* os_mgmt
12+
13+
## Mynewt
14+
15+
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.
16+
17+
0. Create a Mynewt project and upload the Apache mynewt boot loader to your
18+
board as described here: http://mynewt.apache.org/latest/os/tutorials/nRF52/
19+
20+
1. Add the mcumgr repo to your `project.yml` file:
21+
22+
```
23+
repository.mynewt-mcumgr:
24+
type: git
25+
vers: 0-latest
26+
url: '[email protected]:apache/mynewt-mcumgr.git'
27+
```
28+
29+
2. Create a target that ties the `smp_svr` app to your BSP of choice (nRF52dk in this example):
30+
31+
```
32+
$ newt target create smp_svr-nrf52dk
33+
$ newt target set smp_svr-nrf52dk app=@mynewt-mcumgr/samples/smp_svr/apache \
34+
bsp=@apache-mynewt-core/hw/bsp/nrf52dk \
35+
build_profile=debug
36+
```
37+
38+
3. Build, upload, and run the application on your board:
39+
40+
```
41+
$ newt run smp_svr-nrf52dk
42+
```
43+
44+
## Zephyr
45+
46+
The Zephyr port of `smp_svr` is configured to run on an nRF52 MCU. The
47+
application should build and run for other platforms without modification, but
48+
the file system management commands will not work. To enable file system
49+
management for a different platform, adjust the `CONFIG_FS_NFFS_FLASH_DEV_NAME`
50+
setting in `prj.conf` accordingly.
51+
52+
In addition, the MCUBoot boot loader (https://github.com/runtimeco/mcuboot) is
53+
required for img_mgmt to function properly.
54+
55+
### Building
56+
57+
The Zephyr port of `smp_svr` can be built using the usual procedure:
58+
59+
```
60+
$ cd samples/smp_svr/zephyr
61+
$ mkdir build && cd build
62+
$ cmake -DBOARD=<board> ..
63+
$ make
64+
```

samples/smp_svr/mynewt/pkg.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
pkg.name: samples/smp_svr/mynewt
19+
pkg.type: app
20+
pkg.description: Simple BLE peripheral running an mcumgr SMP server.
21+
pkg.author: "Apache Mynewt <[email protected]>"
22+
pkg.homepage: "http://mynewt.apache.org/"
23+
pkg.keywords:
24+
25+
pkg.deps:
26+
- '@apache-mynewt-core/boot/bootutil'
27+
- '@apache-mynewt-core/mgmt/newtmgr/transport/ble'
28+
- '@apache-mynewt-core/mgmt/newtmgr/transport/nmgr_shell'
29+
- '@apache-mynewt-core/net/nimble/controller'
30+
- '@apache-mynewt-core/net/nimble/host'
31+
- '@apache-mynewt-core/net/nimble/host/services/ans'
32+
- '@apache-mynewt-core/net/nimble/host/services/gap'
33+
- '@apache-mynewt-core/net/nimble/host/services/gatt'
34+
- '@apache-mynewt-core/net/nimble/host/store/config'
35+
- '@apache-mynewt-core/net/nimble/transport/ram'
36+
- '@apache-mynewt-core/sys/console/full'
37+
- '@apache-mynewt-core/sys/log/full'
38+
- '@apache-mynewt-core/sys/stats/full'
39+
- '@mynewt-mcumgr/cmd/fs_mgmt'
40+
- '@mynewt-mcumgr/cmd/img_mgmt'
41+
- '@mynewt-mcumgr/cmd/os_mgmt'
42+
- '@mynewt-mcumgr/mgmt'
43+
- '@mynewt-mcumgr/smp'

0 commit comments

Comments
 (0)