Hello,
I have modified the SPI flash AT45 Sample (which compiles fine) to work with a AT25 model, the problem is it doesn't compile and it gives undefined reference to `__device_dts_ord_77'.
I know that errors of that kind are related to a missing Kconfig line or badly written DTS file, but I can't find the issue:
// Copyright (c) 2024 Nordic Semiconductor ASA
// SPDX-License-Identifier: Apache-2.0
/dts-v1/;
#include <nordic/nrf52833_qiaa.dtsi>
/ {
model = "mouse";
compatible = "mouse";
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x0 0xc000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0xc000 0x32000>;
};
slot1_partition: partition@3e000 {
label = "image-1";
reg = <0x3e000 0x32000>;
};
scratch_partition: partition@70000 {
label = "image-scratch";
reg = <0x70000 0xa000>;
};
storage_partition: partition@7a000 {
label = "storage";
reg = <0x7a000 0x6000>;
};
};
};
&pinctrl {
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 0)>,
<NRF_PSEL(SPIM_MOSI, 0, 1)>,
<NRF_PSEL(SPIM_MISO, 0, 4)>;
};
};
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 0)>,
<NRF_PSEL(SPIM_MOSI, 0, 1)>,
<NRF_PSEL(SPIM_MISO, 0, 4)>;
low-power-enable;
};
};
};
&spi0 {
status = "okay";
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
max-frequency = <DT_FREQ_M(10)>;
interrupts = <11>, <NRF_DEFAULT_IRQ_PRIORITY>;
cs-gpios = <&gpio0 11 0>;
at25@0 {
status = "okay";
compatible = "atmel,at25";
reg = <0>;
size = <125>;
pagesize = <8>;
spi-max-frequency = <DT_FREQ_M(10)>;
address-width = <8>;
timeout = <5>;
};
};
&gpio0 {
status = "okay";
};
CONFIG_STDOUT_CONSOLE=y
CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_SPI=y
CONFIG_FLASH=y
CONFIG_PM_DEVICE=y
CONFIG_PINCTRL=y
CONFIG_GPIO=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y # needed for my board
Also I changed atmel_45 to atmel_25 in the following source code line:
const struct device *const flash_dev = DEVICE_DT_GET_ONE(atmel_at25);
Can anyone spot the error?