How to use SPI_DT_GET_SPEC macro properly?

Hello, Devzone community :)

I'm trying to use the SPI_DT_GET_SPEC without success. I have constant 3 errors:

Fullscreen
1
2
3
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'?
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

My initialization on the main file:

Fullscreen
1
2
#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);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

My overlay:

Fullscreen
1
2
3
4
5
6
7
8
9
&spi3 {
foo: foo@0{
compatible = "spi-device";
reg = <0>;
spi-max-frequency = < DT_FREQ_M(8) >;
label = "FOO";
};
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX