I adding custom pins declarations through overlay file as in first image with corresponding yaml file ( see attachment) with path .. /dts/bindings/gpio/custom.yaml. The project creation and build is successful, but at run time, it is observed that the pointer to custom pin is NULL and it;s addres also is NULL as shown in scond image. The code to initialize the custom pins is in attached file. This problem is with one pin only ... all previous pins are properly assgned the pointer and address.
#define BMS_RESET_NODE DT_ALIAS(bmsreset)
#if !DT_NODE_HAS_STATUS(BMS_RESET_NODE, okay)
#error "Unsupported board: BMS RESET PIN devicetree alias is not defined"
#endif
static struct gpio_dt_spec bms_reset_pin = GPIO_DT_SPEC_GET_OR(BMS_RESET_NODE, bmsios,{0});
if (bms_reset_pin.port && !device_is_ready(bms_reset_pin.port)) {
printk("Error %d: BMS RESET device %s is not ready; ignoring it\n",
ret, bms_reset_pin.port->name);
bms_reset_pin.port = NULL;
}
if (bms_reset_pin.port) {
ret = gpio_pin_configure_dt(&bms_reset_pin, GPIO_OUTPUT_LOW);
if (ret != 0)
{
printk("Error %d: failed to configure BMS RESET device %s pin %d\n",
ret, bms_reset_pin.port->name, bms_reset_pin.pin);
bms_reset_pin.port = NULL;
} else
{
printk("Set up BMS RESET at %s pin %d\n", bms_reset_pin.port->name, bms_reset_pin.pin);
}
}