mynewt-mcumgr.git
2 weeks agoMerge pull request #17 from sjanc/resume_upload_fix master
Szymon Janc [Fri, 23 Nov 2018 07:29:37 +0000 (08:29 +0100)] 
Merge pull request #17 from sjanc/resume_upload_fix

Fix missing upload events callbacks

2 weeks agoFix missing upload events callbacks 17/head
Szymon Janc [Thu, 22 Nov 2018 20:40:15 +0000 (21:40 +0100)] 
Fix missing upload events callbacks

This fix missing upload start event on upload resume and missing
ongoing event in case upload is restarted due to invalid offset.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
4 weeks agoMerge pull request #16 from MariuszSkamra/cmd_cbs
Szymon Janc [Thu, 8 Nov 2018 08:27:47 +0000 (09:27 +0100)] 
Merge pull request #16 from MariuszSkamra/cmd_cbs

Add event callbacks on command handlers

4 weeks agoAdd event callbacks on command handlers 16/head
Mariusz Skamra [Fri, 2 Nov 2018 10:13:51 +0000 (11:13 +0100)] 
Add event callbacks on command handlers

Those callbacks will be needed to i.e. track state of firmware update,
Notify about reboot going to happen etc.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
5 weeks agoMerge pull request #13 from sjanc/resume
Szymon Janc [Fri, 2 Nov 2018 11:07:18 +0000 (12:07 +0100)] 
Merge pull request #13 from sjanc/resume

Add support for resuming partial upload

5 weeks agoMerge pull request #15 from sjanc/kconfig
Szymon Janc [Wed, 31 Oct 2018 12:14:51 +0000 (13:14 +0100)] 
Merge pull request #15 from sjanc/kconfig

Use a short, consistent style for prompts in Kconfig

5 weeks agoMerge pull request #14 from sjanc/taskstat
Szymon Janc [Wed, 31 Oct 2018 12:14:34 +0000 (13:14 +0100)] 
Merge pull request #14 from sjanc/taskstat

Allow to configure taskstat and echo commands support

5 weeks agoUse a short, consistent style for prompts in Kconfig 15/head
Szymon Janc [Wed, 31 Oct 2018 12:01:32 +0000 (13:01 +0100)] 
Use a short, consistent style for prompts in Kconfig

This synchronizes Kconfig with current Zephyr master.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
5 weeks agoAllow to configure taskstat and echo commands support 14/head
Szymon Janc [Wed, 31 Oct 2018 11:58:02 +0000 (12:58 +0100)] 
Allow to configure taskstat and echo commands support

Application might not be interested in using those commands and
disabling them allows to save 628 bytes of flash.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
5 weeks agoAdd support for resuming partial upload 13/head
Szymon Janc [Wed, 31 Oct 2018 09:55:00 +0000 (10:55 +0100)] 
Add support for resuming partial upload

This allows uploader to resume partial upload by reusing same SHA hash
in new upload. This patch is based on similar functionality in newtmgr
and is compatible with it.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2 months agoMerge pull request #11 from nvlsianpu/erase_if_swap_none
Szymon Janc [Wed, 3 Oct 2018 12:39:09 +0000 (14:39 +0200)] 
Merge pull request #11 from nvlsianpu/erase_if_swap_none

image erase: allow only when slot image is not backup/pending...

3 months agoimage erase: allow only when slot image is not backup/pending... 11/head
Andrzej Puzdrowski [Tue, 21 Aug 2018 14:07:25 +0000 (16:07 +0200)] 
image erase: allow only when slot image is not backup/pending...

It was possible to erase slot 1 while it stores confirmed image
while ongoing test run - this is unwanted behavior which allow
to even brick remote device accidentally.
This patch add check for such case of test run etc.
This also aligns condition required for erase command
execution to similar as upload command requires.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
5 months agoMerge pull request #7 from carlescufi/zephyr_fixes
Fabio Utzig [Tue, 3 Jul 2018 16:41:47 +0000 (13:41 -0300)] 
Merge pull request #7 from carlescufi/zephyr_fixes

