Here are the steps to install Zephyr in Linux to start developing in the nRF54L15-DK development kit by Nordic Semiconductor. The following commands in the terminal outline the installation steps:
sudo apt update
sudo apt upgrade
sudo apt install --no-install-recommends git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget python3-dev python3-venv python3-tk xz-utils file make gcc libsdl2-dev libmagic1
python3 -m venv venv
source venv/bin/activate
(venv) pip install west
(venv) west init zephyrproject
(venv) cd zephyrproject
(venv) west update
(venv) west zephyr-export
(venv) west packages pip --install
(venv) cd zephyr
(venv) west sdk install
Install nrfutil from this link for Linux (x64). Once its downloaded change the permissions and execute it. (sudo chmod 777 nrfutil). Check the version and add it to the path in your system (.bashrc)
(venv) nrfutil self-upgrade
(venv) nrfutil install nrf5sdk-tools
(venv) sudo apt install libusb-1.0-0
(venv) nrfutil install sdk-manager
(venv) nrfutil install device
Also please download the following JLink_Linux_V864_x86_64.deb and install it.
Connect the nRF54L15-DK development kit via the usb cable to the host. Now we are ready to build one of the examples in the Zephyr framework inside the zephyr directory,
(venv) /zephyr/zephyrproject/zephyr$ west build -p always -b nrf54l15dk/nrf54l15/cpuapp samples/basic/blinky_pwm
Finally download the executable to the nRF54L15-DK development kit,
(venv) /zephyr/zephyrproject/zephyr$ west flash
At this point you should see LED 1 flashing at different duty cycles,
You can use minicom or other serial program to see the output via the USB cable at the host as shown below,
*** Booting Zephyr OS build v4.2.0-2755-g258172992551 ***
PWM-based blinkyCalibrating for channel 0…[00:00:00.011,112]
pwm_nrfx: Prescaler for period_cycles 16000000 not fou.[00:00:00.019,327] pwm_nrfx: Prescaler for period_cycles 8000000 not foun.[00:00:00.027,465] pwm_nrfx: pwm_nrfx_set_cycles: channel 0, pulse 200000.Done calibrating; maximum/minimum periods 250000000/7812500 nsec[00:00:00.043,638]
pwm_nrfx: pwm_nrfx_set_cycles: channel 0, pulse 200000.Using period 250000000[00:00:04.056,244]
pwm_nrfx: pwm_nrfx_set_cycles: channel 0, pulse 100000.Using period 125000000[00:00:08.068,788]
pwm_nrfx: pwm_nrfx_set_cycles: channel 0, pulse 500000.Using period 62500000…
We have completed the installation description of Zephyr in Linux, build and flashed the example that changes the pulse width modulation characteristics applied to LED1 into the nRF54L15-DK development kit. You can change the source code
zephyrproject/zephyr/samples/basic/blinky_pwm/src/main.c
repeat the build and flash process shown above.
A simple application that shows kernel is working properly. Two threads (A and B) take their turns printing a welcome message to the console, and it uses sleep requests and semaphores to control the rate at which messages are generated. This demonstrates that kernel scheduling process, communication process, and timing process are working properly. In order to build this example proceed with,
(venv) /zephyr/zephyrproject/zephyr$ west build -p always -b nrf54l15dk/nrf54l15/cpuapp samples/synchronization/
the flash it to the nRF54L15-DK development kit.
(venv) /zephyr/zephyrproject/zephyr$ west flash
At another terminal minicom should report the following events,
*** Booting Zephyr OS build v4.2.0-2763-g5af3adf66fb3 ***
[00:00:00.002,883] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.002,896] <inf> bt_hci_core: HW Variant: nRF54Lx (0x0005)
[00:00:00.002,908] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 4.2 Build 99
[00:00:00.003,274] <inf> bt_hci_core: HCI transport: Controller
[00:00:00.003,323] <inf> bt_hci_core: Identity: F2:57:B1:05:95:C5 (random)
[00:00:00.003,337] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x0000, manufacturer 0x05f1
[00:00:00.003,349] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0xffff
Bluetooth initialized
Advertising successfully started
*** Booting Zephyr OS build v4.2.0-2763-g5af3adf66fb3 ***
thread_a: Hello World from cpu 0 on nrf54l15dk!
thread_b: Hello World from cpu 0 on nrf54l15dk!
thread_a: Hello World from cpu 0 on nrf54l15dk!
thread_b: Hello World from cpu 0 on nrf54l15dk!
thread_a: Hello World from cpu 0 on nrf54l15dk!
thread_b: Hello World from cpu 0 on nrf54l15dk!
thread_a: Hello World from cpu 0 on nrf54l15dk!
thread_b: Hello World from cpu 0 on nrf54l15dk!
thread_a: Hello World from cpu 0 on nrf54l15dk!
The corresponding code is located here,
zephyrproject/zephyr/samples/synchronization/src/main.c
Another example we can build and flash is an example that demonstrates spawning multiple threads using :c:func:K_THREAD_DEFINE. It spawns 3 threads. Each thread is then defined
at compile time using K_THREAD_DEFINE.
The first two each control an LED. These LEDs, led0 and led1, have
are controlled by separate functions.
blink0()controlsled0and has a 100ms sleep cycle
blink1()controlsled1and has a 1000ms sleep cycle
When either of these threads toggles its LED, it also pushes information into a first in first out
:ref:FIFO <fifos_v2> identifying the thread/LED and how many times it has
been toggled.
The third thread uses :c:func:printk to print the information added to the
FIFO to the device console. You can build this example as follows,
(venv) /zephyr/zephyrproject/zephyr$ west build -p always -b nrf54l15dk/nrf54l15/cpuapp samples/basic/threads
Finally download the executable to the nRF54L15-DK development kit,
(venv) /zephyr/zephyrproject/zephyr$ west flash
Again, you can use minicom or other serial program to see the output via the USB cable at the host as shown below,
Welcome to minicom 2.9
OPTIONS: I18nPort /dev/ttyACM1, 00:16:08
Press CTRL-A Z for help on special keys
Toggled led0; counter=8
Toggled led0; counter=9
Toggled led1; counter=1
Toggled led0; counter=10
Toggled led0; counter=11
Toggled led0; counter=12
Toggled led0; counter=13
Toggled led0; counter=14
Toggled led0; counter=15
Toggled led0; counter=16
Toggled led0; counter=17
Toggled led0; counter=18
Toggled led0; counter=19
Toggled led1; counter=2
Toggled led0; counter=20
Toggled led0; counter=21
Toggled led0; counter=22
Toggled led0; counter=23
Toggled led0; counter=24
Toggled led0; counter=25
Toggled led0; counter=26
Toggled led0; counter=27
Toggled led0; counter=28
Toggled led0; counter=29
…
The following video shows LED0 and LED1 flashing from the Zephyr threads shown previously in minicom in the nRF54L15-DK development kit,
You can change the source code
zephyrproject/zephyr/samples/basic/threads/src/main.c
and repeat the build and flash process shown above.
There is another example that illustrates A simple button demo showcasing the use of GPIO input with interrupts. The sample prints a message to the console each time button 0 is pressed.
Welcome to minicom 2.9
OPTIONS: I18nPort /dev/ttyACM1, 00:27:52
Press CTRL-A Z for help on special keys
Button pressed at 673320
Button pressed at 1464286
Button pressed at 2446485
Button pressed at 6736908
Button pressed at 7425903
Button pressed at 8269811
Button pressed at 8398743
Button pressed at 8606173
Button pressed at 8725072
Button pressed at 9167836
Button pressed at 10183197
Button pressed at 10795567
Button pressed at 11698303
The previous input button example can be build and flashed as follows,
(venv) /zephyr/zephyrproject/zephyr$ west build -p always -b nrf54l15dk/nrf54l15/cpuapp samples/basic/button
(venv) /zephyr/zephyrproject/zephyr$ west flash
Finally there is an example that illustrates the dynamic transmit power control over the LL
of the Bluetooth LE controller via Zephyr HCI VS commands. The application implements a
peripheral advertising with varying transmit RF power. The initial advertiser TX power
for the first 5s of the application is the Kconfig set default TX power. Then,
the TX power variation of the advertiser is a repeatedly descending staircase
pattern ranging from -4 dBm to -30 dBm where the Tx power levels decrease every
5s. If there was a successful connection, the connection Receive Signal Strength Indicator is being monitored and the Tx power of the peripheral device is modulated per connection accordingly
such that energy is being saved depending on how powerful the RSSI of the connection is. The peripheral implements a simple GATT profile exposing the HR service notifying connected centrals about a dummy HR each 2s. Here is the way it is built and flashed,
(venv) /zephyr/zephyrproject/zephyr$ west build -p always -b nrf54l15dk/nrf54l15/cpuapp samples/bluetooth/hci_pwr_ctrl/
(venv) /zephyr/zephyrproject/zephyr$ west flash
The nRF54L15-DK development kit displays the adjustment of the RF power level as follows,
Welcome to minicom 2.9
OPTIONS: I18nPort /dev/ttyACM1, 00:42:21
Press CTRL-A Z for help on special keys
*** Booting Zephyr OS build v4.2.0-2763-g5af3adf66fb3 ***
Starting Dynamic Tx Power Beacon Demo
[00:00:00.002,504]
bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.002,517] bt_hci_core:
HW Variant: nRF54Lx (0x0005)
[00:00:00.002,529] bt_hci_core:
Firmware: Standard Bluetooth controller (0x00) Version 4.2 Build 99
[00:00:00.002,748] bt_hci_core:
HCI transport: Controller
[00:00:00.002,797] bt_hci_core:
Identity: F2:57:B1:05:95:C5 (random)[00:00:00.002,811] bt_hci_core:
HCI: version 5.4 (0x0d) revision 0x0000, manufacturer 0x05f1
[00:00:00.002,824]
bt_hci_core: LMP: version 5.4 (0x0d) subver 0xffff
Bluetooth initialized
Dynamic Tx power Beacon started
Get Tx power level ->-> default
TXP = 24.
Set Tx power level to 4
Actual Tx Power: 4
Get Tx power level → TXP = 4
Set Tx power level to 0.
Actual Tx Power: 0
Get Tx power level → TXP = 0
Set Tx power level to -3.
Actual Tx Power: -3
Get Tx power level → TXP = -3
Set Tx power level to -8
Actual Tx Power: -8
you can change the source code here for this dynamic output RF power control mechanism,
zephyrproject/zephyr/samples/samples/bluetooth/hci_pwr_ctrl/src/main.c
I hope this overview provides an idea of the installation process of Zephyr and some demos that show some capabilities of the nRF54L15-DK development kit,
Also there is a new post that outlines the build and flash process for the Nordic nRF7002-DK development kit located here.
Have a nice day!
This post is also available in spanish here.
Este post esta disponible en español aqui.
This post is also available in japanese here.