DHCOM STM32MP1 Linux: Difference between revisions

From Wiki-DB
Jump to navigationJump to search
Line 30: Line 30:


=== CAN interface ===
=== CAN interface ===
:'''Setup CAN interface with baudrate 500kbit/sec.'''
:{| class="wikitable"
|<tt>''ip link set can0 up type can bitrate 500000''</tt>
|}
:'''Start to listen on CAN port'''
:{| class="wikitable"
|<tt>''candump can0''</tt>
|}
:'''Send test message'''
:{| class="wikitable"
|<tt>''cansend can0 100#11.2233.44556677.88''</tt>
|}
:'''Deinitialize CAN port'''
:{| class="wikitable"
|<tt>''ip link set can0 down''</tt>
|}

Revision as of 05:52, 9 April 2020

Kernel Userspace Interfaces to Access Hardware

RS-485 on picoITX

RS-485 device
DHCOM UART 2 /dev/ttySTM2
Compilation on target
gcc tty_rs485_test.c -o tty_rs485_test
Set tty device to raw mode
stty -F /dev/ttySTM2 115200 cs8 raw -echo
Send data with demo program
./tty_rs485_test /dev/ttySTM2
Receive data with demo program
./tty_rs485_test /dev/ttySTM2

CAN interface

Setup CAN interface with baudrate 500kbit/sec.
ip link set can0 up type can bitrate 500000
Start to listen on CAN port
candump can0
Send test message
cansend can0 100#11.2233.44556677.88
Deinitialize CAN port
ip link set can0 down