By default, the debugging infrastructure is disabled in the nRF52810 version to save space. However, it is possible to turn on the logger in the application. To do this, you must disable some features. The most convenient one to disable is OTA-DFU, because it is usually not used during firmware development and can release a significant amount of flash memory. The opposite is also possible: to turn on logging in the OTA-DFU bootloader, sacrificing flash space of the application.
This page shows how to enable logging in an nRF52810 application using the flash space of the bootloader.
To turn on logging over RTT in Smart Remote nRF52810, follow these steps.
In sr3_config_nrf52810_pca20031.h, set the following configuration.
During compilation with such settings, the ROM space of nRF52810 is overflowed. To use the flash space reserved for the bootloader, modify the memory regions in the linker script located in Projects/Firmware_nRF52810/armgcc
. Find and edit the memory configuration:
MEMORY { FLASH (rx) : ORIGIN = 0x18000, LENGTH = 0xf000 RAM (rwx) : ORIGIN = 0x20001c48, LENGTH = 0x43b8 }
Increase the flash space size from 0xf000
to 0x16000
FLASH (rx) : ORIGIN = 0x18000, LENGTH = 0x16000
Compile the firmware with these changes.
To disable the bootloader, it is required to clear the UICR storing the bootloader address. It can be done by performing a chip erase.
After flashing the application, it is possible to use the nRF52810 firmware with the logger enabled.
By default, on nRF52810, the logger messages are limited to the WARNING
level. More log information can be displayed by changing CONFIG_LOG_LEVEL_CAP. However, enabling more logs requires more ROM space, which can be achieved by turning off some Smart Remote features. See Logger configuration.
For details of memory layout, refer to Flash memory layout.
For instructions on how to display logging information, see Logger and CLI.