Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

TWI HardFault_Handler fault on calling any function from TWI handler

I am using NRF52832, twi_sensor_pca10040 example with SHT3X sensor.

I changed slave address to 0X44 and SCL, SDA pin to 27 and 26. TWI TX transfer work fine, in response I am geeting 6 byte of data from SHT3X sensor ( TWI slave address 0x44 ).

In twi_sensor_pca10040 example, from twi_handler() hadler, read_data() function is called. For received data manupulation, I changed code logic in read_data() function, called from twi_handler(). Every time read_data() function called I get HardFault_Handler fault  and board hang.


For testing, I commented read_data() function; then after TWI RX data buffer updates fine with every TWI TX request. I checked it by placeing read buffer in keil debug mode watch window.

Why function call from twi_handler() is giving me HardFault_Handler fault? I am not getting how to debug it?

/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
 *
 * The information contained herein is property of Nordic Semiconductor ASA.
 * Terms and conditions of usage are described in detail in NORDIC
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
 *
 * Licensees are granted free, non-transferable use of the information. NO
 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
 * the file.
 *
 */

/** @file
 * @defgroup tw_sensor_example main.c
 * @{
 * @ingroup nrf_twi_example
 * @brief TWI Sensor Example main file.
 *
 * This file contains the source code for a sample application using TWI.
 *
 */

#include <stdio.h>
#include "boards.h"
#include "app_util_platform.h"
#include "app_uart.h"
#include "app_error.h"
#include "nrf_drv_twi.h"
#include "nrf_delay.h"

/*Pins to connect shield. */
#define ARDUINO_I2C_SCL_PIN 27
#define ARDUINO_I2C_SDA_PIN 26

/*UART buffer size. */
#define UART_TX_BUF_SIZE 256
#define UART_RX_BUF_SIZE 1

/*Common addresses definition for accelereomter. */
#define MMA7660_ADDR        0x44 //(0x98U >> 1)

#define MMA7660_REG_XOUT    0x00U
#define MMA7660_REG_YOUT    0x01U
#define MMA7660_REG_ZOUT    0x02U
#define MMA7660_REG_TILT    0x03U
#define MMA7660_REG_SRST    0x04U
#define MMA7660_REG_SPCNT   0x05U
#define MMA7660_REG_INTSU   0x06U
#define MMA7660_REG_MODE    0x07U
#define MMA7660_REG_SR      0x08U
#define MMA7660_REG_PDET    0x09U
#define MMA7660_REG_PD      0x0AU

/* Mode for MMA7660. */
#define ACTIVE_MODE 1u

/*Failure flag for reading from accelerometer. */
#define MMA7660_FAILURE_FLAG (1u << 6)

/*Tilt specific bits*/
#define TILT_TAP_MASK (1U << 5)
#define TILT_SHAKE_MASK (1U << 7)

// [max 255, otherwise "int16_t" won't be sufficient to hold the sum
//  of accelerometer samples]
#define NUMBER_OF_SAMPLES 20

/* Define version of GCC. */
#define GCC_VERSION (__GNUC__ * 10000 \
                     + __GNUC_MINOR__ * 100 \
                     + __GNUC_PATCHLEVEL__)

/**
 * @brief Structure for holding sum of samples from accelerometer.
 */
typedef struct
{
    int16_t x;
    int16_t y;
    int16_t z;
} sum_t;
static sum_t m_sum = {0};

/**
 * @brief Union to keep raw and converted data from accelerometer samples at one memory space.
 */
typedef union{
    uint8_t raw;
    int8_t  conv;
}elem_t;

/**
 * @brief Enum for selecting accelerometer orientation.
 */
typedef enum{
    LEFT = 1,
    RIGHT = 2,
    DOWN = 5,
    UP = 6
}accelerometer_orientation_t;

/**
 * @brief Structure for holding samples from accelerometer.
 */
/*typedef struct
{
    elem_t  x;
    elem_t  y;
    elem_t  z;
    uint8_t tilt;
} sample_t;
*/

typedef struct
{
    elem_t  tmsb;
    elem_t  tlsb;
    elem_t  tcrc;
    elem_t  hmsb;
	  elem_t  hlsb;
		elem_t  hcrc;
} sample_t;

