The nRF52820 IC is a subset of the nRF52833 with smaller RAM and flash, and with less peripheral resources. Therefore, you can use nRF52833 to emulate the functionality of nRF52820.
This blog post will show you how to emulate the nRF52820 on the nRF52833 Development Kit.
Detailed information on the SoC can be found in the nRF52820 Product Specification and a detailed comparison of the features of the various nRF52 Series chips can be seen in the nRF52 Series comparison table on the Nordic Infocenter.
Hardware emulation of nRF52820 on the nRF52833 DK
You can fully emulate nRF52820 features using a nRF52833 Development Kit (PCA10100), there are however, some differences that developers should be aware of when transferring emulated projects to nRF52820 hardware.
The bit length for some of the digital serial interface features differs for both chips. This means that the emulated project lets you use 16 bits, but in order to successfully function on nRF52820, the following features cannot exceed 15 bits in your application.
It is also important to note that the nRF52833 has higher number of GPIO pins compared to the nRF52820.
The nRF52833 DK uses the nRF52833 aQFN73 and some of the buttons are tied to GPIOs that are not available on the nRF52820 QFN40 package.
When running an emulated nRF52820 example on the nRF52833 DK you will still be able to use the buttons and LEDs, but when transferring the emulated project to nRF52820 hardware you will need to remap any button and LED pin to available GPIOs on the nRF52820 QFN 40 package, see table below.
Software emulation of nRF52820
All examples that are hardware compatible can be set up to emulate nRF52820 on nRF52833. Hardware compatibility means that a project uses only the resources present in nRF52820, including peripherals and memory. Note that the nRF52820 does not have cache and hardware floating point support. Its also important to note that the nRF52820 has reduced flash and RAM size, hence not all nRF52833 DK examples may fit on the nRF52820.
See the the nRF52 Series comparison table on the Nordic Infocenter for a full overview of which peripherals that are present on the nRF52820 compared to the nRF52833.
The following SoftDevices are supported on the nRF52820
this is also listed in the SDKs and SoftDevices Compatibility Matrix for the nRF52820.
Differences between the the v8.0.0 and v7.0.1 SoftDevice APIs
The S122 is a size-optimized central only BLE SoftDevice for the nRF52820. The S122 API is a compatible subset of the S132 SoftDevice API, hence for features that are common to S122 and S132, the API is the same.
The changes in the API of the S122 v8.0.0-10.alpha compared to the S132 v7.0.1 is as follows:
Installing the nRF MDK and nRF Command-Line Tools
In order to start development on the nRF52820 you need to download the nRF MDK (Microcontroller Development Kit) and the nRF Command-Line Tools that supports the nRF52820.
The nRF MDK provides device support in the form of register header files and startup code for the different toolchains/IDEs supported in the nRF5 SDK and the nRF Command-Line Tools allows you to program the nRF52820 through SEGGER J-Link programmers and debuggers.
The nRF Command-Line Tools version that supports the nRF52820 is v10.7.0 and later, which can be downloaded from https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Command-Line-Tools/Download
The nRF MDK version that supports the nRF52820 is v8.32.1 and later, which can be downloaded from https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-MDK/Download#infotabs.
Note: You should select the MDK with the 5-clause Nordic License.
Setting up the MDK varies depending on the IDE/Toolchain used. IDE/toolchain specific instructions are given below.
Segger Embedded Studio
Patching nRF5 SDK v16.0.0 to support the nRF52820
In addition to updating the nRF MDK you will also have to patch and add some files in the nRF5 SDK v16.0.0 source code to add support for the nRF52820.
The following files in the nRF5 SDK v16.0.0 needs to be patched or added to support the nRF52820:
In order to add support for the S122 v8.0.0-10.alpha you will also have to patch the following files:
Lastly, a minor modification to the MDK is needed to allow all buttons and leds on the nRF52833 DK to be used when emulating the nRF52820
The patched and added files are available in this zip: 6646.sdk_v16_0_0_nrf52820_patch.zip
Creating an emulated project for the nRF52820 on the NRF52833 DK
NRFX_COREDEP_DELAY_US_LOOP_CYCLES=3 and DEVELOP_IN_NRF52833 to the preprocessor definitions.
GCC and Makefiles
DNRFX_COREDEP_DELAY_US_LOOP_CYCLES=3ASMFLAGS += -DNRFX_COREDEP_DELAY_US_LOOP_CYCLES=3
Transferring an emulated project to nRF52820 hardware
If you have developed your application using the emulated project as a starting point, there are only two steps you need to perform before you can run it natively on nRF52820:
Emulated nRF52820 (PCA10100e) Project examples
Below you will find some of the BLE examples from SDK v16.0.0 where a pca10100e project has been added with support for Keil 5, Segger Embedded Studio.
Peripheral UART/Serial Port Emulation over BLE (ble_app_uart)
Central UART/Serial Port Emulation over BLE (ble_app_uart_c)