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

Upload application via BLE

Hi, I'm trying to create a PC Python script that upload an application on NRF52 via BLE.

I flashed the NRF52 with this S132/DFU/Application: nRF5_SDK_11.0.0_89a8197/examples/ble_peripheral/ble_app_hrs/pca10040/s132_with_dfu. (Application with DFU service)

I created a zip file that contains my application (a simple blink)app_blink_package1.zip

I tried the zip file using the Android App NRFToolbox and it works.

Now I want to upload the hex file nrf52832_xxaa_s132_blinky_500.hex (the same of the zip file) with the PC and BlueZ gatttool using this python script dfu_debug.py

But I can't switch to DFU mode using Gatttool.

I'm following this guide: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk52.v0.9.2%2Fbledfu_appswitching.html but I don't understand what is the command for this operation: "Next, you must write the value 01-XX (where XX is the code for the type of image, see DFU Control Point) to the DFU Control Point to start a DFU procedure" In the Android App NRFToolBox I saw this message on the logcat: (Sending Start DFU command (Op Code = 1, Upload Mode = 4) but I can't recreate it with gatttool.

I'm using this command to enable cccd: char-write-req 0x11 0100 but it replies fail

I tried also nRF5_SDK_11.0.0_89a8197/examples/dfu/bootloader/pca10040/dual_bank_ble_s132/armgcc that is only the DFU. In this way gatttool (via dfu_debug.py above) returns OK for each command, except for the last commands after sending the image file, and at the end of the procedure the application doesn't work. Here the log: log_blink.txt

Where is my mistake? Thanks.

Parents
  • From the DFU mode I uploaded via Android NRFToolbox the application ble_app_hrm_dfu_s132_v2_0_0_sdk_11_0_all_in_one in the folder pca10040, that should be an application with DFU service and I have the same issue, via Android App the OTA via BLE works but via PC and gatttool the OTA doesn't work. Anyway, thanks so much for your suggestion of the sniffer, I'll try it immediately. About the Master Control Panel instead it replies me that "Port is closed" and I don't understand how can I work with it.

Reply
  • From the DFU mode I uploaded via Android NRFToolbox the application ble_app_hrm_dfu_s132_v2_0_0_sdk_11_0_all_in_one in the folder pca10040, that should be an application with DFU service and I have the same issue, via Android App the OTA via BLE works but via PC and gatttool the OTA doesn't work. Anyway, thanks so much for your suggestion of the sniffer, I'll try it immediately. About the Master Control Panel instead it replies me that "Port is closed" and I don't understand how can I work with it.

Children
No Data
Related