#ifdef __GNUC_PATCHLEVEL__
#if GCC_VERSION < 50505
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-braces"           // Hack to GCC 4.9.3 bug. Can be deleted after switch on using GCC 5.0.0
#endif
#endif
/* Buffer for samples. */
static sample_t m_sample_buffer[NUMBER_OF_SAMPLES] = {0};
#ifdef __GNUC_PATCHLEVEL__
#if GCC_VERSION < 50505
#pragma GCC diagnostic pop
#endif
#endif
/* Indicates if reading operation from accelerometer has ended. */
static volatile bool m_xfer_done = true;
/* Indicates if setting mode operation has ended. */
static volatile bool m_set_mode_done = false;
/* TWI instance. */
static const nrf_drv_twi_t m_twi_mma_7660 = NRF_DRV_TWI_INSTANCE(0);

/**
 * @brief Function for casting 6 bit uint to 6 bit int.
 *
 */
__STATIC_INLINE void int_to_uint(int8_t * put, uint8_t data)
{
    if (!(data & MMA7660_FAILURE_FLAG))     //6th bit is failure flag - we cannot read sample
    {
        *put = (int8_t)(data << 2) / 4;
    }
}

/**
 * @brief UART events handler.
 */
static void uart_events_handler(app_uart_evt_t * p_event)
{
    switch (p_event->evt_type)
    {
        case APP_UART_COMMUNICATION_ERROR:
            APP_ERROR_HANDLER(p_event->data.error_communication);
            break;

        case APP_UART_FIFO_ERROR:
            APP_ERROR_HANDLER(p_event->data.error_code);
            break;

        default:
            break;
    }
}


/**
 * @brief UART initialization.
 */
static void uart_config(void)
{
    uint32_t                     err_code;
    const app_uart_comm_params_t comm_params =
    {
        RX_PIN_NUMBER,
        TX_PIN_NUMBER,
        RTS_PIN_NUMBER,
        CTS_PIN_NUMBER,
        APP_UART_FLOW_CONTROL_DISABLED,
        false,
        UART_BAUDRATE_BAUDRATE_Baud38400
    };

    APP_UART_FIFO_INIT(&comm_params,
                       UART_RX_BUF_SIZE,
                       UART_TX_BUF_SIZE,
                       uart_events_handler,
                       APP_IRQ_PRIORITY_LOW,
                       err_code);

    APP_ERROR_CHECK(err_code);
}


/**
 * @brief Function for setting active mode on MMA7660 accelerometer.
 */
void MMA7660_set_mode(void)
{
    ret_code_t err_code;
    /* Writing to MMA7660_REG_MODE "1" enables the accelerometer. */
    uint8_t reg[2] = {MMA7660_REG_MODE, ACTIVE_MODE};

    err_code = nrf_drv_twi_tx(&m_twi_mma_7660, MMA7660_ADDR, reg, sizeof(reg), false);  
    APP_ERROR_CHECK(err_code);
    
    while(m_set_mode_done == false);
}

/**
 * @brief Function for averaging samples from accelerometer.
 */
void read_data(sample_t * p_new_sample)
{
	static double temp, humd;
	static uint8_t sample_idx;
    
  sample_t * p_sample = &m_sample_buffer[sample_idx];
		
	int_to_uint(&p_sample->hmsb.conv, p_new_sample->hmsb.raw);
  int_to_uint(&p_sample->hlsb.conv, p_new_sample->hlsb.raw);
	
	temp = ( ( ( p_new_sample->hmsb.conv << 8 ) + ( p_new_sample->hlsb.conv <<0 ) ) * 0.00267033 )- 45.0;
}

/**
 * @brief TWI events handler.
 */
void twi_handler(nrf_drv_twi_evt_t const * p_event, void * p_context)
{   
    ret_code_t err_code;
    static sample_t m_sample;
    
    switch(p_event->type)
    {
        case NRF_DRV_TWI_EVT_DONE:
            if ((p_event->type == NRF_DRV_TWI_EVT_DONE) &&
                (p_event->xfer_desc.type == NRF_DRV_TWI_XFER_TX))
            {
               /* if(m_set_mode_done != true)
                {
                    m_set_mode_done  = true;
                    return;
                }*/
                m_xfer_done = false;
                /* Read 4 bytes from the specified address. */
                err_code = nrf_drv_twi_rx(&m_twi_mma_7660, MMA7660_ADDR, (uint8_t*)&m_sample, sizeof(m_sample));
                APP_ERROR_CHECK(err_code);
            }
            else
            {
                read_data(&m_sample);
                m_xfer_done = true;
            }
            break;
        default:
            break;        
    }   
}

