You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -571,49 +571,42 @@ Devices with a USB-A interface, such as storage drives, can be used for logging
571
571
#### Using Linux
572
572
<br></br>
573
573
574
-
As an example, following command on Portenta X8's shell can be used to test write command with a USB memory drive. To write a file, following sequence of commands can help you accomplish such task.
574
+
As an example, the following command on Portenta X8's shell can be used to test a write command with a USB memory drive. To write a file, the following sequence of commands can help you to accomplish such task.
575
575
576
576
```bash
577
-
dmesg -w
577
+
sudo su -
578
578
```
579
-
580
-
The `dmesg -w` command displays kernel messages, helping you monitor system events in real-time. It is particularly useful to see if it has recognized the USB drive when plugged in.
579
+
First of all let's enter in root mode to have the right permissions to mount and unmount related peripherals like our USB memory drive.
581
580
582
581
```bash
583
582
lsblk
584
583
```
585
584
586
-
The `lsblk` command lists all available block devices, such as hard drives and USB drives. It helps in identifying the device name, like `/dev/sda1` which is the partition designation, of the plugged-in USB drive.
585
+
The `lsblk` command lists all available block devices, such as hard drives and USB drives. It helps in identifying the device name, like `/dev/sda1` which is will be probably the partition designation of the USB drive you just plugged in. A common trick to identify and check the USB drive connected is to execute the `lsblk` command twice; once with the USB disconnected and the next one to the USB connected, to compare both results and spot easily the new connected USB drive. Additionally, the command `lsusb` can be used to gather more information about the connected USB drive.
587
586
588
587
```bash
589
588
mkdir -p /mnt/USBmount
590
589
```
591
590
592
-
The `mkdir -p` command creates the directory `/mnt/USBmount`. If the directory already exists, this command won't produce an error. This directory will be used as a mount point for the USB drive.
591
+
The `mkdir -p` command creates the directory `/mnt/USBmount`. This directory will be used as a mount point for the USB drive.
593
592
594
593
```bash
595
594
mount -t vfat /dev/sda1 /mnt/USBmount
596
595
```
597
596
598
-
This mount command mounts the USB drive, assumed to have a FAT filesystem (`vfat`), located at `/dev/sda1` to the directory `/mnt/USBmount`. Once mounted, the content of the USB drive can be accessed from the `/mnt/USBmount` directory.
597
+
This mount command mounts the USB drive, assumed to have a FAT filesystem (`vfat`), located at `/dev/sda1` to the directory `/mnt/USBmount`. Once mounted, the content of the USB drive can be accessed from the `/mnt/USBmount` directory with `cd`:
This command will create a _random.bin_ file filled with 16 Kilobytes of random data. It reads data from the system's pseudo-random number generator `/dev/urandom` and writes it to the file in chunks of 1 Kilobyte.
605
-
606
-
To read the _random.bin_ file with random data, you can use the following command:
603
+
Now if you do and `ls` you can see the actual content of the connected USB Drive.
This will read the previously generated _random.bin_ file and displays its content in a hexadecimal format on the console. Data is read in chunks of 1 Kilobyte up to 16 Kilobytes and then processed for display using `hexdump`.
613
-
614
-
***Reading the entire _random.bin_ file with the `hexdump` command will produce a large output on the console. Use with caution.***
615
-
616
-
In the Portenta X8's shell, if you aim to create a text file containing the message `Hello, World!` on a USB memory drive, you can employ the command:
609
+
Let's create a simple text file containing the message `Hello, World!` in the already connected USB memory drive using the following command:
@@ -626,10 +619,12 @@ Subsequently, the message gets inscribed into a file named _helloworld.txt_ situ
626
619
After creating the file, if you wish to retrieve its contents and display them on the shell, you can use:
627
620
628
621
```bash
629
-
dd if=/mnt/USBmount/helloworld.txt bs=1K count=1
622
+
cat helloworld.txt
630
623
```
631
624
632
-
This command directs `dd` to peruse the contents of _helloworld.txt_. With a specified block size of 1 Kilobyte, the reading is confined to a single block—adequate given the brevity of the `Hello, World!` message. Upon executing this command, the content of the text file will be displayed on your shell.
625
+
This command `cat` prompts in the terminal the content of a file, in this case the words `Hello, World!`.
626
+
627
+
Now that you know how to locate, mount, write and read information from an external USB stick or hard drive you can expand the possibilities of your solution with the additional storage connected to the Portenta Hat Carrier.
633
628
634
629
#### Using Arduino IDE
635
630
<br></br>
@@ -939,9 +934,9 @@ void loop() {
939
934
940
935
### Analog Pins
941
936
942
-
The 16-pin header connector of the Portenta Hat Carrier integrates the analog channels. The analog pins `A0`, `A1`, `A2`, `A3`, `A4`, `A5`, `A6`, and `A7` are accessible through these connectors.
937
+
The 16-pin header connector of the Portenta Hat Carrier integrates the analog channels. The analog `A0`, `A1`, `A2`, `A3`, `A4`, `A5`, `A6`, and `A7` are accessible through these pins.
943
938
944
-

939
+

945
940
946
941
|**Pin number**|**Silkscreen**|**Portenta HD Standard Pin**|**High-Density Pin**|
If you are working in Python®, the command can be implemented as shown in the script below:
971
971
@@ -984,6 +984,10 @@ if __name__ == "__main__":
984
984
985
985
if value isnotNone:
986
986
print(f"Value from ADC pin {adc_pin}: {value}")
987
+
988
+
# Mapping between 0-3.3 V
989
+
new_value = (float) (value/65535)*3.3
990
+
print(f"Value mapped between 0-3.3 V: {new_value}")
987
991
```
988
992
989
993
#### Using Arduino IDE
@@ -3160,11 +3164,11 @@ The CAN bus, short for Controller Area Network bus, is a resilient communication
3160
3164
3161
3165
This approach ensures system continuity even if one device fails and is especially effective in electrically noisy settings like in vehicles, where various devices need reliable communication.
3162
3166
3163
-
The Portenta Hat Carrier is equipped with CAN bus communication capabilities, powered by the TJA1049 module - a high-speed CAN FD transceiver. With this, developers can leverage the robustness and efficiency of CAN communication in their projects.
3167
+
The Portenta Hat Carrier is equipped with CAN bus communication capabilities, powered by the TJA1049 module, a high-speed CAN FD transceiver. With this, developers can leverage the robustness and efficiency of CAN communication in their projects.
3164
3168
3165
3169

3166
3170
3167
-
Since the CAN bus pins are integrated within the High-Density connectors, they are conveniently accessible on the carrier through the screw terminal. This provides flexibility in connection, allowing developers to design and troubleshoot their systems easierly.
3171
+
Since the CAN bus pins are integrated within the High-Density connectors, they are conveniently accessible on the carrier through the screw terminal. This provides flexibility in connection, allowing developers to design and troubleshoot their systems easily.
This command sequence activates the CAN transceiver. It does so by exporting _GPIO 164_, setting its direction to "`out`", and then writing a value of "`0`" to it. Writing 0 as a value to GPIO 164 means, it will set GPIO to LOW state.
3191
+
This command sequence activates the CAN transceiver. It does so by exporting _GPIO 164_, setting its direction to "`out`", and then writing a value of "`0`" to it. Writing 0 as a value to GPIO 164 means that it will set the GPIO to a LOW state.
3188
3192
3189
-
For Portenta X8, it is possible to use following commands:
3193
+
For Portenta X8, it is possible to use the following commands:
Within the Portenta X8's shell, Docker containers offer a streamlined environment for specific tasks, such as command-based CAN bus operations. The _cansend_ command is one such utility that facilitates sending CAN frames. The command to issue such task is as followss:
3206
+
Within the Portenta X8's shell, Docker containers offer a streamlined environment for specific tasks, such as command-based CAN bus operations. The _cansend_ command is one such utility that facilitates sending CAN frames. The command to issue such task is as follows:
0 commit comments