> For the complete documentation index, see [llms.txt](https://dev.solid-run.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.solid-run.com/nxp/imx6/sbc-platform/imx6-other-articles/hummingboard-cbi-rs485-and-can-bus.md).

# HummingBoard CBi RS485 and CAN bus

## Test CAN bus communication

**1. Enable device can0 (for ex):**

```
ip link set can0 up type can bitrate xxxxxx
```

* (ex: 125000)

**2. Bring the CAN interface up:**

```
ifconfig can0 up
```

{% hint style="info" %}
To discover your CAN bus interface name, please run ‘ ip link show ’.
{% endhint %}

**3. To start testing the CanBUS, you have to install the can-utils package by running:**

```
sudo apt-get install -y can-utils 
```

* For more information, please follow the [CAN-Utils](https://github.com/linux-can/can-utils), which are available for Debain/Ubuntu etc.

**4. Print all data received by CAN interface to “can\_test” file (for ex):**

```
candump can0 >> /tmp/can_test &
```

**5. Send data to the bus by executing (for ex):**

```
cansend can0 "123#1234"
```

**6. Check received data by opening “can\_test” file:**

```
cat /tmp/can_test
```

## Test RS-485 communication

An example for testing RS485 communication:

**1. Open a test file “rs485\_test”**

```
rs485conf -e 1 /dev/ttymxc1
touch /tmp/rs485_test
stty -F /dev/ttymxc1 raw -echo -echoe -echok
```

**2. Print received data to “rs485\_test” file:**

```
cat /dev/ttymxc1 > /tmp/rs485_test &
echo "rs485" > /dev/ttymxc1
```

* For more information, please refer to [HummingBoard CBi RS485 and CANBus pin mapping](/nxp/imx6/sbc-platform/imx6-other-articles/hummingboard-cbi-rs485-and-canbus-pin-mapping.md) .


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dev.solid-run.com/nxp/imx6/sbc-platform/imx6-other-articles/hummingboard-cbi-rs485-and-can-bus.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
