-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Discussed in #76302
Originally posted by epc-ake July 25, 2024
Has anyone managed to use mcumgr
over udp
on a esp32s3
?
I'm developing on an esp32s3_devkitm
and want to enable OTA firmware updates using mcumgr and mcuboot over a UDP
interface. To experiment with this, I modified the prj.conf
file of the samples/net/wifi example
to enable mcuboot
and mcumgr
. See the attached file for details. prj.conf
After flashing the firmware and connecting to a Wi-Fi network, I can retrieve image information using the go-app
and AuTerm
. For example, with the go-app
:
mcumgr --conntype udp --connstring=[x.x.0.60]:1337 image list
Images:
image=0 slot=0
version: 0.0.0
bootable: true
flags: active confirmed
hash: 60e5eb52f59451a3db2ec9e978b13c0c8485577dd6787684e216069341bdf80b
Split status: N/A (0)
However, when I try to upload an image, the firmware becomes unresponsive and freezes:
./mcumgr --conntype udp --connstring=[x.x.0.60]:1337 image upload zephyr.signed.bin
# starts freezing...
Output zephyr:
*** Booting Zephyr OS build 065fa94c79e5 ***
[00:00:00.241,000] <inf> smp_udp: Started (IPv4)
uart:~$ wifi connect -s ***** -p ***** -k 1
Connection requested
Connected
# requesting image info
[00:00:17.353,000] <inf> net_dhcpv4: Received: x.x.0.60
[00:00:24.301,000] <dbg> mcumgr_img_grp: img_mgmt_active_slot: (0) => 0
[00:00:24.302,000] <inf> mcuboot_util: Image index: 0, Swap type: none
[00:00:24.302,000] <dbg> mcumgr_img_grp: img_mgmt_get_next_boot_slot: (0, *) => slot = 0, type = 0
[00:00:24.302,000] <dbg> mcumgr_img_grp: img_mgmt_active_slot: (0) => 0
uart:~$ # doing image update -> freezing...
I ran the debugger in parallel, and when I interrupted GDB (Ctrl+C) after the firmware started freezing, it pointed to _DoubleExceptionVector.
Output GDB:
Info : [esp32s3.cpu0] Target halted, PC=0x403743C0, debug_reason=00000000
[esp32s3.cpu0] Target halted, PC=0x403743C0, debug_reason=00000000
Info : Set GDB target to 'esp32s3.cpu0'
Set GDB target to 'esp32s3.cpu0'
Info : [esp32s3.cpu1] Target halted, PC=0x40043A40, debug_reason=00000000
[esp32s3.cpu1] Target halted, PC=0x40043A40, debug_reason=00000000
Program received signal SIGINT, Interrupt.
_DoubleExceptionVector () at /zephyrproject/zephyr-epc/arch/xtensa/core/xtensa_asm2_util.S:525
Uploading over serial
works without any issues, so it seems to be specifically related to the UDP interface.
Does anyone have any ideas on how to debug this?