Any help would awesome! I’m sure this is so basic, but just can’t seem to figure it out…
We have a custom board Zephyr project using the Zephyr library’s modem Quectel BG9x drivers, but struggling to get the device tree set pins to be recognised.
We’ve set it up in the device tree
&uart3 {
status = "okay";
current-speed = <115200>;
tx-pin = <33>;
rx-pin = <32>;
//rts-pin = <19>;
//cts-pin = <21>;
quectel_bg9x {
compatible = "quectel,bg9x";
label = "quectel,bg9x";
status = "okay";
mdm-reset-gpios = <&gpio0 5 0>;
mdm-power-gpios = <&gpio0 4 0>;
/*ring-indicator-gpios = <&gpio0 15 0>;
dtr-gpios = <&gpio1 0 0>;
enable-gpios = <&gpio1 4 0>;*/
};
};
Inside the quectel_bg9x.h header file the error happens here on the lines where the pins are configured:
// Modem pin config uses the device tree binding to set this up
static struct modem_pin modem_pins[] = {
/* MDM_POWER */
MODEM_PIN(DT_INST_GPIO_LABEL(0, mdm_power_gpios),
DT_INST_GPIO_PIN(0, mdm_power_gpios),
DT_INST_GPIO_FLAGS(0, mdm_power_gpios) | GPIO_OUTPUT_LOW),
/* MDM_RESET */
MODEM_PIN(DT_INST_GPIO_LABEL(0, mdm_reset_gpios),
DT_INST_GPIO_PIN(0, mdm_reset_gpios),
DT_INST_GPIO_FLAGS(0, mdm_reset_gpios) | GPIO_OUTPUT_LOW),
};
And we’re getting the errors
‘DT_N_INST_0_DT_DRV_COMPAT_P_mdm_power_gpios_IDX_0_PH_P_label’ undeclared here (not in a function)
‘DT_N_INST_0_DT_DRV_COMPAT_P_mdm_power_gpios_IDX_0_VAL_pin’ undeclared here (not in a function)
‘DT_N_INST_0_DT_DRV_COMPAT_P_mdm_reset_gpios_IDX_0_PH_P_label’ undeclared here (not in a function)
‘DT_N_INST_0_DT_DRV_COMPAT_P_mdm_reset_gpios_IDX_0_VAL_pin’ undeclared here (not in a function)
Is there a device tree naming convention or something that we’re missing?