The nRF52805 SoC is a low-cost member of the nRF52 Series with a subset of the features of the nRF52811 and nRF52810 SoCs. As the nRF52805 has a feature subset of the nRF52810/11 SoCs, which in turn has a feature subset of the nRF52832, you can use the nRF52832 on the nRF52 DK to emulate the functionality of nRF52805 during development.
This blog post will show you how to emulate the nRF52805 on the nRF52 Development Kit and show you how to transfer the emulated project to nRF52805 hardware.
Detailed information on the SoC can be found in the nRF52805 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.
To support development for the nRF52805 the following versions are required.
Hardware emulation of nRF52805 on the nRF52 DK
You can fully emulate nRF52805 features using an nRF52 Development Kit (PCA10040), there are however, some differences that developers should be aware of when transferring emulated projects to nRF52805 hardware.
The EasyDMAbit MAXCNT bit length for some of the digital serial interfaces differs between the nRF52832 and the nRF52805. This means that the emulated project running on the nRF52 832 may only be able to use an EasyDMA MAXCNT bit length of 8 bits, while on the nRF52805 you may use EasyDMA MAXCNT bit length of up to 14 bits, see the table below for which peripherals that are affected.
The SAADC on the nRF52805 only has a limited number of channels compared to the nRF52832
The number of PPI channels on the nRF52805 is lower than on the nRF52832
The number of GPIOs available on the nRF52805 is lower than the nRF52805.
When running an emulated nRF52805 example on the nRF52 DK you will be able to use the buttons and LEDs, but when transferring the emulated project to nRF52805 hardware you will need to remap the GPIOs used on the nRF52832 to available GPIOs on the nRF52805 wlCSP package, see table below.
General purpose I/O
Connection for 32.768 kHz crystal (LFXO)
Configurable as pin reset
Software emulation of nRF52805
All examples that are hardware compatible with the nRF52805 can be set up to emulate the nRF52805 on the nRF52832. Hardware compatibility means that a project uses only the resources present in nRF52805, including peripherals and memory. Note that the nRF52805 does not have cache and hardware floating-point support. It is also important to note that the nRF52805 has reduced flash and RAM size compared to the nRF52832, hence not all nRF52 DK examples may fit on the nRF52805.
See the nRF52 Series comparison table on the Nordic Infocenter for a full overview of which peripherals that are present on the nRF52805 compared to the nRF52832.
The following SoftDevices are supported on the nRF52805
this is also listed in the SDKs and SoftDevices Compatibility Matrix for the nRF52805.
Patching nRF5 SDK v17.0.0 to support the nRF52805
The following files in the nRF5 SDK v17.0.0 need to be patched or added to support the nRF52805:
The patched and added files are available in this zip: SDK_v17.0.0_nRF52805_Patch.zip
Creating an emulated project for the nRF52805 on the nRF52 DK
This section will show you how to convert the emulated nRF52810 (pca10040e) examples in the nRF5 SDK to emulated nRF52805 (pca10040e_nrf52805) examples. Instructions for Keil, Segger Embedded Studio, and GCC with Makefiles are given below.
Segger Embedded Studio
GCC and Makefiles
DNRFX_COREDEP_DELAY_US_LOOP_CYCLES=3ASMFLAGS += -DNRFX_COREDEP_DELAY_US_LOOP_CYCLES=3
Transferring an emulated project to nRF52805 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 nRF52805:
Emulated nRF52805 (pca10040e_nrf52805) Project examples
Below you will find some of the BLE examples from SDK v17.0.0 where a pca10040e_nrf52805 project has been added with support for Keil 5, Segger Embedded Studio.
Peripheral UART/Serial Port Emulation over BLE (ble_app_uart)
Secure BLE Bootloader
Secure UART Bootloader
Will the above work with the latest SDK 17.0.2? I get an undefined reference to `__RAM1_segment_end__` error when building the above `ble_app_uart.zip` example project in SES 5.10b.
Got it building with SDK 17.0.2 on SES 5.10b. I still had to use the patch files provided in this post (btw the link is `SDK_v17.0.0_nRF52805_Patch.zip` but the file that downloads is `SDK_v16.0.0_nRF52805_Patch.zip`). Then copied the blue_app_uart/pca10040e project and modified it. Only changes needed to the fresh example project are:1. Code > Preprocessor > Preprocessor Definitions, change NRF52810_XXAA to NRF52805_XXAA2. Remove the following files from the project: ses_startup_nrf52810.s and system_nrf52810.c.3. Add the following files to the project: ses_startup_nrf52805.s and system_nrf52805.c.Note: I could not get the `Emulated nRF52805 (pca10040e_nrf52805) Project examples` from this post to compile. It looks like it is due to some mismatches in SDK/SES versions. But using the method I described, things seem to work.