Upstreaming of Zephyr downstream modifications

5 months agozephyr: kconfig: Backport fixes 7/head
Carles Cufi [Tue, 3 Jul 2018 15:13:53 +0000 (17:13 +0200)] 
zephyr: kconfig: Backport fixes

Several Kconfig fixes that were applied since MCUmgr was imported into Zephyr
are now reapplied into MCUmgr.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
5 months agozephyr: Fix fs_file_t and fs_dir_t usage
Carles Cufi [Tue, 3 Jul 2018 15:13:23 +0000 (17:13 +0200)] 
zephyr: Fix fs_file_t and fs_dir_t usage

With the introduce of VFS the typedef for fs_file_t & fs_dir_t don't
exist anymore so we need to use 'struct fs_dir_t' or 'struct
fs_file_t'.
Fix up some places that got missed in the VFS conversion.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
5 months agoMerge pull request #4 from JoeHut/fix/docu
Fabio Utzig [Tue, 3 Jul 2018 10:55:44 +0000 (07:55 -0300)] 
Merge pull request #4 from JoeHut/fix/docu

Readme.md: Link OS-specific documentation

5 months agoMerge pull request #5 from workaroundgmbh/fix-mcumgr-memory-corruption
ccollins476ad [Mon, 2 Jul 2018 19:50:39 +0000 (12:50 -0700)] 
Merge pull request #5 from workaroundgmbh/fix-mcumgr-memory-corruption

cmd: img_mgmt: Add an extra byte to the 'hash' buffer

5 months agocmd: img_mgmt: Add an extra byte to the 'hash' buffer 5/head
Olivier Martin [Fri, 29 Jun 2018 16:18:49 +0000 (18:18 +0200)] 
cmd: img_mgmt: Add an extra byte to the 'hash' buffer

_cbor_value_copy_string() (invoked by cbor_read_object()) adds a
null-character to the byte string.
Not adding this additional byte to the buffer obviously corrupts the memory.

Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
6 months agoReadme.md: Link OS-specific documentation 4/head
Johannes Hutter [Mon, 4 Jun 2018 08:42:44 +0000 (10:42 +0200)] 
Readme.md: Link OS-specific documentation

Link the names of the OS-specific documentation for Mynewt and Zephyr in
the Readme files.

Signed-off-by: Johannes Hutter <johannes@proglove.de>
8 months ago[zephyr] Use new VFS API for file system init.
Christopher Collins [Wed, 14 Mar 2018 18:49:14 +0000 (11:49 -0700)] 
[zephyr] Use new VFS API for file system init.

8 months ago[zephyr] - Use coding style in smp_svr code.
Christopher Collins [Wed, 14 Mar 2018 18:48:51 +0000 (11:48 -0700)] 
[zephyr] - Use coding style in smp_svr code.

8 months ago[zephyr] - Use updated nrf5 flash name for smp_svr
Christopher Collins [Wed, 14 Mar 2018 18:47:02 +0000 (11:47 -0700)] 
[zephyr] - Use updated nrf5 flash name for smp_svr

Use NRF5_FLASH_DRV_NAME (was: NRF5_FLASH).

9 months ago(Zephyr) Use updated stats api.
Christopher Collins [Sun, 18 Feb 2018 22:42:53 +0000 (14:42 -0800)] 
(Zephyr) Use updated stats api.

The Zephyr stats API now requires `;` at the end of `STATS_SECT_END` and
`STATS_NAME_END()`.

9 months ago(zephyr) Enable stats in prj.conf.tiny.
Christopher Collins [Thu, 15 Feb 2018 20:44:33 +0000 (12:44 -0800)] 
(zephyr) Enable stats in prj.conf.tiny.

A recent change to Zephyr's stats implementation allows statistics
support to fit for constrained devices (removal of `snprintf()` call).

