1.1 In the nRF Connect extension for VS Code, select Add a build configuration and add the board target for the device you are using (make sure to build without TF-M to minimize power consumption, this is the board target without /ns at the end). Then select Generate and Build.
When the build has completed, select Flash in the Actions window.
2. Set up the power measurement.
2.1 Connect the Power Profiler Kit II to your DK as you did in the previous exercise.
2.2 Open and configure the Power Profiler.
2.3 Press Start in the Power Profiler app to start the measurements, then press the RESET button on your DK.
In the Power Profiler, you should see the DK advertising with an advertising interval of 1 – 1.2 s.
3.2 In the nRF Connect for Mobile app, tap the Play/SCAN icon, in the upper right corner. Your smartphone will now act as a central device, scanning for any Bluetooth LE devices that are advertising in its presence.
3.3 Several Bluetooth-enabled devices around you start appearing.
Choose the one called DevAcademy_L4E2and tap Connect.
Observe the connection in the Power Profiler application. Note a connection interval of around 30 ms, consuming on average around 74 uA.
Note
Here you are using 1M PHY for the connection. You will update this to 2M PHY in the last step of this exercise to observe the effect on the power consumption.
4. Configure the preferred connection parameters.
Change the connection parameters, particularly the connection interval, to be much slower, to reduce the power consumption on your peripheral device (your Nordic DK).
Although the central ultimately determines the connection parameters, the peripheral can send a connection parameter update request to the central. The central can then choose to accept or reject.
Enabling the Kconfig option CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS will automatically send a connection parameter update request five seconds after the connection is established. The time is determined by the CONFIG_BT_CONN_PARAM_UPDATE_TIMEOUT Kconfig option that has a default value of 5000 ms.
Since the CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS Kconfig option is already enabled by default, you just need to set the preferred connection parameters.
CONFIG_BT_PERIPHERAL_PREF_MIN_INT and CONFIG_BT_PERIPHERAL_PREF_MAX_INT set the peripheral preferred minimum and maximum connection interval (in 1.25 ms units). Set this value to one second (800 * 1.25) to see activity between the connection intervals, and to decrease the overall power consumption.
CONFIG_BT_PERIPHERAL_PREF_LATENCY sets the peripheral preferred connection latency (peripheral latency).
CONFIG_BT_PERIPHERAL_PREF_TIMEOUT sets the peripheral preferred supervision timeout (in 10 ms units).
5. Build and flash the application to your DK.
Build and flash the updated application to your DK.
6. Establish a connection to your Nordic board.
In the nRF Connect for Mobile application, scan for devices and connect to your Nordic DK, just like in the previous step.
Observe the connection in the Power Profiler application. Notice that the connection begins with the same connection interval as before, 30 ms. After around five seconds, the connection parameter update request is sent and the connection events are less frequent.
The connection interval should now be one second and the application should be drawing around 5-6 µA, a decrease of 92% from the previous.
7. Define functions to update the data length and MTU.
Increase the MTU size without increasing the data length to observe what happens to the transmitted data packet.
CONFIG_BT_GATT_CLIENT enables support for the GATT Client role. This is enabled to allow the peripheral to initiate an MTU exchange with the central device. Even though this is a peripheral (GATT Server), it needs the GATT Client API to call that specific function bt_gatt_exchange_mtu().
CONFIG_BT_USER_DATA_LEN_UPDATE enables the application to initiate the Data Length Update Procedure.
CONFIG_BT_CTLR_DATA_LENGTH_MAX sets the maximum data length of PDU supported to 251.
CONFIG_BT_BUF_ACL_TX_SIZE sets the maximum supported ACL size of data packets sent from host to controller to 251.
CONFIG_BT_BUF_ACL_RX_SIZE sets the maximum supported ACL size of data packets sent from controller to host to 251.
CONFIG_BT_L2CAP_TX_MTU sets the maximum L2CAP MTU for L2CAP TX buffers to 247 (251 – 4 bytes for the header).
7.2 Define the function to request a data length update.
Update the connection transmit data length parameters using bt_conn_le_data_len_update(). Set the number of bytes and the amount of time to the maximum, by using the defined values BT_GAP_DATA_LEN_MAX and BT_GAP_DATA_TIME_MAX, which are set to 251 bytes and 17040 µs, respectively.
7.3 Define the function to request an MTU exchange.
After the connection is established, initiate an MTU exchange with the central to negotiate the highest possible MTU size supported by both sides. Use the bt_gatt_exchange_mtu() function.
7.3.1 Create the variable that holds the callback for MTU negotiation.
9.2 Define a function to send a large data packet over NUS.
Use bt_nus_send() to send the large data packet. Increment the first character of the data packet to observe from the central that it is in fact sending new packets.
11.1 In the nRF Connect for Mobile application, scan for devices and connect to your Nordic DK, just like in the previous step.
Observe the connection in the Power Profiler application. Notice that the connection begins with the same connection interval as before, 30 ms. But after around five seconds, the connection parameter update request is sent and the connection events are less frequent.
11.2 Subscribe to notifications.
To subscribe to notifications from the peripheral, tap on the three arrow symbol next to the TX Characteristic.
11.3 Observe the connection in the Power Profiler application.
Switch back to the Power Profiler application and observe the connection. The average power consumption is around 20 µA.
Zoom into one of the connection events. Observe that the packet has now been split into several small chunks, so the radio is switching between TX and RX several times during a single data transmission.
This is because the MTU is set to 244 bytes while the data length is still the default 27 bytes, so the package is split into 27-byte chunks to be sent over the air.
When notifications are enabled, the following two activities occur:
The smaller pulse (~2.5 mA) is the CPU waking up to process the timer expiry (loop_restart_timer) and queuing the notification data. This is purely CPU processing. No radio is involved.
The larger pulse (~5mA) is the actual radio connection event where the notification packet is transmitted over the air to the central. This involves powering up the radio, transmitting the data, and receiving the link-layer ACK.
11. Establish a connection to your Nordic board using the Bluetooth Low Energy app.
Using the nRF Connect for Mobile application as the central in these steps will not give the desired result, as the central will automatically update the data length and the PHY to improve efficiency.
Instead, use the Bluetooth Low Energy application in the nRF Connect for Desktop, and any of the development kits nRF52840 DK, nRF52840 Dongle or nRF52 DK as the Bluetooth LE radio for your computer.
11.1 Install and launch the Bluetooth Low Energy application from the nRF Connect for Desktop.
11.2 Click Select Device in the upper left corner and select your second DK.
Make sure it is plugged into your computer and turned on.
For the nRF52840 Dongle, make sure to put it into DFU mode first by pressing the RESET button that is on the far side of the board from the USB connector. Push it from the outside in, towards the USB connector.
The RGB light turns red with a fade pattern, indicating that the dongle is in DFU mode.
11.3 Program the device.
Click Yes in the prompt that pops up to program the device with the correct firmware
11.4 Start scanning and connect to the peripheral.
Under Discovered devices, select Start scan and connect to DevAcademy_L4E2when it shows up.
Observe the connection in the Power Profiler application. Notice that the connection begins with the same connection interval as before, 30 ms. After around five seconds, the connection parameter update request is sent and the connection events are less frequent.
11.5 Subscribe to notifications.
Subscribe to notifications from the peripheral, so that it can begin sending packets.
In the rows under DevAcademy_L4E2, click on UART over BLE and then click the Play icon next to UART TX.
11.6 Observe the connection in the Power Profiler application.
Switch back to the Power Profiler application and observe the connection. The average power consumption is around 20 µA.
Zoom into one of the connection events. Observe that the packet has now been split into several small chunks, so the radio is switching between TX and RX several times during a single data transmission.
This is because the MTU is set to 244 bytes while the data length is still the default 27 bytes, so the package is split into 27-byte chunks to be sent over the air.
When notifications are enabled, the following two activities occur:
The smaller pulse (~2.5 mA) is the CPU waking up to process the timer expiry (loop_restart_timer) and queuing the notification data. This is purely CPU processing. No radio is involved.
The larger pulse (~5mA) is the actual radio connection event where the notification packet is transmitted over the air to the central. This involves powering up the radio, transmitting the data, and receiving the link-layer ACK.
11.7 Disconnect from the peripheral before proceeding.
Before proceeding to the next step, click on the cogwheel next to DevAcademy_L4E2 and select Disconnect to disconnect from the device.
Enable the Data Length Extension and observe how it improves the power consumption.
12. Upon a successful connection, request a data length update.
Add the following line in connected() to request a data length update upon a successful connection:
Copy
request_data_len_update(current_conn);
C
13. Build and flash the application to your DK.
Build and flash the updated application to your DK.
14. Establish a connection to your Nordic board.
In the Bluetooth Low Energy application, start scanning for devices, connect to DevAcademy_L4E2, and subscribe to notifications just like in Step 11.
Switch back to the Power Profiler application and zoom into one of the connection events.
The connection event now takes around five seconds because the full packet can be sent in one transmission and consumes around 13 µC charge.
The highest cost with the link layer packet size set to 27 (without Data Length Extension) is not just extra header bytes; it is the radio on-time. Each LL packet requires a TX (data) and RX (ACK) event with 150 µs Inter Frame Space (IFS) between them. Without DLE, you get 10 TX/RX pairs instead of one, resulting in ~10× the radio active time for each notification, clearly visible as ~10 peak groups on the PPK2 seen in Step 11.6.
LL packet size (data length)
With DLE (251)
Without DLE (27)
Penalty
LL packets
1
10
10× more packets
Radio TX+RX events
1 TX + 1 RX
10 TX + 10 RX
10× more radio events
LL header overhead
2 B
20 B
+18 B
Total overhead
9 B
27 B
3× more
Total on-air
253 B
271 B
+7%
IFS gaps (150 µs each)
1
19
+2.7 ms
Radio on-time
1 TX/RX pair
10 TX/RX pairs
~10× longer
When you observe the full connection, the average power consumption is around 13 µA, a 35% decrease from before, by increasing the data length.
If you select just the TX part, it takes about two ms to transmit the full packet.
15. Request a PHY update to 2M PHY.
The base code of this exercise has the PHY request enabled already, to request a 1M PHY upon a connection for educational purposes. This is because some centrals (specifically nRF Connect for Mobile on iOS) will negotiate a 2M PHY to optimize the connection without the peripheral requesting it.
In the prj.conf file, the CONFIG_BT_USER_PHY_UPDATE Kconfig option is enabled, which allows the application to initiate the PHY update procedure. Note that the CONFIG_BT_AUTO_PHY_UPDATE option is enabled by the stack by default (unless CONFIG_BT_USER_PHY_UPDATE is enabled, which it is in this case), and will initiate the PHY update procedure on a connection establishment.
In the main.c file, with the function request_phy_update(), you request a PHY update using bt_conn_le_phy_update(). In this case, with the preferred PHY to 1 M.
Set the preferred TX and RX PHY to 2M PHY through pref_rx_phy and pref_tx_phy.
Replace the two lines with the following in request_phy_update():
Upon a successful connection, this function is called from connected() to request a PHY update.
16. Build and flash the application to your DK.
Build and flash the updated application to your DK.
17. Establish a connection to your Nordic board.
In the nRF Connect for Mobile (Android) or the Bluetooth Low Energy application (iOS), start scanning for devices, connect to DevAcademy_L4E2, and subscribe to notifications just like previously.
Switch back to the Power Profiler application and zoom into one of the connection events.
The data transmission now takes around one second with 2M PHY, instead of two seconds with 1M PHY. Because the throughput doubled, the time it takes to transmit the same amount of bytes is cut in half.
Looking at the full connection, the average power consumption is also reduced to around 13 µA.
Nordic Developer Academy Privacy Policy
1. Introduction
In this Privacy Policy you will find information on Nordic Semiconductor ASA (“Nordic Semiconductor”) processes your personal data when you use the Nordic Developer Academy.
References to “we” and “us” in this document refers to Nordic Semiconductor.
2. Our processing of personal data when you use the Nordic Developer Academy
2.1 Nordic Developer Academy
Nordic Semiconductor processes personal data in order to provide you with the features and functionality of the Nordic Developer Academy. Creating a user account is optional, but required if you want to track you progress and view your completed courses and obtained certificates. If you choose to create a user account, we will process the following categories of personal data:
Email
Name
Password (encrypted)
Course progression (e.g. which course you have completely or partly completed)
Certificate information, which consists of name of completed course and the validity of the certificate
Course results
During your use of the Nordic Developer Academy, you may also be asked if you want to provide feedback. If you choose to respond to any such surveys, we will also process the personal data in your responses in that survey.
The legal basis for this processing is GDPR article 6 (1) b. The processing is necessary for Nordic Semiconductor to provide the Nordic Developer Academy under the Terms of Service.
2.2 Analytics
If you consent to analytics, Nordic Semiconductor will use Google Analytics to obtain statistics about how the Nordic Developer Academy is used. This includes collecting information on for example what pages are viewed, the duration of the visit, the way in which the pages are maneuvered, what links are clicked, technical information about your equipment. The information is used to learn how Nordic Developer Academy is used and how the user experience can be further developed.
2.2 Newsletter
You can consent to receive newsletters from Nordic from within the Nordic Developer Academy. How your personal data is processed when you sign up for our newsletters is described in the Nordic Semiconductor Privacy Policy.
3. Retention period
We will store your personal data for as long you use the Nordic Developer Academy. If our systems register that you have not used your account for 36 months, your account will be deleted.
4. Additional information
Additional information on how we process personal data can be found in the Nordic Semiconductor Privacy Policy and Cookie Policy.
Nordic Developer Academy Terms of Service
1. Introduction
These terms and conditions (“Terms of Use”) apply to the use of the Nordic Developer Academy, provided by Nordic Semiconductor ASA, org. nr. 966 011 726, a public limited liability company registered in Norway (“Nordic Semiconductor”).
Nordic Developer Academy allows the user to take technical courses related to Nordic Semiconductor products, software and services, and obtain a certificate certifying completion of these courses. By completing the registration process for the Nordic Developer Academy, you are agreeing to be bound by these Terms of Use.
These Terms of Use are applicable as long as you have a user account giving you access to Nordic Developer Academy.
2. Access to and use of Nordic Developer Academy
Upon acceptance of these Terms of Use you are granted a non-exclusive right of access to, and use of Nordic Developer Academy, as it is provided to you at any time. Nordic Semiconductor provides Nordic Developer Academy to you free of charge, subject to the provisions of these Terms of Use and the Nordic Developer Academy Privacy Policy.
To access select features of Nordic Developer Academy, you need to create a user account. You are solely responsible for the security associated with your user account, including always keeping your login details safe.
You will able to receive an electronic certificate from Nordic Developer Academy upon completion of courses. By issuing you such a certificate, Nordic Semiconductor certifies that you have completed the applicable course, but does not provide any further warrants or endorsements for any particular skills or professional qualifications.
Nordic Semiconductor will continuously develop Nordic Developer Academy with new features and functionality, but reserves the right to remove or alter any existing functions without notice.
3. Acceptable use
You undertake that you will use Nordic Developer Academy in accordance with applicable law and regulations, and in accordance with these Terms of Use. You must not modify, adapt, or hack Nordic Developer Academy or modify another website so as to falsely imply that it is associated with Nordic Developer Academy, Nordic Semiconductor, or any other Nordic Semiconductor product, software or service.
You agree not to reproduce, duplicate, copy, sell, resell or in any other way exploit any portion of Nordic Developer Academy, use of Nordic Developer Academy, or access to Nordic Developer Academy without the express written permission by Nordic Semiconductor. You must not upload, post, host, or transmit unsolicited email, SMS, or \”spam\” messages.
You are responsible for ensuring that the information you post and the content you share does not;
contain false, misleading or otherwise erroneous information
infringe someone else’s copyrights or other intellectual property rights
contain sensitive personal data or
contain information that might be received as offensive or insulting.
Such information may be removed without prior notice.
Nordic Semiconductor reserves the right to at any time determine whether a use of Nordic Developer Academy is in violation of its requirements for acceptable use.
Violation of the at any time applicable requirements for acceptable use may result in termination of your account. We will take reasonable steps to notify you and state the reason for termination in such cases.
4. Routines for planned maintenance
Certain types of maintenance may imply a stop or reduction in availability of Nordic Developer Academy. Nordic Semiconductor does not warrant any level of service availability but will provide its best effort to limit the impact of any planned maintenance on the availability of Nordic Developer Academy.
5. Intellectual property rights
Nordic Semiconductor retains all rights to all elements of Nordic Developer Academy. This includes, but is not limited to, the concept, design, trademarks, know-how, trade secrets, copyrights and all other intellectual property rights.
Nordic Semiconductor receives all rights to all content uploaded or created in Nordic Developer Academy. You do not receive any license or usage rights to Nordic Developer Academy beyond what is explicitly stated in this Agreement.
6. Liability and damages
Nothing within these Terms of Use is intended to limit your statutory data privacy rights as a data subject, as described in the Nordic Developer Academy Privacy Policy. You acknowledge that errors might occur from time to time and waive any right to claim for compensation as a result of errors in Nordic Developer Academy. When an error occurs, you shall notify Nordic Semiconductor of the error and provide a description of the error situation.
You agree to indemnify Nordic Semiconductor for any loss, including indirect loss, arising out of or in connection with your use of Nordic Developer Academy or violations of these Terms of Use. Nordic Semiconductor shall not be held liable for, and does not warrant that (i) Nordic Developer Academy will meet your specific requirements, (ii) Nordic Developer Academy will be uninterrupted, timely, secure, or error-free, (iii) the results that may be obtained from the use of Nordic Developer Academy will be accurate or reliable, (iv) the quality of any products, services, information, or other material purchased or obtained by you through Nordic Developer Academy will meet your expectations, or that (v) any errors in Nordic Developer Academy will be corrected.
You accept that this is a service provided to you without any payment and hence you accept that Nordic Semiconductor will not be held responsible, or liable, for any breaches of these Terms of Use or any loss connected to your use of Nordic Developer Academy. Unless otherwise follows from mandatory law, Nordic Semiconductor will not accept any such responsibility or liability.
7. Change of terms
Nordic Semiconductor may update and change the Terms of Use from time to time. Nordic Semiconductor will seek to notify you about significant changes before such changes come into force and give you a possibility to evaluate the effects of proposed changes. Continued use of Nordic Developer Academy after any such changes shall constitute your acceptance of such changes. You can review the current version of the Terms of Use at any time at https://academy.nordicsemi.com/terms-of-service/
8. Transfer of rights
Nordic Semiconductor is entitled to transfer its rights and obligation pursuant to these Terms of Use to a third party as part of a merger or acquisition process, or as a result of other organizational changes.
9. Third Party Services
To the extent Nordic Developer Academy facilitates access to services provided by a third party, you agree to comply with the terms governing such third party services. Nordic Semiconductor shall not be held liable for any errors, omissions, inaccuracies, etc. related to such third party services.
10. Dispute resolution
The Terms of Use and any other legally binding agreement between yourself and Nordic Semiconductor shall be subject to Norwegian law and Norwegian courts’ exclusive jurisdiction.
Switch language?
Progress is tracked separately for each language. Switching will continue from your progress in that language or start fresh if you haven't begun.
Your current progress is saved, and you can switch back anytime.
•Support for nRF54LS05 DK (Available through the early access sampling program) •Support for the nRF54LM20B with Axon NPU for Edge AI applications
Bluetooth LE updates
•Quality of Service module is now production-ready. •New experimental features for RF testing (Direct Test Mode) and low-latency packet handling (LE Flushable ACL).
MCUboot & Partition Manager
•Single-Slot DFU and RAM Load mode are both promoted to fully supported •Partition Manager is officially deprecated in favor of Zephyr's devicetree-based partitioning.