cancel
Showing results for 
Search instead for 
Did you mean: 

CAN communication on STM32MP157f-dk2

ienecode
Associate III

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:

Faulty boards out of the box 

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:

 

sendData.jpg

What can be wrong with CAN in STM ?
Please for any tips.

2 REPLIES 2
Ozone
Lead II

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.

ienecode
Associate III

@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 :

isCAN<->usb