9 months agosmp_svr - Update README
Christopher Collins [Wed, 14 Feb 2018 23:10:41 +0000 (15:10 -0800)] 
smp_svr - Update README

* Update the Zephyr section of the README to point to the
  `prj.conf.tiny` file.

* Update the Zephyr section of the README to use
  `ZEPHYR_TOOLCHAIN_VARIANT` rather than the deprecated
  `ZEPHYR_GCC_VARIANT`.

9 months agosmp_svr (Zephyr) - Change comment for accuracy.
Christopher Collins [Wed, 14 Feb 2018 23:31:44 +0000 (15:31 -0800)] 
smp_svr (Zephyr) - Change comment for accuracy.

The original comment describing the example stats group wasn't entirely
accurate.  It doesn't measure seconds since boot, it only approximates
it.

9 months agoimg_mgmt (Zephyr) - Conditionally select if MPU.
Christopher Collins [Wed, 14 Feb 2018 23:04:50 +0000 (15:04 -0800)] 
img_mgmt (Zephyr) - Conditionally select if MPU.

Enabling img_mgmt was automatically selecting MPU_ALLOW_FLASH_WRITE.
This setting can only be selected if the target platform has an MPU.
Now, this setting only gets selected if CPU_HAS_MPU is already enabled.

9 months agosmp_svr (Zephyr) - prj.conf.tiny
Christopher Collins [Wed, 14 Feb 2018 22:59:15 +0000 (14:59 -0800)] 
smp_svr (Zephyr) - prj.conf.tiny

Add a project configuration file for constrained platforms (e.g.,
nRF51).

9 months agosmp_svr (Zephyr) - Disable unneeded FCB settings.
Christopher Collins [Wed, 14 Feb 2018 22:56:18 +0000 (14:56 -0800)] 
smp_svr (Zephyr) - Disable unneeded FCB settings.

These settings were only getting enabled for the reboot log.  Now that
the reboot log has been temporarily deferred from integration into
Zephyr, these settings are unnecessary.

9 months agosmp_svr (Zephyr) - Conditionally link ext libs.
Christopher Collins [Wed, 14 Feb 2018 22:53:20 +0000 (14:53 -0800)] 
smp_svr (Zephyr) - Conditionally link ext libs.

This makes it so that the user does not need to modify the
CMakeLists.txt file when they enable or disable mcumgr settings.  Prior
to this commit, the list of linked libraries needed to reflect exactly
what was required by mcumgr.

9 months agosmp_svr (Zephyr) - Remove IS_ENABLED invocations.
Christopher Collins [Wed, 14 Feb 2018 21:52:47 +0000 (13:52 -0800)] 
smp_svr (Zephyr) - Remove IS_ENABLED invocations.

Use of this macro was eliciting "implicit declaration" warnings for
conditionally defined symboles.  Reverting to `#ifdef` fixes the
warnings.

9 months agoRemove calls to `*printf()`
Christopher Collins [Wed, 14 Feb 2018 21:52:27 +0000 (13:52 -0800)] 
Remove calls to `*printf()`

Prior to this commit, mcumgr used `sprintf()` and `snprintf()` to format
text in certain responses.  These functions add quite a bit of code size
for Zephyr builds (~10kB).

This commit implements a few lightweight integer-to-string functions
and eliminates the stdio calls.

9 months agoUpdate readme files.
Christopher Collins [Tue, 13 Feb 2018 23:42:56 +0000 (15:42 -0800)] 
Update readme files.

* Indicate minimum required version of MCUboot.
* Add details to smp_svr build instructions for Zephyr.

9 months ago(zephyr) Reduce L2CAP buf count in smp_svr.
Christopher Collins [Tue, 13 Feb 2018 23:07:09 +0000 (15:07 -0800)] 
(zephyr) Reduce L2CAP buf count in smp_svr.

The high buffer count is no longer needed now that
https://github.com/zephyrproject-rtos/zephyr/pull/6110 has been merged.

