chipsalliance / VeeRwolf

FuseSoC-based SoC for VeeR EH1 and EL2
269 stars 61 forks source link

Zephyr with adxl362 fails to compile #14

Open ddandare opened 4 years ago

ddandare commented 4 years ago

Hi, I'm trying to add adxl362 accelerometer support to Zephyr. the accelerometer is connected to SPI1 via multicon and is working ok using an ASM program. However, when trying to compile, using wall, a Zephyr program (hello world) with this driver enabled, I get this error:

In file included from ../soc/riscv/swervolf/soc.h:12,
                 from ../include/arch/riscv/arch.h:25,
                 from ../include/arch/cpu.h:25,
                 from ../include/kernel_includes.h:39,
                 from ../include/kernel.h:17,
                 from /home/artecs/zephyr/drivers/sensor/adxl362/adxl362.c:11:
zephyr/include/generated/devicetree_unfixed.h:603:36: error: 'DT_N_S_soc_S_spi_80001100_S_adi_adxl362_0_P_spi_max_frequency' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_spi_80001040_S_flash_0_P_spi_max_frequency'?

hello world works ok with this driver disabled using guiconfig.

spi1, adxl362 and spi-max-frequency are included in swervolf_nexys.dts as follows:

&spi1 {
    status = "okay";

    adi_adxl362: adi_adxl362@0 {
        compatible = "adi_adxl362";
        label = "adi_adxl362";
        reg = <0>;
        spi-max-frequency = <2000000>;
    };
};

spi1@80001100 is defined at riscv32-swerv.dtsi.

any hint on the cause of the error? Thanks

olofk commented 1 year ago

I'm afraid I'm absolutely terrible with device trees and the Zephyr macros. If you ever found out how to make this work I would be happy to know more