MCUMgr sample was failing to build due to including a deprecated header.
Replace it with the new header file to fix the build.
Fixes#41050
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The commit adds CONFIG_OS_MGMT_TASKSTAT_ONLY_SUPPORTED_STATS
Kconfig option that disables code filling in task statistics, for
mcumgr command `taskstat`, that are not collected or supported by
Zephyr.
Setting this option to y will skip following statistics in response:
"runtime", "cswcnt", "last_checkin" and "next_checkin".
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Since 581c20e242 ("drivers: uart: Cleanup not supported API handling")
uart_fifo_read() returns -ve on errors. Correct the check on its return
value to work with this new API.
CID: 240662
Fixes: #39840
Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
The commit fixes the issue where duplicated code in
img_mgmt_impl_upload_inspect caused redirecting all image uploads,
in multi-image configuration, to the first image.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit adds Kconfig options that enables "frugal status list";
when enabled, the status list will be sent with zero, empty and false
values omitted, slightly reducing number of bytes sent as response
from device.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
References to Mynewt have been removed and README for Zephyr has been
merged directly to the README.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit removes MYNEWT sepcific code and code that has been
conditionally compiled with "ifndef _ZEPHYR_".
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit copies code of mcumgr, as a lib, under subsys/mgmt/mcumgr.
Only source files relevant for Zephyr have been copied, and changes
to source files have been limited only to path changes, where
required.
Samples have been left out as the only relevant sample, smp_svr,
is already within Zephyr source tree.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The mcumgr_serial_parse_op has been called to extract marker and
check if it is valid, just for the caller mcumgr_serial_process_frag
to process the marker again.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit fixes problem with UART TX frame processing, which was
caused by incorrect output buffer size evaulation, where input buffer
of certain len would cause entire output frame to be filled with no
place left for CRC causing a transmission to hang.
The commit, additionally, moves input buffer reminder processing out of
the input buffer processing loop.
Fixes#37893
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Removed some of variables used within the function, and some of
the redundant arithmetic operations.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit adds missing static to the zephyr_smp_alloc_rsp
function definition; it also reorders some of definitions
and removes no longer needed block of forward declarations
of functions.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Allow SMP messages to be sent from user space.
For example, a user defined command can be sent when a value changes
so the client doesn't have to poll.
Signed-off-by: Andrew Hedin <andrew.hedin@lairdconnect.com>
The commit adds IMG_MGMT_UPDATABLE_IMAGE_NUMBER Kconfig option, int,
that allows to select how many images are supported by mcumgr.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Add a warning if the image is unconfirmed. Add a delay before rebooting
so that the user knows what happened.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
The current HAWKBIT_PROBE & HAWKBIT_PROBE_DEPLOYMENT_BASE response
handlers aren't able to handle multipacket response from Hawkbit
server. This commit fixes it by using the implementation from
HAWKBIT_DOWNLOAD.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Signed-off-by: Joep Buruma <burumaj50@gmail.com>
The commit adds CONFIG_IMG_MGMT_DIRECT_IMAGE_UPLOAD that allows
to turn on the direct image upload.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The #36758 fixes coap_packet_get_payload function by normalizing
offset value in the library. That change create a regression on
UpdateHub. However, the UpdateHub can now use coap_packet_get_payload
function instead manually compute payload start and payload size.
This refactors the current code in favor of coap_packet_get_payload
and fixes the regression.
Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Compute the SHA256 hash of the downloaded image and compare that with
the hash in the deploymentBase to guarantee that only the correctly
downloaded image will be flashed.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Use a semaphore to prevent the hawkbit_probe from running more than once
at the same time since it reset the hawkbit context on entry and will
affect other running instance.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Fix multiple typos and make the sample's log output consistent
with the subsys.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Co-Authored-By: Sylvio Alves <sylviojalves@gmail.com>
This migrates all the current iterable section usages to the external
API, dropping the "Z_" prefix:
Z_ITERABLE_SECTION_ROM
Z_ITERABLE_SECTION_ROM_GC_ALLOWED
Z_ITERABLE_SECTION_RAM
Z_ITERABLE_SECTION_RAM_GC_ALLOWED
Z_STRUCT_SECTION_ITERABLE
Z_STRUCT_SECTION_ITERABLE_ALTERNATE
Z_STRUCT_SECTION_FOREACH
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The local function has been missing static specifier.
The commit also removes unused STORAGE_MGMT_ID_ERASE define.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
When downloading large files from the hawkbit server
the only time rsp->body_start is checked is on the
first call. After this it is never checked again.
This caused the wrong data to be written to flash
and a failed update.
Signed-off-by: Joep Buruma <burumaj50@gmail.com>
SMP implementation across bt/udp does not check
if allocation of the buffer was successful.
If the buffer is not granted an error shall be
returned.
This patch fixes BUS FAULT issue when NULL
pointer is referenced.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
The commit adds support for Zephyr basic mgmt group to mcumgr.
The first command added to the group is storage erase command.
Authored-by: Sigvart Hovland <sigvart.hovland@nordicsemi.no>
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Use UUID encode macro fro 128-bit UUIDs for readability. This makes
it easier to see which service you are working with as the
bt_uuid_to_str prints the 128-bit UUIDs in this format.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
The commit adds information to Kconfig options:
MCUMGR_CMD_SHELL_MGMT and MCUMGR_BUF_SIZE
on how the SHELL_BACKEND_DUMMY_BUF_SIZE value impacts them.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
smp_shell_process() is called only once after receiving new bytes over
shell. If multiple MCUMGR frames were received over UART one after the
other, then calling smp_shell_process() resulted in consuming only the
first one. All subsequent frames were not processed unless there was
some more RX traffic.
Process received frames in smp_shell_process() in a loop until there is
no frame left. This will make sure that received packets are not stalled
waiting for more RX traffic to trigger processing again.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Reboot functionality has nothing to do with PM, so move it out to the
subsys/os folder.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Replace all existing deprecated API with the recommended alternative.
Fixes: #34101
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>