Hi,
I am having a hard time for days now trying to get the MCP2518FD working on a nRF9160-DK board. This device, embedding CAN transceiver and receiver, is accessible through SPI.
I ran into several forums and some doc here and there but nothing seems to match my case.
As a context, I use the ncs v2.6.0 and a custom board (which for now is basically just the nRF9160-DK board, meaning that my dts file simply includes <nordic/nrf9160ns_sica.dtsi> and defines partitions) and then I use an overlay for the real custom devices, which is as follows (shrunk to show only relevant fields) :
Which comes along with this prj.conf file (shrunk to show only relevant fields) :
Just to let you know, my MCP2518FD is in fact the Mikrochip MCP2518FD clickboard but I expected to have it working without using the -DSHIELD compilation option since it only has to be seen as a SPI device.
Now that said, I am pretty new to the devicetree and Nordic dev environment. I got to understand that the main interface I will be using is the <zephyr/drivers/can.h>. But my problem pops before any manual usage of these functions. I managed to put some log in the "zephyr\drivers\can\can_mcp251xfd.c" in the mcp251xfd_init and mcp251xfd_read_crc functions (called by the very first mcp251xfd_set_mode_internal and mcp251xfd_reset functions). In the nRF Connect's Serial Terminal v1.3.1, here is the result I got :
So from my understanding, the init function is implicitly called at boot time. SPI and GPIO init, inherited from what I specified in the overlay, work well. But when it comes to the very first SPI communication, I got a CRC error which I can't understand the origin since no complex operation is done here.
Moreover, I only wired the SPI and power pins. Whenever I also wire the P0.16 to the INT pin of my clickboard, I don't even get all this log and stop after "Booting TF-M v2.0.0", meaning I don't even boot I guess.
Feel free to ask for any additionnal information that might help.
Thank you in advance for your help.
Guillaume R