The set I got contained nRF5340-DK, nRF52840-Dongle, and Adafruit screen.
When connected to USB simple application with blinking LED started (toggle on-off button next to the USB connector).
Getting started with developmentFirst step is to download nRF Connect, that can be used to download other Nordic software. After nRF Connect installation, run it and install Programmer, and Toolchain Manager.
Second step is to install SDK in toolchain manager. At current time latest SDK version is 1.5.0. SEGGER Embedded Studion IDE is by default installed together with SDK.
There is great installation guide already on hackster.io, so it won't be repeated here.
Building and debugging "Hello world"After installation it's good to start from building "hello world" project. Good introduction is covered by tutorial on Nordic DevZone: https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial---part-1-ncs-v1-4-0
Tutorial is covering few development kits. For nRF5340 (and nRF52840??) it's easiest to follow steps 1.1 and 1.2 choosing appropriate board when creating project.
Logging, and debugger interface are probably the most important features that should be mastered when starting with new IDE and processor.
It took me a while to figure out how to configure logging in the project. nRF Connect SDK configurator from Project menu should be used to enable debugging.In "Sub Systems and OS Services" logging should be enabled. I also enabled minimal-footprint logging for start. After that configuration LOG_XXX macros will print messages to the first serial port.
Click on "Configure" and rebuild project.
Alternatively printk seems to be working out of the box without any additional configuration.
Minimal example for testing logging:
#include <zephyr.h>
#include <sys/printk.h>
#include <logging/log.h>
#define LOG_MODULE_NAME hello_world
LOG_MODULE_REGISTER(LOG_MODULE_NAME);
void main(void)
{
printk("Hello World!\n");
LOG_INF("Hello log\n");
}
Debugger worked out of the box. Just place brakepoint at any line and either use "Build and Debug" or just start debugger session from Debug menu.
In my case output was printed on first serial port installed by J-Link (COM4 on Windows)
...
*** Booting Zephyr OS build v2.4.99-ncs1 ***
Hello World!
I: Hello log info
Bluetooth examplesPoint 2.2.1 in tutorial is covering setup of BLE peripheral device.
When development kit is used for first time then it looks like hci_rpmsg has to be downloaded to the net processor manually.
Connect development kit to PC, and power it on.
Use File->"Open nRF Connect SDK Project...", select hci_rpmsg, and board with _cpunet suffix.
Build and run project.
Next create another project File->"Open nRF Connect SDK Project...", and this time select peripheral_lbs sample, and board with _cpuappns suffix.
Build and run project.
LED1 should be blinking slowly when application has initialized Bluetooth correctly. Now it should be possible to use a mobile phone to enumerate "Nordic_Blikny" device (using for example nRF Connect Android app).
Comments
Please log in or sign up to comment.