9 months agosmp_svr (zephyr) - Use IS_ENABLED macro in fn body
Christopher Collins [Tue, 13 Feb 2018 22:51:56 +0000 (14:51 -0800)] 
smp_svr (zephyr) - Use IS_ENABLED macro in fn body

9 months agoRemove log support from zephyr sample app
Christopher Collins [Tue, 13 Feb 2018 21:18:10 +0000 (13:18 -0800)] 
Remove log support from zephyr sample app

It was decided that Zephyr support for log and reboot_log will be
defered.  When it gets added, we can back out this commit.

9 months agoImplicitly link sample zephyr app with mcumgr
Christopher Collins [Tue, 13 Feb 2018 19:37:34 +0000 (11:37 -0800)] 
Implicitly link sample zephyr app with mcumgr

Whenever possible we want to avoid requiring the application to write
build script code. To this end there exists support in the core build
system to have libraries default to link with the app.

This patch uses this mechanism to reduce the amount of documentation
that an application developer needs to read and the amount of build
script code that needs to be written.

9 months agosmp_svr (zephyr) - CONFIG_NET_BUF_USER_DATA_SIZE=7
Christopher Collins [Tue, 13 Feb 2018 01:40:40 +0000 (17:40 -0800)] 
smp_svr (zephyr) - CONFIG_NET_BUF_USER_DATA_SIZE=7

This setting is required by the updated net_buf API.  Failing to
configure this setting to a value >= 7 causes a static assert failure.

9 months agoRemove base64 library.
Christopher Collins [Fri, 9 Feb 2018 21:59:49 +0000 (13:59 -0800)] 
Remove base64 library.

The application code is expected to provide its own base64 library.

9 months agoZephyr: use <> for non-relative include paths.
Christopher Collins [Mon, 12 Feb 2018 21:18:22 +0000 (13:18 -0800)] 
Zephyr: use <> for non-relative include paths.

For `#include` directives, Zephyr uses "" for paths relative to the
source file; <> for headers in an include path.

9 months agosmp_svr/CMakeLists.txt: remove FROM_WHO variable
Christopher Collins [Mon, 12 Feb 2018 21:17:48 +0000 (13:17 -0800)] 
smp_svr/CMakeLists.txt: remove FROM_WHO variable

This variable is unnecessary.  It was a leftover from the original
CMakeLists.txt file used as a template.

9 months agosmp_svr/CMakeLists.txt: remove set_conf_file macro
Christopher Collins [Mon, 12 Feb 2018 21:17:22 +0000 (13:17 -0800)] 
smp_svr/CMakeLists.txt: remove set_conf_file macro

This macro is unnecessary.  It was a leftover from the original
CMakeLists.txt file used as a template.

9 months agofs_mgmt - Surround macro definition with ().
Christopher Collins [Mon, 12 Feb 2018 21:16:56 +0000 (13:16 -0800)] 
fs_mgmt - Surround macro definition with ().

9 months agoRemove "zephyr,code_partition" from dts overlay
Christopher Collins [Mon, 12 Feb 2018 21:03:34 +0000 (13:03 -0800)] 
Remove "zephyr,code_partition" from dts overlay

This is no longer needed now that MCUboot has been integrated more fully
into Zephyr.

9 months agoIndicate units (bytes) in Kconfig help.
Christopher Collins [Mon, 12 Feb 2018 21:01:59 +0000 (13:01 -0800)] 
Indicate units (bytes) in Kconfig help.

9 months agomcumgr: Minor refactor to increase readability
Sebastian Bøe [Mon, 12 Feb 2018 11:32:37 +0000 (12:32 +0100)] 
mcumgr: Minor refactor to increase readability

horizontal alignment improves readability and diff-ability.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
9 months agoReadme.md: Fix bad links in file README.md
Ding Tao [Fri, 9 Feb 2018 09:39:54 +0000 (17:39 +0800)] 
Readme.md: Fix bad links in file README.md

Replace "mcumgr" with "mynewt-mcumgr".

