Hi I am receiving the error "Linking C executable zephyr\zephyr_pre0.elf FAILED:" which I have found is linked to the mcp7940 device tree node through the error code " undefined reference to `__device_dts_ord_57'" in the device_generated.h file. I want to include in the device tree the interrupt that the mcp7940 on gpio 0 21 of the NRF52805 but I'm not sure if this is best practice or not. How do I solve this error and include the gpio interrupt in the device tree?
Here is the device tree node for the MCP7940n and the corresponding device tree binding.
Device Tree node
&i2c0 {
status = "okay";
pinctrl-0 =<&i2c0_default>;
pinctrl-1 =<&i2c0_sleep>;
pinctrl-names = "default","sleep";
clock-frequency = <100000>;
mcp7940n: mcp7940n@6f {
compatible = "microchip,mcp7940n";
reg = <0x6f>;
label = "MCP7940N_RTC";
//int-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; // Use actual GPIO pin where interrupt is connected
};
};
.yaml binding
#
# Copyright (c) 2021 Laird Connectivity
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#
description: Microchip MCP7940N I2C RTC with battery-backed SRAM
compatible: "microchip,mcp7940n"
include: i2c-device.yaml
properties:
reg:
type: array
description: |
The I2C address of the device 0x6F