Want to understand API flow in BLE-DFU

Hello,

With reference to the nordic tutorial : https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu#:~:text=on%20the%20nRF5340-,DFU%20over%20Bluetooth,-Modify%20the%20Peripheral

I saw the code which has mostly connection handlers and LED functionality.

I need to understand where I can place a breakpoint to see data chunks of firmware file being sent from mobile app over BLE are received by the device.

I want to understand which BT APIs support in BLE data exchange once connection is completed.

Thanks,

Ubaid

Parents Reply Children
  • Thanks ,

    If I want to print or see the data packets incoming during BLE DFU.

    Can you suggest which API in "smp_bt.c" can hold the breakpoint or add print statements..?

    I know it may slow and crash the thing, but for understanding I need to deep dive in code.

    Thanks,

  • Hi Mohammed, 
    If you want to print out the log of the BLE DFU packet transmitted between the DFU mater and the target you can focus on these functions in smp_bt.c : 

    smp_bt_chr_write() : is the call back when the master (phone) send BLE packet to the target
    smp_bt_tx_pkt() is when the DFU target send response back to the phone. 

    If you add a breakpoint inside these, it will most likely break the connection. But if you only print out the log, it should be fine. 

    I would also suggest to use the sniffer : https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le to capture the BLE DFU communication. It can be easier than looking at the log. 
    If you want to understand the SMP protocol, I would also suggest trying the SMP DFU via UART. You can very easily inspect the communication with a logic analyzer. You can start with a very small image to update. After you get an overview of how the SMP DFU work, you can then compare it with the BLE DFU sniffer trace and then can dissect the BLE communication to match it with the SMP protocol. 
Related