Signed-off-by: Ding Tao <miyatsu@qq.com>
9 months agosmp_svr - Update zephyr port for compatibility.
Christopher Collins [Thu, 8 Feb 2018 23:05:09 +0000 (15:05 -0800)] 
smp_svr - Update zephyr port for compatibility.

9 months agoZephyr port: move mcumgr location in zephyr.
Christopher Collins [Thu, 8 Feb 2018 23:24:24 +0000 (15:24 -0800)] 
Zephyr port: move mcumgr location in zephyr.

`ext/mcumgr` --> `ext/lib/mgmt/mcumgr`

9 months agozephyr img_mgmt: Use `FLASH_DEV_NAME`
Christopher Collins [Thu, 8 Feb 2018 22:33:40 +0000 (14:33 -0800)] 
zephyr img_mgmt: Use `FLASH_DEV_NAME`

This used to be `FLASH_DRIVER_NAME`, but it changed in zephyr.

9 months agoRemove local tinycbor copy.
Christopher Collins [Thu, 8 Feb 2018 21:23:30 +0000 (13:23 -0800)] 
Remove local tinycbor copy.

Now mcumgr requires the application to supply the tinycbor library.

9 months agoCorrect "MCUboot" spelling in documentation.
Christopher Collins [Thu, 1 Feb 2018 00:31:39 +0000 (16:31 -0800)] 
Correct "MCUboot" spelling in documentation.

MCUBoot --> MCUboot.

9 months agosmp_svr - Use CONFIG_BOOTLOADER_MCUBOOT setting.
Christopher Collins [Thu, 1 Feb 2018 00:30:37 +0000 (16:30 -0800)] 
smp_svr - Use CONFIG_BOOTLOADER_MCUBOOT setting.

9 months agosmp_svr - Add statistics.
Christopher Collins [Tue, 30 Jan 2018 20:17:43 +0000 (12:17 -0800)] 
smp_svr - Add statistics.

9 months agostat_mgmt command handler group.
Christopher Collins [Tue, 30 Jan 2018 00:05:27 +0000 (16:05 -0800)] 
stat_mgmt command handler group.

9 months agosmp_svr - fix build error when CONFIG_MDLOG unset.
Christopher Collins [Tue, 30 Jan 2018 20:07:25 +0000 (12:07 -0800)] 
smp_svr - fix build error when CONFIG_MDLOG unset.

9 months agosmp_svr - Allow both CONFIG_FCB and CONFIG_FS_NFFS
Christopher Collins [Tue, 30 Jan 2018 20:05:44 +0000 (12:05 -0800)] 
smp_svr - Allow both CONFIG_FCB and CONFIG_FS_NFFS

Prior to this commit, the smp_svr sample app raised a build-time error
if both FCB and NFFS were enabled.  The thinking was that a user only
has enough flash space for one or the other.  However, this does not
justify an error for two reasons:

1. The user's platform may have sufficient flash for both storage types.

2. Even if only one storage type is enabled, it is still OK to enable
both.  One storage type will silently fail to initialize, but the other
will work.  Enabling both makes it easier to switch configurations in
the sample app.

9 months agoMinor code cleanup.
Christopher Collins [Tue, 30 Jan 2018 19:47:12 +0000 (11:47 -0800)] 
Minor code cleanup.

9 months agoAdd doxygen comments for log_mgmt.
Christopher Collins [Tue, 30 Jan 2018 19:40:38 +0000 (11:40 -0800)] 
Add doxygen comments for log_mgmt.

9 months agoUpdate documentation.
Christopher Collins [Sat, 27 Jan 2018 01:58:38 +0000 (17:58 -0800)] 
Update documentation.

9 months agosmp_svr Mynewt sample app - Remove redundant dep.
Christopher Collins [Sat, 27 Jan 2018 01:58:09 +0000 (17:58 -0800)] 
smp_svr Mynewt sample app - Remove redundant dep.