/**
 * @brief UART initialization.
 */
void twi_init (void)
{
    ret_code_t err_code;
    
    const nrf_drv_twi_config_t twi_mma_7660_config = {
       .scl                = ARDUINO_SCL_PIN,
       .sda                = ARDUINO_SDA_PIN,
       .frequency          = NRF_TWI_FREQ_100K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH
    };
    
    err_code = nrf_drv_twi_init(&m_twi_mma_7660, &twi_mma_7660_config, twi_handler, NULL);
    APP_ERROR_CHECK(err_code);
    
    nrf_drv_twi_enable(&m_twi_mma_7660);
}

/**
 * @brief Function for main application entry.
 */
int main(void)
{
    //uart_config();
   // int a = __GNUC__, c = __GNUC_PATCHLEVEL__;
   // printf("\n\rTWI sensor example\r\n");
    twi_init();
    //MMA7660_set_mode(); 
    
    //uint8_t reg = 0;
    ret_code_t err_code;
		uint8_t reg[2] = {0x2C, 0x10};
    
    while(true)
    {
        nrf_delay_ms(100);
        /* Start transaction with a slave with the specified address. */
        do
        {
            __WFE();
        }while(m_xfer_done == false);
        err_code = nrf_drv_twi_tx(&m_twi_mma_7660, MMA7660_ADDR, reg, sizeof(reg), true);
        APP_ERROR_CHECK(err_code);
        m_xfer_done = false;
    }
}

/** @} */

