- Edited
Not sure if anyone on here can help guide me through the apparent minefield I am currently facing. Its seems like a simple task on the face of it, but I’m making a bit of a mess of it.
I’m a relative newcomer to Zephyr/nRF Connect SDK/VSC, so fumbling my way around a bit.
I’m currently trying to get some code together to enable me to read/write times to my PCB85063A RTC. I know the hardware is working, because I’ve tested it on my Cypress DevKit (long story here). But I can’t seem to get anything out of it when I hook it up to my nRF52-DK.
Essentially I grabbed Jared’s pcf85063a.c and pcf85063a.h files and added them directly into my project (yep, probably not the best way to go about it, but I’m still feeling my way here!). I added an overlay file so I could reference the device via DeviceTree:
&i2c0 { /* SDA P0.26, SCL P0.27 */
pcf85063a@51 {
compatible = "nxp,pcf85063a";
label = "PCF85063A";
reg = <0x51>;
};
};
This kicked up some errors in the overlay file. The first associated with pcf85063a@51. It was saying something like:
Only i2c nodes accepted in /soc/i2c@40003000/.
The second was associated with:
compatible = "nxp,pcf85063a" - Unknown node type "nxp,pcf85063a"
Also, when I try and add CONFIG_PCF85063A=y to my .proj file, it says:
attempt to assign the value 'y' to the undefined symbol PCF85063A
Everything seems to build without errors if I remove the CONFIG_PCF85063A=y reference. But when I try and do something simple in my code like:
`const struct device *dev = device_get_binding(“PCF85063A”);
if (dev == NULL) {
printk("Could not get PCF85063A device\n");
return;
}`
I get the “Could not get PCB85063A device” statement.
I could do with a bit of help stepping my way through the set up process if anyone has gone down this path before and can help out someone on their L-plates!
Cheers,
Mike