dev academy course broken: BLE fundementals:esson 3 excersice 2

in
Bluetooth Low Energy Fundamentals -> lesson 3-> Exercise 2

I opened the solution, I built the config for nrf52840 dev kit. Problem: 2M PHY is not achieved.
Update to 2M phy only works when I comment out calls to   update_data_length(my_conn)and  update_mtu(my_conn);

SO step 13.5 breaks update_phy in a way that is stuck in 1mPHY. Ths print is 

[00:00:19.797,241] <inf> Lesson3_Exercise2: PHY updated. New PHY: 1M

    /* STEP 7.2 - Update the PHY mode */
    update_phy(my_conn);
    /* STEP 13.5 - Update the data length and MTU */
    update_data_length(my_conn);
    update_mtu(my_conn);
I am running nrf connect app on Samsung S24 Android 14
Would some one from team verify this?
Parents
  • Hi

    just figured out adding a delay would fix it. I am using SDK 2.9.0 btw.

        /* STEP 7.2 - Update the PHY mode */
        update_phy(my_conn);
        k_sleep(K_MSEC(1000));
        /* STEP 13.5 - Update the data length and MTU */
        update_data_length(my_conn);
        update_mtu(my_conn);
  • Hi klaus1234,

    The issue and the fix seem quite strange. Could you please include the full log when the issue happens?
    Please also include log from the nRF Connect app on the phone as well.

    Hieu

  • Hi

    sure here is the log:

    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    [00:00:00.000,366] <inf> Lesson3_Exercise2: Starting Lesson 3 - Exercise 2

    [00:00:00.000,701] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision:
                                                2d 79 a1 c8 6a 40 b7 3c  f6 74 f9 0b 22 d3 c4 80 |-y..j@.< .t.."...
                                                74 72 82 ba                                      |tr..             
    [00:00:00.003,021] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.003,051] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    [00:00:00.003,082] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 45.41337 Build 3074452168
    [00:00:00.004,058] <inf> bt_hci_core: Identity: CC:94:05:F6:12:B6 (random)
    [00:00:00.004,089] <inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x106b, manufacturer 0x0059
    [00:00:00.004,119] <inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x106b
    [00:00:00.004,119] <inf> Lesson3_Exercise2: Bluetooth initialized
    [00:00:00.005,126] <inf> Lesson3_Exercise2: Advertising successfully started
    [00:00:14.643,768] <inf> Lesson3_Exercise2: Connected
    [00:00:14.643,798] <inf> Lesson3_Exercise2: Connection parameters: interval 30.00 ms, latency 0 intervals, timeout 5000 ms
    [00:00:14.690,643] <inf> Lesson3_Exercise2: MTU exchange successful
    [00:00:14.690,643] <inf> Lesson3_Exercise2: New MTU: 244 bytes
    [00:00:14.780,700] <inf> Lesson3_Exercise2: Data length updated. Length 251/27 bytes, time 2120/328 us
    [00:00:14.930,603] <inf> Lesson3_Exercise2: PHY updated. New PHY: 1M
    [00:00:15.080,841] <inf> Lesson3_Exercise2: Connection parameters updated: interval 7.50 ms, latency 0 intervals, timeout 5000 ms
    [00:00:15.328,063] <inf> Lesson3_Exercise2: Connection parameters updated: interval 30.00 ms, latency 0 intervals, timeout 5000 ms
    [00:00:19.940,521] <inf> Lesson3_Exercise2: Connection parameters updated: interval 1000.00 ms, latency 0 intervals, timeout 4000 ms

    and the app:

    nRF Connect, 2025-02-13
    Nordic_Peripheral (CC:94:05:F6:12:B6)
    I 12:08:18.750 [Server] Server started
    V 12:08:18.753 Heart Rate (0x180D)
    - Heart Rate Measurement [N] (0x2A37)
       Client Characteristic Configuration (0x2902)
    - Body Sensor Location [R] (0x2A38)
    - Heart Rate Control Point [W] (0x2A39)
    Unknown Service (0000aaa0-0000-1000-8000-aabbccddeeff)
    - Unknown Characteristic [N R] (0000aaa1-0000-1000-8000-aabbccddeeff)
       Client Characteristic Configuration (0x2902)
       Unknown Descriptor (0000aab0-0000-1000-8000-aabbccddeeff)
       Characteristic User Description (0x2901)
       Characteristic Presentation Format (0x2904)
    - Unknown Characteristic [I W WNR] (0000aaa2-0000-1000-8000-aabbccddeeff)
       Client Characteristic Configuration (0x2902)
    User Data (0x181C)
    - First Name [R W] (0x2A8A)
    - Last Name [R W] (0x2A90)
    - Gender [R W] (0x2A8C)
    V 12:08:18.916 Connecting to CC:94:05:F6:12:B6...
    D 12:08:18.916 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D 12:08:18.994 [Server callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I 12:08:18.994 [Server] Device with address CC:94:05:F6:12:B6 connected
    I 12:08:18.995 [Server] MTU changed to 247
    D 12:08:19.005 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I 12:08:19.005 Connected to CC:94:05:F6:12:B6
    V 12:08:19.005 Discovering services...
    D 12:08:19.005 gatt.discoverServices()
    D 12:08:19.014 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    I 12:08:19.446 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D 12:08:19.591 [Callback] Services discovered with status: 0
    I 12:08:19.591 Services discovered
    V 12:08:19.594 Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    - Client Supported Features [R W] (0x2B29)
    - Database Hash [R] (0x2B2A)
    Generic Access (0x1800)
    - Device Name [R] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    Nordic LED Button Service (00001523-1212-efde-1523-785feabcd123)
    - Button [N R] (00001524-1212-efde-1523-785feabcd123)
       Client Characteristic Configuration (0x2902)
    - LED [W] (00001525-1212-efde-1523-785feabcd123)
    D 12:08:19.594 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    D 12:08:19.595 gatt.setCharacteristicNotification(00001524-1212-efde-1523-785feabcd123, true)
    I 12:08:19.689 Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 5000ms)
    I 12:08:24.982 Connection parameters updated (interval: 1000.0ms, latency: 0, timeout: 4000ms)
