Skip to content

Commit 195f934

Browse files
committed
Spelling fixes and some additional explanations
1 parent 4abbc5d commit 195f934

File tree

1 file changed

+20
-22
lines changed
  • content/hardware/04.pro/boards/portenta-x8/tutorials/uploading-sketches-m4

1 file changed

+20
-22
lines changed
Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
title: 'Upload Sketches to the Arduino Portenta X8'
3-
description: 'This tutorial will show how to upload Arduino sketches on the M4 processor'
2+
title: 'Uploading Sketches to the M4 Core on Arduino Portenta X8'
3+
description: 'This tutorial explains how to upload Arduino sketches to the M4 core.'
44
difficulty: medium
5-
beta: true
65
tags:
7-
- Firmware
6+
- firmware
87
- M4
98
author: 'Pablo Marquínez'
109
hardware:
@@ -16,26 +15,26 @@ software:
1615
---
1716

1817
## Overview
19-
This tutorial will explain how to upload a standard Arduino sketch to your Portenta X8's M4.
18+
In this tutorial we will go through the process of uploading sketches to the M4 core on the STM32H747XI MCU. For the user the process is the same as usual but it differs quite a bit in regards to what happens behind the scenes compared to other Arduino boards.
2019

2120
## Goals
22-
- Use the Arduino IDE to compile and upload.
23-
- Compile the sketch binaries with the Arduino IDE and upload it through ADB.
21+
- Learn how to use the Arduino IDE to compile and upload a sketch.
22+
- Learn how to compile the sketch binaries with the Arduino IDE and upload it manually via ADB.
2423

2524
### Required Hardware and Software
26-
- Portenta X8
25+
- [Portenta X8](https://store.arduino.cc/products/portenta-x8)
2726
- USB C cable (either USB A to USB C or USB C to USB C)
2827
- Arduino IDE 1.8.10+ or Arduino-cli
29-
- arduino-mbed portenta Core up to date (greater than 3.0.1)
28+
- Latest "Arduino Mbed OS Portenta Boards" Core > 3.0.1
3029

3130
## Instructions
3231

3332
### Standard Arduino IDE Upload
34-
Open the Arduino IDE, make sure you have selected the Portenta X8 on the boards selector.
33+
Open the Arduino IDE, make sure you have selected the Portenta X8 in the boards selector.
3534

3635
![IDE board selector](assets/x8-board-manager.png)
3736

38-
Create your sketch, for example the blink sketch:
37+
Create a custom sketch or open one of the example sketches e.g. the blink sketch:
3938
```arduino
4039
void setup(){
4140
pinMode(LED_BUILTIN ,OUTPUT);
@@ -49,15 +48,16 @@ void loop(){
4948
}
5049
```
5150

52-
Once your sketch it's completed, select the port of your device.
51+
- Select the port of your device in the port selector menu.
52+
- Press the Compile and Upload button.
5353

54-
Press the Compile and Upload button.
54+
Behind the curtains, the sketch gets compiled into a binary. That binary file is then uploaded to the Linux side of the Portenta X8 via an `adb` SSH connection. The flashing itself is done on the board itself by a service running on Linux. When the sketch has bee uploaded successfully, check if the onboard LED is blinking at an interval of one second.
5555

56-
To finalize, when you see that the sketch has bee uploaded successfully, check that every second you are getting the LED changing from OFF to ON.
56+
### Upload Manually Using ADB
5757

58-
### Upload Using ADB
58+
To upload a firmware manually, you first need to compile the sketch. In the Arduino IDE select "Export compiled binary" from the Sketch menu. It will compile the sketch and save the binary file in the sketch folder. Alternatively you can use the [Arduino CLI](https://arduino.github.io/arduino-cli/) to create an elf file.
5959

60-
To use ADB, it gets installed at `Arduino15\packages\arduino\tools\adb\32.0.0`.
60+
To upload the firmware you can use the ADB tool that has been installed as part of the Portenta X8 core. It can be found at `Arduino15\packages\arduino\tools\adb\32.0.0`.
6161

6262
From that directory you can use the `adb` tool. To upload your compiled sketch you just need to type:
6363
```
@@ -67,18 +67,16 @@ adb push <sketchBinaryPath> /tmp/arduino/m4-user-sketch.elf
6767
![ADB upload with a terminal](assets/x8-terminal-ADB-push.png)
6868

6969
## How It Works?
70-
The Portenta X8 has some services that once the sketch has been pushed to the required folder, if it detects changes the device will flash the M4 after that happened!
70+
The Portenta X8 has a service that waits for a sketch to be uploaded to a folder. If it detects changes the device will flash the M4 with the uploaded firmware.
7171

7272
This work thanks to the following services:
73-
* **monitor-m4-elf-file.service**: this service monitors the directory `/tmp/arduino/m4-user-sketch.elf` each time it detects a new file it will proceed to flash the M4 using the tool `openOCD` and providing the sketch that has been pushed.
73+
* **monitor-m4-elf-file.service**: this service monitors the directory `/tmp/arduino/m4-user-sketch.elf` and each time it detects a new file it will proceed to flash the M4 using `openOCD` with the sketch that has been pushed.
7474
* **android-tools-adbd.service**: responsible of generating the needed interfaces for the different types of usb gadgets.
7575
* **create-docker-envfile.service**: Controls if the device has been plugged for example in some carrier and makes the info available at `/var/run/arduino_hw_info.env` and is meant to be used by the ´docker containers´.
7676

7777
## Conclusion
78-
You now have access to the M4 processor, so for example you are able to connect an I<sup>2</sup>C sensor and interact with it, also you could track the sensor from the Arduino Portenta X8 Linux side.
78+
In this tutorial you have learned how to upload a sketch to the M4 core. Now for example you are able to connect an I<sup>2</sup>C sensor and interact with it.
7979

8080
## Troubleshooting
8181

82-
### ADB Folder Empty
83-
84-
If you cannot use the `ADB` tool and the folder `Arduino15\packages\arduino\tools\adb\32.0.0` is empty Remove the Mbed Portenta Core and install it again.
82+
- If you cannot use the `ADB` tool and the folder `Arduino15\packages\arduino\tools\adb\32.0.0` is empty Remove the Mbed Portenta Core and install it again.

0 commit comments

Comments
 (0)