2025-10-20 6:12 AM - last edited on 2025-10-20 8:12 AM by mƎALLEm
Hello,
I am working with an stm32f429_disc board, which has an onboard i3g4250d gyroscope that communicates via SPI. The Zephyr SDK includes a sensor driver for this specific sensor.
However, even though I have defined this sensor under the SPI node in my overlay file, I am getting an undefined reference to __device_dts_ord_... linker error.
The strange part is that when I define a sensor with a different compatible string under this same node (for example, bosch-bme280), I don't get any errors. But when I specifically define it as st-i3g4250d, I receive the linker error.
My code is as follows;
#define I3G_NODE DT_NODELABEL(i3g4250)
const struct device* dev_sensor = DEVICE_DT_GET(I3G_NODE);;
int main()
{
if (!device_is_ready(dev_sensor)){
printk("error device is not ready\n");
return 0;
}
}
&spi5 {
compatible = "st,stm32-spi";
pinctrl-0 = <&spi5_sck_pf7 &spi5_miso_pf8 &spi5_mosi_pf9>;
pinctrl-names = "default";
status = "okay";
cs-gpios = <&gpioc 1 GPIO_ACTIVE_LOW>;
i3g4250: i3g4250@0{
compatible = "st,i3g4250d";
reg = <0>;
spi-max-frequency = <1000000>;
status = "okay";
};
};