Reply
  • Hi

    sure here is the log:

    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    [00:00:00.000,366] <inf> Lesson3_Exercise2: Starting Lesson 3 - Exercise 2

    [00:00:00.000,701] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision:
                                                2d 79 a1 c8 6a 40 b7 3c  f6 74 f9 0b 22 d3 c4 80 |-y..j@.< .t.."...
                                                74 72 82 ba                                      |tr..             
    [00:00:00.003,021] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.003,051] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    [00:00:00.003,082] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 45.41337 Build 3074452168
    [00:00:00.004,058] <inf> bt_hci_core: Identity: CC:94:05:F6:12:B6 (random)
    [00:00:00.004,089] <inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x106b, manufacturer 0x0059
    [00:00:00.004,119] <inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x106b
    [00:00:00.004,119] <inf> Lesson3_Exercise2: Bluetooth initialized
    [00:00:00.005,126] <inf> Lesson3_Exercise2: Advertising successfully started
    [00:00:14.643,768] <inf> Lesson3_Exercise2: Connected
    [00:00:14.643,798] <inf> Lesson3_Exercise2: Connection parameters: interval 30.00 ms, latency 0 intervals, timeout 5000 ms
    [00:00:14.690,643] <inf> Lesson3_Exercise2: MTU exchange successful
    [00:00:14.690,643] <inf> Lesson3_Exercise2: New MTU: 244 bytes
    [00:00:14.780,700] <inf> Lesson3_Exercise2: Data length updated. Length 251/27 bytes, time 2120/328 us
    [00:00:14.930,603] <inf> Lesson3_Exercise2: PHY updated. New PHY: 1M
    [00:00:15.080,841] <inf> Lesson3_Exercise2: Connection parameters updated: interval 7.50 ms, latency 0 intervals, timeout 5000 ms
    [00:00:15.328,063] <inf> Lesson3_Exercise2: Connection parameters updated: interval 30.00 ms, latency 0 intervals, timeout 5000 ms
    [00:00:19.940,521] <inf> Lesson3_Exercise2: Connection parameters updated: interval 1000.00 ms, latency 0 intervals, timeout 4000 ms

    and the app:

    nRF Connect, 2025-02-13
    Nordic_Peripheral (CC:94:05:F6:12:B6)
    I 12:08:18.750 [Server] Server started
    V 12:08:18.753 Heart Rate (0x180D)
    - Heart Rate Measurement [N] (0x2A37)
       Client Characteristic Configuration (0x2902)
    - Body Sensor Location [R] (0x2A38)
    - Heart Rate Control Point [W] (0x2A39)
    Unknown Service (0000aaa0-0000-1000-8000-aabbccddeeff)
    - Unknown Characteristic [N R] (0000aaa1-0000-1000-8000-aabbccddeeff)
       Client Characteristic Configuration (0x2902)
       Unknown Descriptor (0000aab0-0000-1000-8000-aabbccddeeff)
       Characteristic User Description (0x2901)
       Characteristic Presentation Format (0x2904)
    - Unknown Characteristic [I W WNR] (0000aaa2-0000-1000-8000-aabbccddeeff)
       Client Characteristic Configuration (0x2902)
    User Data (0x181C)
    - First Name [R W] (0x2A8A)
    - Last Name [R W] (0x2A90)
    - Gender [R W] (0x2A8C)
    V 12:08:18.916 Connecting to CC:94:05:F6:12:B6...
    D 12:08:18.916 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D 12:08:18.994 [Server callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I 12:08:18.994 [Server] Device with address CC:94:05:F6:12:B6 connected
    I 12:08:18.995 [Server] MTU changed to 247
    D 12:08:19.005 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I 12:08:19.005 Connected to CC:94:05:F6:12:B6
    V 12:08:19.005 Discovering services...
    D 12:08:19.005 gatt.discoverServices()
    D 12:08:19.014 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    I 12:08:19.446 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D 12:08:19.591 [Callback] Services discovered with status: 0
    I 12:08:19.591 Services discovered
    V 12:08:19.594 Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    - Client Supported Features [R W] (0x2B29)
    - Database Hash [R] (0x2B2A)
    Generic Access (0x1800)
    - Device Name [R] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    Nordic LED Button Service (00001523-1212-efde-1523-785feabcd123)
    - Button [N R] (00001524-1212-efde-1523-785feabcd123)
       Client Characteristic Configuration (0x2902)
    - LED [W] (00001525-1212-efde-1523-785feabcd123)
    D 12:08:19.594 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    D 12:08:19.595 gatt.setCharacteristicNotification(00001524-1212-efde-1523-785feabcd123, true)
    I 12:08:19.689 Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 5000ms)
    I 12:08:24.982 Connection parameters updated (interval: 1000.0ms, latency: 0, timeout: 4000ms)
Children
No Data
Related