I am currently implementing the protocol for a serial DFU, following the instructions given here:
The general flow I implemented is:
Get MTU (0x07) --> Select Command Object (0x06 0x01) --> Create Command Object (0x01 0x01) --> Write up to MTU bytes of data (0x08 XX .... XX) --> Execute Command (0x04)
Up to "Execute Command" everything seems to work perfectly fine. The problem is, I do not get any response on the execute command - neither a "Response Execute Success" nor any failure.
Do you have any idea, what I am doing wrong here?
Are you sending ALL of the .dat file Bytes before calling Execute?
Yes I do, I have a .dat file of size 135 Bytes. Wrapping it with "Write ID (0x08)" + Slip encoding I have a total size of 138 Bytes which I am transmitting via UART to nRF.
As far as I could see I have max MTU size of 33024 Bytes (is it possible that I am exchanging big endian with little endian?). However, even half of the MTU size means I can transfer .dat file completely at once.
Might here be some issue?
Okay I got some new information:
It was a good hint to ask whether really all bytes are transmitted via "Write" command.
I changed the interpretation of "Get MTU" response into little endian --> 0x00 0x81 --> resulting in 129 Bytes (before I interpreted as 0x81 0x00 --> 32k).
With "Create Command Object" I actually reserve the space I need for the .dat file (which is 135 Bytes). Is that enough or do I need to reserve space for the whole slip encoded message (in this case 141 bytes)?
However, I tried with creating 141 Bytes command object and now I do receive response for "Execute" command:
DFU ERROR OPCODE <0x4 0x8> OPERATION_NOT_PERMITTED
Now the question is, why is this operation not permitted?
(when I tried with creating 135 Bytes command object, again I do not receive any response after execute command)
For Create Command Object, use the non-slip-encoded size.The best way to see what's happening is to see the bootloader's logs - RTT is built in to the examples.
Also, refer to this file for the host-side details: github.com/.../dfu_transport_serial.py
Actually I was trying some time to get RTT logs.. unfortunately after starting Segger RTT Logger I only get a screen saying "Searching for RTT Control Block"..
Any idea how I can enable RTT logging?