Re: device_get_binding() returns NULL

Kumar Gala

How is CONFIG_GPIO_PCAL9535A_0_DEV_NAME getting set in your build?

- k

On Feb 16, 2019, at 10:55 AM, wrote:


I am testing Zephyr on an Intel Galileo Gen2. While trying to implement something similar to Blinky Application from Basic Samples, it seems that the API function device_get_binding() returns NULL, and I have no idea what I am doing wrong.
This is main.c
#include <zephyr.h>
#include <misc/printk.h>
#include <device.h>
#include <pwm.h>
//#include <board.h>

void main(void)
struct device *exp0 = device_get_binding(CONFIG_GPIO_PCAL9535A_0_DEV_NAME);
if (!exp0) {
printk("Error occured!\n");
printk("This is never printed :(\n");

An the output is:

WARNING: no console will be available to OS
error: no suitable video mode found.
***** Booting Zephyr OS v1.14.0-rc1-60-g9072d34f30 *****
Error occured!

I tried to add CONFIG_GPIO_PCAL9535A_0=y to prj.conf, but that didn't solved the problem.
No need to mention that I am a newbie not only with Zephyr...

Join to automatically receive all group messages.