This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Where is ble_dfu.py?

I found ble_dfu.py referenced in some posts to help automate the generation of an application.dat metadata file used (along with the application.hex file) to create the input to the DFU bootloader can use.

I can't seem to find it any more, however. Is there a place I can go to download it? GitHub? nordicsemi.com?

Parents
  • The ble_dfu.py script you are referring to is the file in the SDK (as RK mentions)

    ./nRF51_SDK_7.2.0/examples/dfu/ble_dfu_send_hex/dfu/ble_dfu.py
    

    This is the same script that is used by Master Control Panel (Windows) to parse the hex file. However, what I think you are referring to is a modification to this script that saves the resulting .bin and .dat files to disk. This means that you can do a DFU through the windows version of MCP and then use the parsed files in the Android version of MCP, without having to go through the process of generating these files. (The generation process is described here: github.com/.../init packet handling)

    The modified ble_dfu.py file is posted in Stefans answer in this post. Under update 16.12.2014. Simply replace the ble_dfu.py file in MCP lib folder:

    \Nordic Semiconductor\Master Control Panel\3.7.1.8567\lib\dfu
    

    When you initiate a DFU through MCP an application.bin and an ini.dat file is saved to the root folder of MCP.

    The only thing that is added to the script are these lines:

    In _get_application_bin_array() :

    f = open("application.bin","wb+")
    f.write(bytearray(app_bin_array))
    f.close()
    

    And in dfu_send_image() :

    f = open("ini.dat","wb+")
    f.write(bytearray(init_packet))
    f.close()
    
Reply
  • The ble_dfu.py script you are referring to is the file in the SDK (as RK mentions)

    ./nRF51_SDK_7.2.0/examples/dfu/ble_dfu_send_hex/dfu/ble_dfu.py
    

    This is the same script that is used by Master Control Panel (Windows) to parse the hex file. However, what I think you are referring to is a modification to this script that saves the resulting .bin and .dat files to disk. This means that you can do a DFU through the windows version of MCP and then use the parsed files in the Android version of MCP, without having to go through the process of generating these files. (The generation process is described here: github.com/.../init packet handling)

    The modified ble_dfu.py file is posted in Stefans answer in this post. Under update 16.12.2014. Simply replace the ble_dfu.py file in MCP lib folder:

    \Nordic Semiconductor\Master Control Panel\3.7.1.8567\lib\dfu
    

    When you initiate a DFU through MCP an application.bin and an ini.dat file is saved to the root folder of MCP.

    The only thing that is added to the script are these lines:

    In _get_application_bin_array() :

    f = open("application.bin","wb+")
    f.write(bytearray(app_bin_array))
    f.close()
    

    And in dfu_send_image() :

    f = open("ini.dat","wb+")
    f.write(bytearray(init_packet))
    f.close()
    
Children
No Data
Related