...
The resulting image is build/zephyr/merged.hex
.
...
2.2. Developing on Application Core of nRF5340
Building Thingy-9151-Lite Application for nRF5340 (application core) from command line
Go to the application directory:
Code Block |
---|
cd nrf-app/thingy9151lite_nrf5340_cpuapp_app/ |
The boards
subdirectory contains the configurations of the supported boards. The Nordic nRF5340 DK board is already supported in Zephyr, so it is configured using the devicetree overlay:
Build the application for nRF5340 DK using the following command:
Code Block |
---|
west build -b nrf5340dk_nrf5340_cpuapp_ns |
The resulting image is build/zephyr/merged.hex
.
2.2. Developing on Network Core of nRF5340
Building Thingy-9151-Lite Application for nRF5340 DK (network core)
Go to the application directory:
Code Block |
---|
cd nrf-app/thingy9151lite_nrf5340_cpunet_app/ |
The boards
subdirectory contains the configurations of the supported boards. The Nordic nRF5340 DK board is already supported in Zephyr, so it is configured using the devicetree overlay:
Build the application for nRF5340 DK using the following command:
Code Block |
---|
west build -b nrf5340dk_nrf5340_cpunet |
The resulting image is build/zephyr/zephyr.hex
.
Using VSCode to build and debug applications
Adding custom boards from the Thingy-9151-Lite
...
into the VSCode
In order for nRF Connect plugin to recognize custom board configurations that come along with nrf-app
, add it to the BOARD_ROOT
setting of the plugin. For this start VSCode, navigate to File -> Preferences -> Settings -> Extensions -> nRF Connect -> Board Roots, then add the directory where nrf-app
repository was cloned:<west_init>/nrf-app/
.
...
Sometimes changing BOARD_ROOT
is not enough and nRF Connect plugin refuses to show boards from <west_init>/nrf-app/boards
as valid configuration targets. To work around this, create fake board skeleton using nRF plugin in the same directory: activate nRF plugin, select 'Create a new board', supply some board name, accept suggested build board name, select any nRF device, specify full path to the <west_init>/nrf-app/boards
and finally enter something as company name. After this nRF Connect plugin creates skeleton for the new board in the target path. This board definition will never be used, it is only needed for to force nRF Connect plugin to scan the <west_init>/nrf-app/boards
for custom board definitions. This steps should only be needed once per workspace.
Importing the Thingy-9151-Lite Applications into the VSCode
To import the application(s), activate nRF Connect plugin, select ‘Open an existing application', navigate to wanted application (e.g. <west_init>/nrf-app/thingy9151lite_nrf9151_app
), press 'Open'
...
It is possible to open several applications into the same workspace.
Building the Thingy-9151-Lite
...
Applications in the VSCode
Start VSCode with workspace where one or more Thingy-9151-Lite Applications are already imported, activate nRF Connect plugin.
If build configuration for the application does not exist yet (no build folder in the ‘Application’ window of nRF Connect plugin), create one by selecting ‘Add build configuration', selecting 'Custom board’ than target board name:
Select build configuration, use ‘Build' in the 'Actions’ window of the nRF Connect plugin.
...
...
Application |
---|
...
Go to the application directory:
Code Block |
---|
cd nrf-app/thingy9151lite_nrf5340_cpuapp_app/ |
The boards
subdirectory contains the configurations of the supported boards. The Nordic nRF5340 DK board is already supported in Zephyr, so it is configured using the devicetree overlay:
Build the application for nRF5340 DK using the following command:
...
Default board target name | SoC | |
---|---|---|
|
| nRF9161 |
|
...
The resulting image is build/zephyr/merged.hex
.
Importing the Thingy-9151-Lite Application for nRF5340 (application core) into the VSCode
...
|
|
...
| nRF5340 (application core) |
...
Start VSCode, activate nRF Connect plugin.
If build configuration for the application does not exist yet (no build folder in the ‘Application’ window of nRF Connect plugin), create one by selecting 'Add build configuration' and accepting defaults.
Select build configuration, use ‘Build' in the 'Actions’ window of the nRF Connect plugin.
2.2. Developing on Network Core of nRF5340
Building Thingy-9151-Lite Application for nRF5340 DK (network core)
Go to the application directory:
...
|
...
The boards
subdirectory contains the configurations of the supported boards. The Nordic nRF5340 DK board is already supported in Zephyr, so it is configured using the devicetree overlay:
...
|
...
Build the application for nRF5340 DK using the following command:
Code Block |
---|
west build -b nrf5340dk_nrf5340_cpunet |
The resulting image is build/zephyr/zephyr.hex
.
Importing the Thingy-9151-Lite Application for nRF5340 (network core) into the VSCode
Start VSCode, activate nRF Connect plugin, select ‘Open an existing application', navigate to <west_init>/nrf-app/thingy9151lite_nrf5340_cpunet_app
, press 'Open'
Building the Thingy-9151-Lite Application for nRF5340 (network core) in the VSCode
Start VSCode, activate nRF Connect plugin.
...
| nRF5340 (network core) |
Select build configuration, use ‘Build' in the 'Actions’ window of the nRF Connect plugin.
...
Debugging in VSCode
Follow Nordic instructions on debugging in VSCode.
...
activate Python virtual environment by running
<venv dir>\Scripts\activate.bat
start VSCode with application folder set as current
Code Block > cd nrf-app/thingy9151lite_nrf5340_cpunet_app/ > code
...
activate Zephyr environment by running
<west_init>\zephyr\zephyr-env.cmd
start VSCode
To avoid repeating this steps create cmd.exe
script that will setup environment and launch VSCode and create desktop icon for it.