Hello, Devzone community :)
I'm trying to use the SPI_DT_GET_SPEC without success. I have constant 3 errors:
My initialization on the main file:
My overlay:
Hello, Devzone community :)
I'm trying to use the SPI_DT_GET_SPEC without success. I have constant 3 errors:
error: 'DT_N_S_soc_S_spi_4002f000_S_foo_0_P_duplex' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_spi_4002f000_S_foo_0_P_label'? error: 'DT_N_S_soc_S_spi_4002f000_S_foo_0_P_spi_max_frequency' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_spi_4002f000_S_foo_0_P_compatible_LEN'? error: 'DT_N_S_soc_S_spi_4002f000_S_foo_0_P_frame_format' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_spi_4002f000_S_foo_0_P_reg_IDX_0'?
My initialization on the main file:
#define SPI3_NODE DT_NODELABEL(foo) static const struct spi_dt_spec dev_spi = SPI_DT_SPEC_GET(SPI3_NODE, SPI_WORD_SET(8) | SPI_MODE_GET(0), 0);
My overlay:
&spi3 { foo: foo@0{ compatible = "spi-device"; reg = <0>; spi-max-frequency = < DT_FREQ_M(8) >; label = "FOO"; }; };
Hi
For us to help you with this in the best possible way, please list the following information:
Also, what is your end goal with "dev_spi"?
Regards,
Sigurd Hellesvik
Hi
For us to help you with this in the best possible way, please list the following information:
Also, what is your end goal with "dev_spi"?
Regards,
Sigurd Hellesvik
Apologies!
NCS V2.2.0
nRF52840 (DK)/ nRF5340 (DK)
Not using any samples, my prj.cfg is CONFIG_SPI=y, CONFIG_I2C=y, CONFIG_LOG=y.
End goal: using it in initializing SPI sensor and read from it
A colleague of mine has made an NCS-SPI-Master-Slave-Example.
Look at this and see if you can figure out how to use the devicetree from this.
Let me know if you have any questions afterwards.
Regards,
Sigurd Hellesvik
Hi,
The sample does not use the same macro.
I suspect this might be an XY problem:
X:
Meh said:End goal: using it in initializing SPI sensor and read from it
Y: Use SPI_DT_GET_SPEC.
I think that the sample will solve X, and therefore you do not need to use SPI_DT_GET_SPEC.
Let me know if I am mistaken.
Regards,
Sigurd Hellesvik
Still not helping - I've built the driver based on the spi_dt_spec struct and changing the structure cause more hassle than helps