First, this guide shows you how to set up a development environment for the PAN1782 and then how to build and run a simple application on the PAN1782 evaluation board.
You can find step-by-step instructions for installing the development environment at Getting started.
The instructions explain the following points:
Installation of all necessary prerequisites.
Installation of nRF Connect for Desktop to gain access to the Toolchain Manager.
Usage of the Toolchain Manager to install the latest version of the nRF Connect SDK.
Usage of the Toolchain Manager to install the latest version of the nRF Connect for Visual Studio Code extension.
Afterward you are ready to build and run your first application.
The following requirements must be met:
- You must have setup the development environment as explained in Installation.
The following sections provide a step-by-step introduction on how to build and run your first application.
You have to do the project setup from within the nRF Connect for Visual Studio Code extension.
In the nRF Connect section you have to click Create a new application .
In the newly opened window, you have to choose Freestanding first.
From the list of available application templates you should choose peripheral_uart because this application supports Bluetooth Low Energy, serial port and debug messages through the RTT interface.
You have to finish the project setup by clicking Create Application
You can check out Bluetooth: Peripheral UART for more details about the Peripheral UART sample application.
After you have set up the project you have to create a build configuration.
In the Applications section you have to click on Click to create one
In the newly opened window, you have to choose All boards first. Then start typing pan in the board edit box.
Continue typing or choose the evaluation board you want to use from the drop-down list.
Sometimes you can choose different project configurations using the Configuration drop-down list.
If you want to be able to debug the application later on you have to tick the Enable debug options checkbox.
Finally click Build Configuration to finish.
The application build is automatically started. You can observe the progress of the build in the terminal window.
If the terminal window is not yet visible, please choose View → Terminal from the main Visual Studio Code window.
After you have created a build configuration you are ready to build the application.
From the Actions section you can build the application by clicking Build
After you have built the application you are ready to program the application to your PAN1782 evaluation board.
You can check if your evaluation board is recognized correctly if it is shown in the Connected Devices section. If it is not, you can click on the refresh icon .
In the Actions section you can click on Flash to start programming. You can observe the progress in the Terminal window again.
Serial Port Handling in Linux vs. Windows
The following instructions were assembled under Linux, so the serial port notation looks like
/dev/ttyUSB0. If you are using Windows instead, the notation is different and looks like
Also you might see multiple serial ports and you might need to find out the serial port that you actually need to use.
After you have programmed the application you can observe what the application is doing in multiple ways.
In the Connected Devices section you can click the plug icon to connect the RTT communication to the nRF Terminal output.
In the newly opened edit box you have to select Automatic search .
You should see the following output (or similar) in the nRF Terminal output.
SEGGER J-Link V7.86a - Real time terminal output J-Link OB-SAM3U128 V3 compiled Sep 22 2022 13:22:46 V3.0, SN=483115384 Process: JLinkExe [00:00:00.017,211] <inf> fs_nvs: 8 Sectors of 4096 bytes [00:00:00.017,211] <inf> fs_nvs: alloc wra: 0, fd0 [00:00:00.017,272] <inf> fs_nvs: data wra: 0, 1c [00:00:00.017,578] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision: d8 0c 2d 2f 36 ae e2 5c 80 26 80 4c 3f 4d 16 53 |..-/6..\ .&.L?M.S 50 96 c7 73 |P..s [00:00:00.025,238] <inf> bt_hci_core: No ID address. App must call settings_load() [00:00:00.025,329] <inf> peripheral_uart: Bluetooth initialized
You can click on the unplug icon in the terminal window to close the RTT connection again.
The nRF Terminal is also capable of attaching to the UART output of the evaluation board. You can click on the plug icon to establish a new connection.
In the newly opened edit box you have to select the connection type Serial Port .
In the newly opened edit box you have to select the appropriate serial port from the list of choices, for example /dev/ttyUSB0 .
In the newly opened edit box you have to choose the configuration 115200 8n1 rtscts:off .
Connected via Serial Port with settings /dev/ttyUSB0 115200 8n1 rtscts:off *** Booting Zephyr OS build v3.2.99-ncs2 *** Starting Nordic UART service example
You can also debug your application instead of just programming and running it.
In the Actions section you can click on Debug to start debugging.
You can check out How to debug an application for more detailed information on how you can control the debugging process.
You have set up, configured and built the Bluetooth: Peripheral UART sample application and learned how to observe the messages and debug output on the serial port terminal and the RTT terminal.
Nordic Semiconductor provides extensive documentation and information for Bluetooth Low Energy.
For example, you can check out the Nordic Developer Academy which is an "[...] interactive online learning platform [...] to equip developers with the technical information and know-how to build wireless products using Nordic Semiconductor solutions."