9 months agoAdd log_mgmt support to smp_svr sample app.
Christopher Collins [Fri, 26 Jan 2018 23:52:34 +0000 (15:52 -0800)] 
Add log_mgmt support to smp_svr sample app.

9 months agolog_mgmt command handler group.
Christopher Collins [Fri, 26 Jan 2018 23:52:28 +0000 (15:52 -0800)] 
log_mgmt command handler group.

9 months agoReboot in system workqueue, not ISR.
Christopher Collins [Fri, 26 Jan 2018 23:47:32 +0000 (15:47 -0800)] 
Reboot in system workqueue, not ISR.

9 months agoFix some misnamed identifiers.
Christopher Collins [Fri, 26 Jan 2018 23:46:06 +0000 (15:46 -0800)] 
Fix some misnamed identifiers.

9 months agoAdd missing license text.
Christopher Collins [Fri, 26 Jan 2018 23:45:20 +0000 (15:45 -0800)] 
Add missing license text.

9 months agoMake MCUMGR_CMD_FS_MGMT depend on FILE_SYSTEM.
Christopher Collins [Fri, 26 Jan 2018 23:45:00 +0000 (15:45 -0800)] 
Make MCUMGR_CMD_FS_MGMT depend on FILE_SYSTEM.

9 months agoRemove extraneous README.rst file.
Christopher Collins [Fri, 26 Jan 2018 23:44:11 +0000 (15:44 -0800)] 
Remove extraneous README.rst file.

This file belongs to the "Hello World" sample app in the Zephyr
repository.

9 months agoSample app - smp_svr
Christopher Collins [Thu, 18 Jan 2018 01:18:13 +0000 (17:18 -0800)] 
Sample app - smp_svr

9 months agoDocumentation.
Christopher Collins [Thu, 18 Jan 2018 01:16:10 +0000 (17:16 -0800)] 
Documentation.

9 months agoMynewt support.
Christopher Collins [Thu, 18 Jan 2018 01:15:59 +0000 (17:15 -0800)] 
Mynewt support.

9 months agoZephyr support.
Christopher Collins [Thu, 18 Jan 2018 01:15:18 +0000 (17:15 -0800)] 
Zephyr support.

9 months agocborattr library
Christopher Collins [Thu, 18 Jan 2018 01:13:14 +0000 (17:13 -0800)] 
cborattr library

This is used for parsing incoming mcumgr requests.  Destructures mcumgr
packets and populates corresponding field variables.

This comes from Apache Mynewt.

9 months agoOS-agnostic command handlers: fs, img, os.
Christopher Collins [Thu, 18 Jan 2018 01:12:52 +0000 (17:12 -0800)] 
OS-agnostic command handlers: fs, img, os.

9 months agoExternal tinycbor library.
Christopher Collins [Thu, 18 Jan 2018 01:11:54 +0000 (17:11 -0800)] 
External tinycbor library.

Note: This is commit 3ef6799f633df19a84b99ccd0f21fb8c02201690 of a PR
against the tinycbor library:
https://github.com/intel/tinycbor/pull/83

9 months agoExternal base64 library.
Christopher Collins [Thu, 18 Jan 2018 01:11:46 +0000 (17:11 -0800)] 
External base64 library.

9 months agosmp - The built-in transfer encoding.
Christopher Collins [Thu, 18 Jan 2018 01:11:12 +0000 (17:11 -0800)] 
smp - The built-in transfer encoding.

Simple management protocol.

9 months agomgmt - Code implementing the core `mgmt` layer.
Christopher Collins [Thu, 18 Jan 2018 01:11:06 +0000 (17:11 -0800)] 
mgmt - Code implementing the core `mgmt` layer.

The core of mcumgr; facilitates the passing of requests and responses
between the generic command handlers and the concrete transports and
transfer encodings.

9 months agoInitial commit.
Christopher Collins [Fri, 8 Dec 2017 00:55:48 +0000 (16:55 -0800)] 
Initial commit.