smp_client_ble does not work

I have been trying to implement a DFU OTA using Bluetooth Low Energy from one nRF52840 DK to another nRF52840 DK using the smp_client_ble (https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/client_smp/smp_client_ble) and the smp_svr sample. The smp_client_ble would not work because the function zcbor_new_decode_state() has missing parameters, and after examining the sample central_smp_client (https://github.com/nrfconnect/sdk-nrf/tree/main/samples/bluetooth/central_smp_client) I changed the following for every zcbor_new_decode_state():

zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), smp_rsp_buff.payload, payload_len, 5);
to 
zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), smp_rsp_buff.payload, payload_len, 5, NULL, 0);
I also changed the function zcbor_tstr_put_term(), also referring to how it was done in central_smp_client:
zcbor_tstr_put_term(zse, string);
 
to
zcbor_tstr_put_term(zse, string, string_max_len);
The smp_client_ble now runs and connects to the other DK with the smp_svr running, however I am still unable to list the images or do the DFU.
Here is the serial output of the client when I press Button 1 to list the images:
-----------PRIMARY IMAGE-----------
      slot: 0
* buffer overflow detected *
[00:00:55.241,424] <err> os: esf_dump: r0/a1:  0x00000002  r1/a2:  0x00000003  r2/a3:  0x00000002
[00:00:55.241,455] <err> os: esf_dump: r3/a4:  0x00000005 r12/ip:  0x00000004 r14/lr:  0x0002262d
[00:00:55.241,455] <err> os: esf_dump:  xpsr:  0x41000000
[00:00:55.241,485] <err> os: esf_dump: Faulting instruction address (r15/pc): 0x00022638
[00:00:55.241,516] <err> os: z_fatal_error: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
[00:00:55.241,546] <err> os: z_fatal_error: Current thread: 0x20002170 (unknown)
�*** Booting nRF Connect SDK 3758bcbfa5cd ***atal_error_handler: Resetting system
It successfully prints the first two lines before a buffer overflow happens.
Here is the serial output when I press Button 2 on the client to do a DFU:
client output:
 --- 10 messages dropped ---
                                        | (0/499712 bytes)Error in image upload response: 1
server output:
[00:00:57.971,801] <err> mcumgr_img_grp: Upload too large for slot: 499712 > 487424
[00:00:57.971,801] <err> mcumgr_img_grp: Image upload inspect failed: 30
I don't really understand how ZCBOR works, what could be the cause for this?
Regards,
Omar
Note: I have attached the modified smp_client_ble below:
Related