Skip to content

Commit 972d026

Browse files
committed
CAN bus content update
1 parent e29ad5f commit 972d026

File tree

1 file changed

+19
-1
lines changed
  • content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual

1 file changed

+19
-1
lines changed

content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual/content.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3209,12 +3209,30 @@ Within the Portenta X8's shell, Docker containers offer a streamlined environmen
32093209
cansend
32103210
```
32113211

3212-
And as an example, if you need to send a specific CAN frame, the _cansend_ command can be used in the following format:
3212+
And as an example, if you need to send a specific CAN frame, the _cansend_ command can be used to achieve this task. The command follows the format:
3213+
3214+
```bash
3215+
cansend <CAN Interface [can0 | can1]> <CAN ID>#<Data_Payload>
3216+
```
3217+
3218+
- `<CAN Interface [can0 | can1]>`: defines the CAN interface that the Portenta X8 will use with the Portenta Hat Carrier.
3219+
- `<CAN ID>`: is the identifier of the message and is used for message prioritization. The identifier can be in 11-bit or 29-bit format.
3220+
- `<Data_Payload>`: is the data payload of the CAN message and ranges from 0 to 8 bytes in standard CAN frames.
3221+
3222+
For instance, the following command example would send a CAN message on the `can0` interface with an ID of `123`, using an 11-bit identifier, and a data payload of `DEADBEEF`:
32133223

32143224
```bash
32153225
cansend can0 123#DEADBEEF
32163226
```
32173227

3228+
While the following command example with a 29-bit identifier would send a CAN message with an extended ID of `1F334455` and a data payload of `1122334455667788`.
3229+
3230+
```bash
3231+
cansend can0 1F334455#1122334455667788
3232+
```
3233+
3234+
This command sends a message with an extended CAN ID and an 8-byte payload.
3235+
32183236
To use the `cansend` command, it is crucial to set up the appropriate environment. First, clone the following container repository
32193237

32203238
```bash

0 commit comments

Comments
 (0)