apache / mynewt-mcumgr

Apache mynewt
https://mynewt.apache.org/
99 stars 76 forks source link

Zephyr build don't find mcumgr source_list #164

Closed Thisora closed 2 years ago

Thisora commented 2 years ago

Hi ! I'm trying to use mcumgr on Zephyr to upload new app image. I added every dependency in my configuration and i'm still not able to upload image. First thing is i have the following warning at compilation:

CMake Warning at /Users/mathis/workspace/zephyr_bl/zephyr/CMakeLists.txt:809 (message):
  No SOURCES given to Zephyr library:
  subsys__mgmt__mcumgr__lib__cmd__zephyr_basic

  Excluding target from build.

I decided to test anyway at first the echocommande : mcumgr -c uart1 echo hello -l debug which return this :

DEBU[2022-10-27 09:17:52.792] Using connection profile: name=uart1 type=serial connstring=/dev/cu.usbserial-DA008GQR,baud=115200,mtu=256 
DEBU[2022-10-27 09:17:52.797] {add-nmp-listener} [serial_sesn.go:213] seq=66 
DEBU[2022-10-27 09:17:52.797] Encoded &{NmpBase:{hdr:{Op:2 Flags:0 Len:0 Group:0 Seq:66 Id:0}} Payload:hello} to:
00000000  a1 61 64 65 68 65 6c 6c  6f                       |.adehello| 
DEBU[2022-10-27 09:17:52.797] Encoded:
00000000  02 00 00 09 00 00 42 00  a1 61 64 65 68 65 6c 6c  |......B..adehell|
00000010  6f                                                |o| 
DEBU[2022-10-27 09:17:52.797] Tx NMP request: 00000000  02 00 00 09 00 00 42 00  a1 61 64 65 68 65 6c 6c  |......B..adehell|
00000010  6f                                                |o| 
DEBU[2022-10-27 09:17:52.797] Base64 encoding request:
00000000  02 00 00 09 00 00 42 00  a1 61 64 65 68 65 6c 6c  |......B..adehell|
00000010  6f                                                |o| 
DEBU[2022-10-27 09:17:52.797] Tx serial
00000000  06 09                                             |..| 
DEBU[2022-10-27 09:17:52.797] Tx serial
00000000  41 42 4d 43 41 41 41 4a  41 41 42 43 41 4b 46 68  |ABMCAAAJAABCAKFh|
00000010  5a 47 56 6f 5a 57 78 73  62 38 45 4a              |ZGVoZWxsb8EJ| 
DEBU[2022-10-27 09:17:52.797] Tx serial
00000000  0a                                                |.| 
DEBU[2022-10-27 09:17:52.805] Rx serial:
00000000  06 09 41 42 6b 44 41 41  41 50 41 41 42 43 41 4c  |..ABkDAAAPAABCAL|
00000010  39 69 63 6d 4d 49 59 33  4a 7a 62 6d 51 65 42 39  |9icmMIY3JzbmQeB9|
00000020  41 45 2f 37 37 6a                                 |AE/77j| 
DEBU[2022-10-27 09:17:52.805] Decoded input:
00000000  03 00 00 0f 00 00 42 00  bf 62 72 63 08 63 72 73  |......B..brc.crs|
00000010  6e 64 1e 07 d0 04 ff                              |nd.....| 
DEBU[2022-10-27 09:17:52.805] rx nmp response: 00000000  03 00 00 0f 00 00 42 00  bf 62 72 63 08 63 72 73  |......B..brc.crs|
00000010  6e 64 1e 07 d0 04 ff                              |nd.....| 
DEBU[2022-10-27 09:17:52.805] Received nmp rsp: &{NmpBase:{hdr:{Op:3 Flags:0 Len:15 Group:0 Seq:66 Id:0}} Payload: Rc:8} 
DEBU[2022-10-27 09:17:52.805] {remove-nmp-listener} [serial_sesn.go:213] seq=66 

Something is returned but not 'hello' as expected. Just in case i tested to upload an image and progress bar is stuck at 0% and sometimes device respond the following message:

DEBU[2022-10-27 09:20:07.817] Rx serial:
00000000  06 09 41 42 6b 44 41 41  41 50 41 41 47 69 41 62  |..ABkDAAAPAAGiAb|
00000010  39 69 63 6d 4d 49 59 33  4a 7a 62 6d 51 65 42 39  |9icmMIY3JzbmQeB9|
00000020  41 45 2f 31 4c 34                                 |AE/1L4| 
DEBU[2022-10-27 09:20:07.817] Decoded input:
00000000  03 00 00 0f 00 01 a2 01  bf 62 72 63 08 63 72 73  |.........brc.crs|
00000010  6e 64 1e 07 d0 04 ff                              |nd.....| 
DEBU[2022-10-27 09:20:07.817] rx nmp response: 00000000  03 00 00 0f 00 01 a2 01  bf 62 72 63 08 63 72 73  |.........brc.crs|
00000010  6e 64 1e 07 d0 04 ff                              |nd.....| 
DEBU[2022-10-27 09:20:07.817] Received nmp rsp: &{NmpBase:{hdr:{Op:3 Flags:0 Len:15 Group:1 Seq:162 Id:1}} Rc:8 Off:0} 
DEBU[2022-10-27 09:20:07.818] {remove-nmp-listener} [serial_sesn.go:213] seq=162 
DEBU[2022-10-27 09:20:07.818] missed? off 0 count -2 

Finally when i try to use another command (mcumgr .... image list) I have Error : 8 response.

Zephyr version : 3.2.99 Thank you in advance for your help !

Thisora commented 2 years ago

Okey, i was able to correct warning by adding CONFIG_MCUMGR_GRP_BASIC_CMD_STORAGE_ERASE=y option in my proj.conf which is i didn't want but at least problem do not come from this warning.

Thisora commented 2 years ago

Okey i got this working. Nothing did call <...>_register_group(); I couldn't use exemple because i'm using rp2040 boards and i wrote my own example. I didn't noticed that i have to manually register handlers in my application.