This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

dfu.py with Nordic nrf51822

Hi,

I want to do the application DFU with nrf51822 in Python.

The application code I use is dfu_test_app_hrm_s130.zip in nRF51_SDK_10.0.0

As I know, the .bin file is the application and the .dat file is init file.

For example, I sent the commands by gatttool, and I got 10-02-01 correctly.

> char-write-req 0x0010 0200
> char-write-req 0x000e hex-str-of-dfu_test_app_hrm_s130.dat
> char-write-req 0x0010 0201
Notification handle = 0x0010 value: 10 02 01

And then I ran my dfu.py which sent this commands to the device, I got the Invalid State Response(10-02-02), and the connection broke.

But when I ran it again immediately, the Notification handle was 10-02-01 and the program worked well. The nrf51822 board validated the received firmware ,activated it and restarted as a HRM device.

What's wrong with it? Is there anything I lose? How can I fix it ?

Besides, I saw the Control Point OpCode of Response is 16 in the Nordic Semiconductor Documents, like here, but the response code I received is 10. What is the difference between 10 and 16?

Thanks.

Related