NRF9160 Can bus devicetree problems

I need to use can bus for my application. The chip that will be used will be the MCP2515 can bus ic. For testing puposes i went and tried the CAN sample which is meant for the NRF51 if im right. Futher i looked into other people trying this but i cant seem to get it the point where i get errors that are fixable for me. I have added an overlay (used a copy from  RE: nRF9160 samples : undefined device names for device_get_binding )

I constantly get problems of macros missing as shown below: 

In file included from C:\Users\andri\ncs\v1.9.1\zephyr\include\toolchain\gcc.h:72,
from C:\Users\andri\ncs\v1.9.1\zephyr\include\toolchain.h:50,
from C:\Users\andri\ncs\v1.9.1\zephyr\include\kernel_includes.h:19,
from C:\Users\andri\ncs\v1.9.1\zephyr\include\kernel.h:17,
from C:\Users\andri\ncs\v1.9.1\zephyr\include\zephyr.h:18,
from c:\GIT\nrf-workspace\can\src\main.c:7:
C:\Users\andri\ncs\v1.9.1\zephyr\include\device.h:96:39: error: '__device_dts_ord_DT_CHOSEN_zephyr_canbus_ORD' undeclared here (not in a function)
96 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)
| ^~~~~~~~~
C:\Users\andri\ncs\v1.9.1\zephyr\include\toolchain\common.h:132:26: note: in definition of macro '_DO_CONCAT'
132 | #define _DO_CONCAT(x, y) x ## y
| ^
C:\Users\andri\ncs\v1.9.1\zephyr\include\device.h:96:31: note: in expansion of macro '_CONCAT'
96 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)
| ^~~~~~~
C:\Users\andri\ncs\v1.9.1\zephyr\include\device.h:291:37: note: in expansion of macro 'DEVICE_NAME_GET'
291 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_NAME(node_id))
| ^~~~~~~~~~~~~~~
C:\Users\andri\ncs\v1.9.1\zephyr\include\device.h:311:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
311 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
| ^~~~~~~~~~~~~~~~~~
c:\GIT\nrf-workspace\can\src\main.c:28:32: note: in expansion of macro 'DEVICE_DT_GET'
28 | const struct device *can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
| ^~~~~~~~~~~~~

The only thing that i was able to find that it has something to do with the devicetree. But i dont understand why the headers are missing in the sample code.

Any help is much appriciated. 

Parents Reply Children
Related