Trouble develop with CAN & MCP2515/2518
MARINO SILVIO <m.silvio@...>
Hello Hendrix, with your suggestions, i was able to compile and test the test program on mcp2515 with a nrf52840dk board. In fact, however, I have to make it work with a Thingy91 card using the spare gpio available. I tried to make an overlay file for thingy91_nrf52840.overlay but can't compile it. I'll send you the link with everything. I would be grateful if you could make me understand how to compile with thingy. Best Regards R&D Manager – Electronic Consultant Phone: +39 346 1066499 Skype: live:marino.silvio Web: https://babos.it P - Before printing think about environment and costs
Da: m.silvio@... <m.silvio@...> Thank you Henrik I will let you know,
Best Regards
Silvio
R&D Manager – Electronic Consultant Phone: +39 346 1066499 Skype: live:marino.silvio Web: https://babos.it P - Before printing think about environment and costs
Da: Henrik Brix Andersen <henrik@...> Hi, |
|
m.silvio@babos.it <m.silvio@...>
Thank you Henrik I will let you know,
Best Regards
Silvio
R&D Manager – Electronic Consultant Phone: +39 346 1066499 Skype: live:marino.silvio Web: https://babos.it P - Before printing think about environment and costs
Da:
Henrik Brix Andersen <henrik@...> Hi, |
|
Hi,
toggle quoted message
Show quoted text
Looks like you forgot to add the MCP2515 to your board devicetree. See https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/shields/mcp2515/keyestudio_can_bus_ks0411.overlay for inspiration. ./Brix -- Henrik Brix Andersen On 20 Sep 2022, at 09.11, MARINO SILVIO <m.silvio@...> wrote: |
|
MARINO SILVIO <m.silvio@...>
Hello,
toggle quoted message
Show quoted text
I tried again with a more updated sample, the compilation does not give me more errors but does not see the CAN driver. *** Booting Zephyr OS build v3.0.99-ncs1 *** CAN test app CAN: Device driver not found.. I am attaching the complete program with the results and some picture when reset board. https://drive.google.com/file/d/1q3blO5DIFTnswNks9-Q5fS7JfFkLmmW0/view?usp=sharing Thank you if you can help me Best Regards Silvio Il giorno 20/09/22, 09:11 "MARINO SILVIO" <m.silvio@...> ha scritto: Hi there, attached the compilation log of the sample 'counter' tested as is. i just changed the original prj.conf file to : CONFIG_POLL=y CONFIG_CAN=y CONFIG_SPI=y CONFIG_CAN_MCP2515=y CONFIG_CAN_INIT_PRIORITY=80 CONFIG_CAN_MAX_FILTER=5 CONFIG_SHELL=y CONFIG_CAN_SHELL=y CONFIG_DEVICE_SHELL=y CONFIG_GPIO=y CONFIG_STATS=y CONFIG_STATS_NAMES=y CONFIG_STATS_SHELL=y CONFIG_CAN_STATS=y Best regards Silvio Il giorno 20/09/22, 07:58 "MARINO SILVIO" <m.silvio@...> ha scritto: Sorry. Attached picture Il giorno 20/09/22, 07:57 "MARINO SILVIO" <m.silvio@...> ha scritto: Hello Andersen, I have been trying to make a mcp2515 expansion connected to a Nordic 52840 DK work for a week without success. I can't figure out how to set the CAN functions by connecting them to the mcp_2515 routines already entered in Zephyr. The attached one is the schematic of the connections between the CAN chip and the 52840DK board using the default SPI3 (spim). I simply have to transmit extended data and receive them using the RX and TX interrupt. I am fresh from Zephyr which offers a lot of possibilities but I have always worked in Keil uVision and I still struggle to switch between them. Thank you if you want to help me. Low-level CAN controller samples: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/can would be ideal for understanding the concepts. Silvio Marino Il giorno 19/09/22, 21:12 "Henrik Brix Andersen" <henrik@...> ha scritto: Hi, You link contains the word “socket” as a search string but you are linking to the low-level CAN controller documentation. Are you trying to use Zephyr SocketCAN? Apart from all the CAN test suites under https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/can there are a couple of samples in-tree: - Low-level CAN controller samples: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/can - Zephyr SocketCAN sample: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/net/sockets/can ./Brix -- Henrik Brix Andersen On 19 Sep 2022, at 09.22, m.silvio@... wrote:> > Hello, > see at : https://docs.zephyrproject.org/latest/hardware/peripherals/canbus/controller.html?highlight=socket+can#sending > > there is an inconsistency between the examples and the latest revision. They don't match, for example 'struct can_frame'. I can't get the mcp2515 chip to work with the spi3 on a nordic card and still have compilation errors. Could you send me an example of loop send data over CAN via mcp2515 with the latest revision? Or a relative link to watch? > Thank you very much. > Silvio > > > > <image001.png>Silvio Marino > R&D Manager – Electronic Consultant > Phone: +39 346 1066499 > Skype: live:marino.silvio > Web: https://babos.it > P > - Before printing think about environment and costs > - Prima di stampare pensa ai costi ambientali > > |
|
MARINO SILVIO <m.silvio@...>
Hi there,
toggle quoted message
Show quoted text
attached the compilation log of the sample 'counter' tested as is. i just changed the original prj.conf file to : CONFIG_POLL=y CONFIG_CAN=y CONFIG_SPI=y CONFIG_CAN_MCP2515=y CONFIG_CAN_INIT_PRIORITY=80 CONFIG_CAN_MAX_FILTER=5 CONFIG_SHELL=y CONFIG_CAN_SHELL=y CONFIG_DEVICE_SHELL=y CONFIG_GPIO=y CONFIG_STATS=y CONFIG_STATS_NAMES=y CONFIG_STATS_SHELL=y CONFIG_CAN_STATS=y Best regards Silvio Il giorno 20/09/22, 07:58 "MARINO SILVIO" <m.silvio@...> ha scritto: Sorry. Attached picture Il giorno 20/09/22, 07:57 "MARINO SILVIO" <m.silvio@...> ha scritto: Hello Andersen, I have been trying to make a mcp2515 expansion connected to a Nordic 52840 DK work for a week without success. I can't figure out how to set the CAN functions by connecting them to the mcp_2515 routines already entered in Zephyr. The attached one is the schematic of the connections between the CAN chip and the 52840DK board using the default SPI3 (spim). I simply have to transmit extended data and receive them using the RX and TX interrupt. I am fresh from Zephyr which offers a lot of possibilities but I have always worked in Keil uVision and I still struggle to switch between them. Thank you if you want to help me. Low-level CAN controller samples: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/can would be ideal for understanding the concepts. Silvio Marino Il giorno 19/09/22, 21:12 "Henrik Brix Andersen" <henrik@...> ha scritto: Hi, You link contains the word “socket” as a search string but you are linking to the low-level CAN controller documentation. Are you trying to use Zephyr SocketCAN? Apart from all the CAN test suites under https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/can there are a couple of samples in-tree: - Low-level CAN controller samples: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/can - Zephyr SocketCAN sample: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/net/sockets/can ./Brix -- Henrik Brix Andersen On 19 Sep 2022, at 09.22, m.silvio@... wrote:> > Hello, > see at : https://docs.zephyrproject.org/latest/hardware/peripherals/canbus/controller.html?highlight=socket+can#sending > > there is an inconsistency between the examples and the latest revision. They don't match, for example 'struct can_frame'. I can't get the mcp2515 chip to work with the spi3 on a nordic card and still have compilation errors. Could you send me an example of loop send data over CAN via mcp2515 with the latest revision? Or a relative link to watch? > Thank you very much. > Silvio > > > > <image001.png>Silvio Marino > R&D Manager – Electronic Consultant > Phone: +39 346 1066499 > Skype: live:marino.silvio > Web: https://babos.it > P > - Before printing think about environment and costs > - Prima di stampare pensa ai costi ambientali > > |
|
MARINO SILVIO <m.silvio@...>
Sorry. Attached picture
toggle quoted message
Show quoted text
Il giorno 20/09/22, 07:57 "MARINO SILVIO" <m.silvio@...> ha scritto: Hello Andersen, I have been trying to make a mcp2515 expansion connected to a Nordic 52840 DK work for a week without success. I can't figure out how to set the CAN functions by connecting them to the mcp_2515 routines already entered in Zephyr. The attached one is the schematic of the connections between the CAN chip and the 52840DK board using the default SPI3 (spim). I simply have to transmit extended data and receive them using the RX and TX interrupt. I am fresh from Zephyr which offers a lot of possibilities but I have always worked in Keil uVision and I still struggle to switch between them. Thank you if you want to help me. Low-level CAN controller samples: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/can would be ideal for understanding the concepts. Silvio Marino Il giorno 19/09/22, 21:12 "Henrik Brix Andersen" <henrik@...> ha scritto: Hi, You link contains the word “socket” as a search string but you are linking to the low-level CAN controller documentation. Are you trying to use Zephyr SocketCAN? Apart from all the CAN test suites under https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/can there are a couple of samples in-tree: - Low-level CAN controller samples: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/can - Zephyr SocketCAN sample: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/net/sockets/can ./Brix -- Henrik Brix Andersen On 19 Sep 2022, at 09.22, m.silvio@... wrote:> > Hello, > see at : https://docs.zephyrproject.org/latest/hardware/peripherals/canbus/controller.html?highlight=socket+can#sending > > there is an inconsistency between the examples and the latest revision. They don't match, for example 'struct can_frame'. I can't get the mcp2515 chip to work with the spi3 on a nordic card and still have compilation errors. Could you send me an example of loop send data over CAN via mcp2515 with the latest revision? Or a relative link to watch? > Thank you very much. > Silvio > > > > <image001.png>Silvio Marino > R&D Manager – Electronic Consultant > Phone: +39 346 1066499 > Skype: live:marino.silvio > Web: https://babos.it > P > - Before printing think about environment and costs > - Prima di stampare pensa ai costi ambientali > > |
|
MARINO SILVIO <m.silvio@...>
Hello Andersen,
toggle quoted message
Show quoted text
I have been trying to make a mcp2515 expansion connected to a Nordic 52840 DK work for a week without success. I can't figure out how to set the CAN functions by connecting them to the mcp_2515 routines already entered in Zephyr. The attached one is the schematic of the connections between the CAN chip and the 52840DK board using the default SPI3 (spim). I simply have to transmit extended data and receive them using the RX and TX interrupt. I am fresh from Zephyr which offers a lot of possibilities but I have always worked in Keil uVision and I still struggle to switch between them. Thank you if you want to help me. Low-level CAN controller samples: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/can would be ideal for understanding the concepts. Silvio Marino Il giorno 19/09/22, 21:12 "Henrik Brix Andersen" <henrik@...> ha scritto: Hi, You link contains the word “socket” as a search string but you are linking to the low-level CAN controller documentation. Are you trying to use Zephyr SocketCAN? Apart from all the CAN test suites under https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/can there are a couple of samples in-tree: - Low-level CAN controller samples: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/can - Zephyr SocketCAN sample: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/net/sockets/can ./Brix -- Henrik Brix Andersen On 19 Sep 2022, at 09.22, m.silvio@... wrote:> > Hello, > see at : https://docs.zephyrproject.org/latest/hardware/peripherals/canbus/controller.html?highlight=socket+can#sending > > there is an inconsistency between the examples and the latest revision. They don't match, for example 'struct can_frame'. I can't get the mcp2515 chip to work with the spi3 on a nordic card and still have compilation errors. Could you send me an example of loop send data over CAN via mcp2515 with the latest revision? Or a relative link to watch? > Thank you very much. > Silvio > > > > <image001.png>Silvio Marino > R&D Manager – Electronic Consultant > Phone: +39 346 1066499 > Skype: live:marino.silvio > Web: https://babos.it > P > - Before printing think about environment and costs > - Prima di stampare pensa ai costi ambientali > > |
|
Hi,
toggle quoted message
Show quoted text
You link contains the word “socket” as a search string but you are linking to the low-level CAN controller documentation. Are you trying to use Zephyr SocketCAN? Apart from all the CAN test suites under https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/can there are a couple of samples in-tree: - Low-level CAN controller samples: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/can - Zephyr SocketCAN sample: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/net/sockets/can ./Brix -- Henrik Brix Andersen On 19 Sep 2022, at 09.22, m.silvio@... wrote: |
|
m.silvio@babos.it <m.silvio@...>
Hello,
there is an inconsistency between the examples and the latest revision. They don't match, for example 'struct can_frame'. I can't get the mcp2515 chip to work with the spi3 on a nordic card and still have compilation errors. Could you send me an example of loop send data over CAN via mcp2515 with the latest revision? Or a relative link to watch? Thank you very much. Silvio
R&D Manager – Electronic Consultant Phone: +39 346 1066499 Skype: live:marino.silvio Web: https://babos.it P - Before printing think about environment and costs
|
|