DHCOM STM32MP1 Linux: Difference between revisions

From Wiki-DB
Jump to navigationJump to search
Ageisreiter (talk | contribs)
Ageisreiter (talk | contribs)
Line 27: Line 27:
|}
|}


:'''Download example source code'''
:* [[media:Tty_rs485_test.zip | tty_rs485_test.c]]
:* [[media:Tty_rs485_test.zip | tty_rs485_test.c]]



Revision as of 06: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
Download example source code

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