Solution: mcumgr not working in MacOs

Hello,
I've seen a problem with mcumgr where we get this error : 

mcumgr image upload panic: runtime error: slice bounds out of range [:-62]
 on MacOs (the problem exist since Big Sur I believe).

mcumgr is wrapper around newtmgr and source for newtmgr have been updated, we just need to download source, update dependencies and build it:
Here are the commands:

# Clone repo
git clone https://github.com/apache/mynewt-mcumgr-cli.git
# Build
cd mynewt-mcumgr-cli/mcumgr
go get -u mynewt.apache.org/newt
go get -u mynewt.apache.org/newtmgr
go get -u
go build
# Mv to go bin
GOPATH=$(which go)
# sudo cp mcumgr $GOPATH/bin # To install for all users
sudo cp mcumgr ~/go/bin
# Remove repo
cd ../../
rm -rf mynewt-mcumgr-cli

And mcumgr should then work as intended. You could even speedup uploading by changing the MTU with flag -m

Related