Hi,
What is the best way to send image from one nrf5340 that is central to other nrf5340 that is peripheral in order to update him via
Hi,
What is the best way to send image from one nrf5340 that is central to other nrf5340 that is peripheral in order to update him via
I added the echo command to my code.
How to implement other commands?
For example Reset or Upload the image?
Where is an documentation for this(op,flags,id, payload types)?
Thanks
Thank, waiting for update
Thanks for update
I've now put the app_update.bin file into flash of the device running the central_smp_client sample, then I read out the first 32 bytes containing the image header and sends it to the device running the smp_svr sample. The smp_svr side sends an image upload response in return, with "rc"=0 and "off"=32.
Amazing.
if it is ok i can also test it on my side, i have an image stored at the external flash that i downloaded and i can read data and send it.
You can attach a code for this.
Check it out here: https://github.com/simon-iversen/ncs_samples/tree/master/central_smp_client_dfu
The code is really messy and not cleaned up at all. Sorry about that. I'm using nRF52840 DK on both sides by the way, but I don't think that should matter.
Then you should receive 0x300c0101bf6272630636f66661820ff in response.
You can see these bytes by adding the following piece of code to C:\v2.0.0\nrf\subsys\bluetooth\services\dfu_smp.c--notify_process()
printk("Received %d amount of bytes\n", length); printk("Bytes: 0x"); for(int x = 0;x < length; x++){ printk("%x", ((uint8_t *)data)[x]); } printk("\n");
Currently I'm struggling to parse the response in the app itself (using this method). But using cbor.me I'm able to see that the received data corresponds to this:
300c0101bf → ???
627263 → "rc"
0 → 0
636f6666 → "off"
1820 → 32 (unsigned(32))
ff → end of packet I think
So you can see that it contains rc=0 and off=32
Let me know if you achieve any progress.
Now I'm able to parse the incoming image upload CBOR response in the central_smp_client sample. So to complete the image upload command, I just need to repeat the process and send all of image chunks.
Now I'm able to parse the incoming image upload CBOR response in the central_smp_client sample. So to complete the image upload command, I just need to repeat the process and send all of image chunks.