Hi, I can get ahold of the SPI device and call the spi_transceive function wihtout returning error codes. Logic analyzer shows nothing happening, such as SCK clocking. I am using the NRF52833-DK board.
In pj.conf:
CONFIG_SPI=y
Hi, I can get ahold of the SPI device and call the spi_transceive function wihtout returning error codes. Logic analyzer shows nothing happening, such as SCK clocking. I am using the NRF52833-DK board.
In pj.conf:
CONFIG_SPI=y
Hello,
Kind regards,
Øyvind
Hi Øyvind,
-Are you referring to the .ninja_log? Will provide when certain.
-SDK version is 2.2.0
--Yes, started with 'hello world' for nRF52833. Have 802.15.4, GPIO output, GPIO inputs w/ interrupts, and GPIOTE working
Thank you!
-Ben
Oh, I missunderstood. Yes, it is outputting a '0', which is success. I am printing over UART to NRF console. I'll have a look and get back. Thanks!
Hi Øyvind,
The sample project has been helpful! I think I may have found an issue though. I choose nrf52833dk_nrf52833 as my board as that is my dev board. When making my overlay, all the references, such as &spi2, are referencing nrf52dk_nrf52832.dts. Thi pins specified do not match the dev board I have so could this be a bug with nRF Connect? I figured I'd ask.
Aside from that, I cannot get the example to compile I am getting this now:
zephyr\include\zephyr\device.h:83:41: error: '__device_dts_ord_DT_N_NODELABEL_mcp2517fd_BUS_P_cs_gpios_IDX_DT_N_NODELABEL_mcp2517fd_REG_IDX_0_VAL_ADDRESS_PH_ORD' undeclared here (not in a function)
83 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~~~
C:\Users\Bmalch01\ncs\v2.2.0\zephyr\include\zephyr\device.h:209:37: note: in expansion of macro 'DEVICE_NAME_GET'
209 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
| ^~~~~~~~~~~~~~~
C:\Users\Bmalch01\ncs\v2.2.0\zephyr\include\zephyr\device.h:226:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
226 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
It cannot get a reference to the CS pin. I had to add some tweaks to get the overlay to not have errors. I'll highlight those:
Forgot to add this as it shows where the error is being generated:
It looks like I missed some steps in West. I think this can be closed and I have to go back and familiarize myself with the initial env. setup. Thanks for the SPI example though! It was useful.
After realizing I made some dumb mistakes, I have it linking. Figured I'd post in case someone else wants some snippets. Thanks again!
After realizing I made some dumb mistakes, I have it linking. Figured I'd post in case someone else wants some snippets. Thanks again!
Thanks for sharing, bmalchow ! Happy to hear that you found the solution.
Did you end up getting this code working? I am going to use the same chip and was curious if you had posted your code anywhere? I would love to take a look at it.
I did, it works well and reliably. All code is pasted in this thread. Used git post that was recommended as well. Changed these lines as well:
#define MY_SPI_MASTER DT_NODELABEL(canspi)
#define MY_SPI_DEVICE DT_NODELABEL(mcp2517fd)
spi_dev = DEVICE_DT_GET(MY_SPI_MASTER);