2025-01-31 01:43 AM - edited 2025-01-31 01:48 AM
Hi,
I would like to use CAN communication on my devboard : STM32MP157f-DK2.
So I prepared OS, unfortunatelly I have to flash STM32MP157c-DK2 version according with problem described below:
So, after run OS, I edited *.dts file, by initialized &m_can1 device on PA11 and PA12 pins, which one exposed on the board connector - CN2, and connected "MCP2542 click CAN bus transceiver" board.
In OpenSTlinux userspace I try recive CAN frames by command: candump can0, and there is any problem, because when I send full frame with 8 bytes that it doesn't arrive to device. Maksimum only 5 bytes in frame arrives, like below:
What can be wrong with CAN in STM ?
Please for any tips.
2025-01-31 02:52 AM
I assume the problem is in your interpretation of the output.
A standard CAN frame always contains an 8 byet payload. However, it is preceeded by a length code (DLC) which tells the receiver how many of this 8 bytes are valid.
I would say, check with the documentation of the "host" (STM32MP157) CAN application, and the connected device(s).
My company e.g. extensively uses CANopen, were several defined frames have just a 1 or 2 byte payload.
2025-01-31 03:28 AM - edited 2025-01-31 03:37 AM
@Ozone
Interpretation of the output ? In OpenStlinux The BOSCH M_CAN driver is enabled by default, to read frames by CAN I am susing can-utils (This repository contains some userspace utilities for Linux CAN subsystem (aka SocketCAN)).
To send frames from host I use below USB converter :