Parents Reply
  • So you are not actually using an nRF52832, but an nRF52810? 

    The nRF52810 doesn't have an FPU like the nRF52832 does, but your project settings are configured for an nRF52832 and hence your compiler generates an application intended for nRF52832. This is probably why your device hardfaults when doing floating point operations. 

    I would still recommend that you download a newer version for the SDK (nRF52810 wasn't released when SDK 11 came out), but another fix might be to simply change the target device in Options for Target in Keil:

Children
  • I downloaded and used sdk 14. In target device option I selected nrf52810_xxAA for twi_sensor example. I didn't made any change in code. On compiling the code I am getting lot of warnings and an error. Please she attachment for logs. Same for skd 15.

    On other hand if I select target device option as nfrg52832, the project compiles smoothly without any warning or error. But it gives hardware fault after on using floating multiplication.

    I understand compilation error has something to do with library package. But not getting how to correct it?

    *** Using Compiler 'V5.06 update 5 (build 528)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
    Build target 'nrf52832_xxaa'
    compiling nrf_drv_common.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(63): warning:  #47-D: incompatible redefinition of macro "BPROT_REGIONS_NUM"  (declared at line 55 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define BPROT_REGIONS_NUM 128
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(98): warning:  #47-D: incompatible redefinition of macro "EGU_COUNT"  (declared at line 86 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define EGU_COUNT 6
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(109): warning:  #47-D: incompatible redefinition of macro "TIMER_COUNT"  (declared at line 93 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TIMER_COUNT 5
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(125): warning:  #47-D: incompatible redefinition of macro "RTC_COUNT"  (declared at line 105 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define RTC_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(149): warning:  #47-D: incompatible redefinition of macro "SPIM_COUNT"  (declared at line 124 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIM_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(161): warning:  #47-D: incompatible redefinition of macro "SPIS_COUNT"  (declared at line 132 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIS_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(169): warning:  #47-D: incompatible redefinition of macro "TWIM_COUNT"  (declared at line 136 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIM_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(173): warning:  #47-D: incompatible redefinition of macro "TWIS_COUNT"  (declared at line 140 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIS_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(214): warning:  #47-D: incompatible redefinition of macro "PWM_COUNT"  (declared at line 169 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define PWM_COUNT 3
    ..\..\..\..\..\..\components\drivers_nrf\common\nrf_drv_common.c: 9 warnings, 0 errors
    compiling boards.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(63): warning:  #47-D: incompatible redefinition of macro "BPROT_REGIONS_NUM"  (declared at line 55 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define BPROT_REGIONS_NUM 128
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(98): warning:  #47-D: incompatible redefinition of macro "EGU_COUNT"  (declared at line 86 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define EGU_COUNT 6
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(109): warning:  #47-D: incompatible redefinition of macro "TIMER_COUNT"  (declared at line 93 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TIMER_COUNT 5
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(125): warning:  #47-D: incompatible redefinition of macro "RTC_COUNT"  (declared at line 105 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define RTC_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(149): warning:  #47-D: incompatible redefinition of macro "SPIM_COUNT"  (declared at line 124 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIM_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(161): warning:  #47-D: incompatible redefinition of macro "SPIS_COUNT"  (declared at line 132 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIS_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(169): warning:  #47-D: incompatible redefinition of macro "TWIM_COUNT"  (declared at line 136 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIM_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(173): warning:  #47-D: incompatible redefinition of macro "TWIS_COUNT"  (declared at line 140 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIS_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(214): warning:  #47-D: incompatible redefinition of macro "PWM_COUNT"  (declared at line 169 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define PWM_COUNT 3
    ..\..\..\..\..\..\components\boards\boards.c: 9 warnings, 0 errors
    compiling main.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(63): warning:  #47-D: incompatible redefinition of macro "BPROT_REGIONS_NUM"  (declared at line 55 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define BPROT_REGIONS_NUM 128
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(98): warning:  #47-D: incompatible redefinition of macro "EGU_COUNT"  (declared at line 86 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define EGU_COUNT 6
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(109): warning:  #47-D: incompatible redefinition of macro "TIMER_COUNT"  (declared at line 93 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TIMER_COUNT 5
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(125): warning:  #47-D: incompatible redefinition of macro "RTC_COUNT"  (declared at line 105 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define RTC_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(149): warning:  #47-D: incompatible redefinition of macro "SPIM_COUNT"  (declared at line 124 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIM_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(161): warning:  #47-D: incompatible redefinition of macro "SPIS_COUNT"  (declared at line 132 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIS_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(169): warning:  #47-D: incompatible redefinition of macro "TWIM_COUNT"  (declared at line 136 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIM_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(173): warning:  #47-D: incompatible redefinition of macro "TWIS_COUNT"  (declared at line 140 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIS_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(214): warning:  #47-D: incompatible redefinition of macro "PWM_COUNT"  (declared at line 169 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define PWM_COUNT 3
    ..\..\..\main.c: 9 warnings, 0 errors
    compiling app_error.c...
    compiling nrf_drv_twi.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(63): warning:  #47-D: incompatible redefinition of macro "BPROT_REGIONS_NUM"  (declared at line 55 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define BPROT_REGIONS_NUM 128
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(98): warning:  #47-D: incompatible redefinition of macro "EGU_COUNT"  (declared at line 86 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define EGU_COUNT 6
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(109): warning:  #47-D: incompatible redefinition of macro "TIMER_COUNT"  (declared at line 93 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TIMER_COUNT 5
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(125): warning:  #47-D: incompatible redefinition of macro "RTC_COUNT"  (declared at line 105 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define RTC_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(149): warning:  #47-D: incompatible redefinition of macro "SPIM_COUNT"  (declared at line 124 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIM_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(161): warning:  #47-D: incompatible redefinition of macro "SPIS_COUNT"  (declared at line 132 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIS_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(169): warning:  #47-D: incompatible redefinition of macro "TWIM_COUNT"  (declared at line 136 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIM_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(173): warning:  #47-D: incompatible redefinition of macro "TWIS_COUNT"  (declared at line 140 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIS_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(214): warning:  #47-D: incompatible redefinition of macro "PWM_COUNT"  (declared at line 169 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define PWM_COUNT 3
    ..\..\..\..\..\..\components\drivers_nrf\twi_master\nrf_drv_twi.c: 9 warnings, 0 errors
    compiling nrf_drv_uart.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(63): warning:  #47-D: incompatible redefinition of macro "BPROT_REGIONS_NUM"  (declared at line 55 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define BPROT_REGIONS_NUM 128
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(98): warning:  #47-D: incompatible redefinition of macro "EGU_COUNT"  (declared at line 86 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define EGU_COUNT 6
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(109): warning:  #47-D: incompatible redefinition of macro "TIMER_COUNT"  (declared at line 93 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TIMER_COUNT 5
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(125): warning:  #47-D: incompatible redefinition of macro "RTC_COUNT"  (declared at line 105 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define RTC_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(149): warning:  #47-D: incompatible redefinition of macro "SPIM_COUNT"  (declared at line 124 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIM_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(161): warning:  #47-D: incompatible redefinition of macro "SPIS_COUNT"  (declared at line 132 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIS_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(169): warning:  #47-D: incompatible redefinition of macro "TWIM_COUNT"  (declared at line 136 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIM_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(173): warning:  #47-D: incompatible redefinition of macro "TWIS_COUNT"  (declared at line 140 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIS_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(214): warning:  #47-D: incompatible redefinition of macro "PWM_COUNT"  (declared at line 169 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define PWM_COUNT 3
    ..\..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.c: 9 warnings, 0 errors
    compiling app_error_weak.c...
    compiling app_util_platform.c...
    compiling nrf_assert.c...
    compiling nrf_fprintf.c...
    compiling nrf_balloc.c...
    compiling nrf_fprintf_format.c...
    compiling nrf_log_backend_rtt.c...
    compiling nrf_strerror.c...
    compiling nrf_memobj.c...
    compiling nrf_log_backend_serial.c...
    compiling nrf_log_default_backends.c...
    compiling nrf_log_backend_uart.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(63): warning:  #47-D: incompatible redefinition of macro "BPROT_REGIONS_NUM"  (declared at line 55 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define BPROT_REGIONS_NUM 128
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(98): warning:  #47-D: incompatible redefinition of macro "EGU_COUNT"  (declared at line 86 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define EGU_COUNT 6
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(109): warning:  #47-D: incompatible redefinition of macro "TIMER_COUNT"  (declared at line 93 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TIMER_COUNT 5
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(125): warning:  #47-D: incompatible redefinition of macro "RTC_COUNT"  (declared at line 105 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define RTC_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(149): warning:  #47-D: incompatible redefinition of macro "SPIM_COUNT"  (declared at line 124 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIM_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(161): warning:  #47-D: incompatible redefinition of macro "SPIS_COUNT"  (declared at line 132 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIS_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(169): warning:  #47-D: incompatible redefinition of macro "TWIM_COUNT"  (declared at line 136 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIM_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(173): warning:  #47-D: incompatible redefinition of macro "TWIS_COUNT"  (declared at line 140 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIS_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(214): warning:  #47-D: incompatible redefinition of macro "PWM_COUNT"  (declared at line 169 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define PWM_COUNT 3
    ..\..\..\..\..\..\components\libraries\experimental_log\src\nrf_log_backend_uart.c: 9 warnings, 0 errors
    compiling RTT_Syscalls_KEIL.c...
    compiling SEGGER_RTT.c...
    compiling nrf_log_str_formatter.c...
    assembling arm_startup_nrf52810.s...
    compiling nrf_log_frontend.c...
    compiling system_nrf52810.c...
    RTE\Device\nRF52810_xxAA\system_nrf52810.c(168): error:  #136: struct "<unnamed>"  has no field "MAXPACKETSIZE"
              
    RF_CCM->MAXPACKETSIZE = 0xFBul;
    RTE\Device\nRF52810_xxAA\system_nrf52810.c: 0 warnings, 1 error
    compiling SEGGER_RTT_printf.c...
    ".\_build\nrf52832_xxaa.axf" - 1 Error(s), 54 Warning(s).
    Target not created.
    Build Time Elapsed:  00:00:16

    Software pack status:

  • My setup looks like this:

    It almost compiles, but there is a bug in system_nrf52810.c and the compiler complains about MAXPACKETSIZE being an undefined register. It can be fixed like this:

    if (errata_103()){
        //NRF_CCM->MAXPACKETSIZE = 0xFBul; // <- REMOVE THIS
        *(volatile uint32_t*)(0x4000F000 + 0x518) = 0xFBul; // <- REPLACE WITH THIS
    }

    Starting with nRF5 SDK v14.1.0, we have included examples that target nRF52810 running on the nRF52 Development Kit. The example project that emulates nRF52810 is located in the subfolder pca10040e. More info.

  • After replacing the code, I am able to complie and run my project. Thanks for that.


    Still I am getting lot of warning, probably because I am not able to select 8.16.0 as the STARTUP package in "Manage Run-Time Enviroment" tab. Even in "Software pack" tab if I select 8.16.0 pack, in "Manage Run-Time Enviroment" tab I am not able to change STARTUP package to 8.16.0. STARTUP package option is always 8.14.0.


    I wanted to overcome all warning by selecting appropriate package, so in later phase of my project I don't have to face issue because of library/package incompatibility.


    Can you suggest how can I overcome STARTUP package problem? Please see attachment. I already tried by updating package mannually.

    *** Using Compiler 'V5.06 update 5 (build 528)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
    Build target 'nrf52832_xxaa'
    compiling boards.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(63): warning:  #47-D: incompatible redefinition of macro "BPROT_REGIONS_NUM"  (declared at line 55 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define BPROT_REGIONS_NUM 128
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(98): warning:  #47-D: incompatible redefinition of macro "EGU_COUNT"  (declared at line 86 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define EGU_COUNT 6
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(109): warning:  #47-D: incompatible redefinition of macro "TIMER_COUNT"  (declared at line 93 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TIMER_COUNT 5
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(125): warning:  #47-D: incompatible redefinition of macro "RTC_COUNT"  (declared at line 105 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define RTC_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(149): warning:  #47-D: incompatible redefinition of macro "SPIM_COUNT"  (declared at line 124 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIM_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(161): warning:  #47-D: incompatible redefinition of macro "SPIS_COUNT"  (declared at line 132 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIS_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(169): warning:  #47-D: incompatible redefinition of macro "TWIM_COUNT"  (declared at line 136 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIM_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(173): warning:  #47-D: incompatible redefinition of macro "TWIS_COUNT"  (declared at line 140 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIS_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(214): warning:  #47-D: incompatible redefinition of macro "PWM_COUNT"  (declared at line 169 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define PWM_COUNT 3
    ..\..\..\..\..\..\components\boards\boards.c: 9 warnings, 0 errors
    compiling nrf_drv_common.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(63): warning:  #47-D: incompatible redefinition of macro "BPROT_REGIONS_NUM"  (declared at line 55 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define BPROT_REGIONS_NUM 128
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(98): warning:  #47-D: incompatible redefinition of macro "EGU_COUNT"  (declared at line 86 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define EGU_COUNT 6
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(109): warning:  #47-D: incompatible redefinition of macro "TIMER_COUNT"  (declared at line 93 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TIMER_COUNT 5
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(125): warning:  #47-D: incompatible redefinition of macro "RTC_COUNT"  (declared at line 105 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define RTC_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(149): warning:  #47-D: incompatible redefinition of macro "SPIM_COUNT"  (declared at line 124 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIM_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(161): warning:  #47-D: incompatible redefinition of macro "SPIS_COUNT"  (declared at line 132 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIS_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(169): warning:  #47-D: incompatible redefinition of macro "TWIM_COUNT"  (declared at line 136 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIM_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(173): warning:  #47-D: incompatible redefinition of macro "TWIS_COUNT"  (declared at line 140 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIS_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(214): warning:  #47-D: incompatible redefinition of macro "PWM_COUNT"  (declared at line 169 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define PWM_COUNT 3
    ..\..\..\..\..\..\components\drivers_nrf\common\nrf_drv_common.c: 9 warnings, 0 errors
    compiling nrf_drv_twi.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(63): warning:  #47-D: incompatible redefinition of macro "BPROT_REGIONS_NUM"  (declared at line 55 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define BPROT_REGIONS_NUM 128
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(98): warning:  #47-D: incompatible redefinition of macro "EGU_COUNT"  (declared at line 86 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define EGU_COUNT 6
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(109): warning:  #47-D: incompatible redefinition of macro "TIMER_COUNT"  (declared at line 93 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TIMER_COUNT 5
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(125): warning:  #47-D: incompatible redefinition of macro "RTC_COUNT"  (declared at line 105 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define RTC_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(149): warning:  #47-D: incompatible redefinition of macro "SPIM_COUNT"  (declared at line 124 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIM_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(161): warning:  #47-D: incompatible redefinition of macro "SPIS_COUNT"  (declared at line 132 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIS_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(169): warning:  #47-D: incompatible redefinition of macro "TWIM_COUNT"  (declared at line 136 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIM_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(173): warning:  #47-D: incompatible redefinition of macro "TWIS_COUNT"  (declared at line 140 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIS_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(214): warning:  #47-D: incompatible redefinition of macro "PWM_COUNT"  (declared at line 169 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define PWM_COUNT 3
    ..\..\..\..\..\..\components\drivers_nrf\twi_master\nrf_drv_twi.c: 9 warnings, 0 errors
    compiling app_error.c...
    compiling app_error_weak.c...
    compiling nrf_drv_uart.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(63): warning:  #47-D: incompatible redefinition of macro "BPROT_REGIONS_NUM"  (declared at line 55 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define BPROT_REGIONS_NUM 128
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(98): warning:  #47-D: incompatible redefinition of macro "EGU_COUNT"  (declared at line 86 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define EGU_COUNT 6
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(109): warning:  #47-D: incompatible redefinition of macro "TIMER_COUNT"  (declared at line 93 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TIMER_COUNT 5
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(125): warning:  #47-D: incompatible redefinition of macro "RTC_COUNT"  (declared at line 105 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define RTC_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(149): warning:  #47-D: incompatible redefinition of macro "SPIM_COUNT"  (declared at line 124 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIM_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(161): warning:  #47-D: incompatible redefinition of macro "SPIS_COUNT"  (declared at line 132 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIS_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(169): warning:  #47-D: incompatible redefinition of macro "TWIM_COUNT"  (declared at line 136 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIM_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(173): warning:  #47-D: incompatible redefinition of macro "TWIS_COUNT"  (declared at line 140 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIS_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(214): warning:  #47-D: incompatible redefinition of macro "PWM_COUNT"  (declared at line 169 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define PWM_COUNT 3
    ..\..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.c: 9 warnings, 0 errors
    compiling app_util_platform.c...
    compiling nrf_balloc.c...
    compiling nrf_assert.c...
    compiling nrf_fprintf.c...
    compiling nrf_fprintf_format.c...
    compiling nrf_memobj.c...
    compiling nrf_strerror.c...
    compiling nrf_log_backend_rtt.c...
    compiling nrf_log_backend_serial.c...
    compiling nrf_log_backend_uart.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(63): warning:  #47-D: incompatible redefinition of macro "BPROT_REGIONS_NUM"  (declared at line 55 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define BPROT_REGIONS_NUM 128
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(98): warning:  #47-D: incompatible redefinition of macro "EGU_COUNT"  (declared at line 86 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define EGU_COUNT 6
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(109): warning:  #47-D: incompatible redefinition of macro "TIMER_COUNT"  (declared at line 93 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TIMER_COUNT 5
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(125): warning:  #47-D: incompatible redefinition of macro "RTC_COUNT"  (declared at line 105 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define RTC_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(149): warning:  #47-D: incompatible redefinition of macro "SPIM_COUNT"  (declared at line 124 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIM_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(161): warning:  #47-D: incompatible redefinition of macro "SPIS_COUNT"  (declared at line 132 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define SPIS_COUNT 3
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(169): warning:  #47-D: incompatible redefinition of macro "TWIM_COUNT"  (declared at line 136 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIM_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(173): warning:  #47-D: incompatible redefinition of macro "TWIS_COUNT"  (declared at line 140 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define TWIS_COUNT 2
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52832_peripherals.h(214): warning:  #47-D: incompatible redefinition of macro "PWM_COUNT"  (declared at line 169 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.14.1\Device\Include\nrf52810_peripherals.h")
      #define PWM_COUNT 3
    ..\..\..\..\..\..\components\libraries\experimental_log\src\nrf_log_backend_uart.c: 9 warnings, 0 errors
    compiling nrf_log_str_formatter.c...
    compiling nrf_log_default_backends.c...
    compiling nrf_log_frontend.c...
    compiling SEGGER_RTT_printf.c...
    compiling SEGGER_RTT.c...
    linking...
    Program Size: Code=7932 RO-data=656 RW-data=112 ZI-data=3528  
    FromELF: creating hex file...
    ".\_build\nrf52832_xxaa.axf" - 0 Error(s), 45 Warning(s).
    Build Time Elapsed:  00:00:19

  • Does it help to click Resolve?

    Anyway, in general, if you download the latest SDK from the link I posted earlier, it should not be necessary to configure anything related to the packs. 

Related