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
{{ message }}
This repository was archived by the owner on Aug 11, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: content/tutorials/portenta-h7/por-ard-ap/content.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,10 @@
1
+
---
2
+
title: Portenta H7 as a Wi-Fi Access Point
3
+
coverImage: assets/por_ard_ap_cover.svg
4
+
tags: [WiFi, Access Point, HTTP, Web Server]
5
+
description: In this tutorial you will configure the Portenta H7 as an access point and build a simple web server that will allow you to control the built-in RGB LEDs from your mobile device.
6
+
---
7
+
1
8
# Portenta H7 as a Wi-Fi Access Point
2
9
3
10
## Overview
@@ -21,14 +28,14 @@ When the board is configured to operate as an access point, it can create its o
21
28
22
29
With the access point set up you create a client server architecture where the board provides a web server communicating with the client devices over HTTP. The connected devices can then make HTTP GET requests to the server to retrieve web pages served by the web server on the board. This makes the Portenta H7 an ideal board for developing IoT solutions where external client devices can send and receive information while more complex processing tasks take place on the server.
23
30
24
-

31
+

25
32
26
33
## Instructions
27
34
28
35
### Setting Up the Web Server
29
36
In this tutorial you are going to convert the board into an access point and use it to set up a web server which provides a HTML webpage. This page contains buttons to toggle the red, green and blue colour of the built-in LED. You will then connect your mobile device to this access point and access this web page through the browser on your mobile phone. Once retrieved, you will be able to control the state of the red, green and blue LED on the built-in RGB LED from your mobile device.
30
37
31
-

38
+

32
39
33
40
### 1. The Basic Setup
34
41
Begin by plugging in your Portenta board to your computer using a USB-C cable and open the Arduino IDE or the Arduino Pro IDE. If this is your first time running Arduino sketch files on the board, we suggest you check out how to [set up the Portenta H7 for Arduino](https://www.arduino.cc/pro/tutorials/portenta-h7/por-ard-gs) before you proceed.
@@ -214,19 +221,19 @@ This sketch describes how the server will handle an incoming HTTP GET request fr
214
221
215
222
Here the web page is just a simple HTML page with buttons to toggle the LED states. The way in which the web page works is: Whenever a button on the web page is pressed, the client device (in this case your phone) sends a HTTP GET request to a URL denoted by a letter, in this case H or L (H stands for HIGH, L stands for LOW) followed by the LED color that should be turned on or off r, g or b. For example to turn on the red LED the URL is /Hr . Once the server receives this request it changes the corresponding LED state, closes the connection and continues to listen to next requests.
216
223
217
-

224
+

218
225
219
226
***Remember that the built-in RGB LEDs on the Portenta H7 need to be pulled to ground to make them light up. This means that a voltage level of __LOW__ on each of their pins will turn the specific color of the LED on, a voltage level of __HIGH__ will turn them off.***
220
227
221
228
### 3. Create the arduino_secrets.h Tab
222
229
223
230
A good practice is to have sensitive data like the SSID and the password required to identify and connect to a certain network within a separate file. Click on the arrow icon below the Serial Monitor button and open a new tab in the Arduino IDE. This will create a new file.
224
231
225
-

232
+

226
233
227
234
Name the file **arduino_secrets.h** and click OK.
228
235
229
-

236
+

230
237
231
238
Once you’ve created the new tab, you will see an empty page in the IDE. Define two constants `SECRET_SSID` and `SECRET_PASS` that will hold the name of the Wi-Fi network and the corresponding password. Add the following lines to your **arduino_secrets.h** file:
232
239
@@ -243,31 +250,31 @@ In order to access the `SECRET_SSID` and `SECRET_PASS` constants in the **simple
243
250
# include “arduino_secrets.h”
244
251
```
245
252
246
-

253
+

247
254
248
255
### 4. Upload the Code
249
256
250
257
Select the **Arduino Portenta H7 (M7 core)** from the **Board** menu and the port the Portenta is connected to. Upload the **simpleWebServer.ino** sketch. Doing so will automatically compile the sketch beforehand.
251
258
252
-

259
+

253
260
254
261
Once you've uploaded the code, open the serial monitor. You will be able to see the IP address of the access point. You will also see the message, `Device disconnected from AP` which means there are no devices connected to the Access point yet.
255
262
256
-

263
+

257
264
258
265
### 5. Connecting to the Portenta Access Point
259
266
260
267
Once the access point is active and ready to be connected with external devices, you will be able to find the **PortentaAccessPoint** on the list of networks on your mobile device. Once you have entered the password you have defined earlier, your smart phone will connect to access point.
261
268
262
-

269
+

263
270
264
271
Now open a browser window on your mobile device and copy & paste the URL containing Portenta’s IP address that is displayed on the serial monitor.
265
272
266
-

273
+

267
274
268
275
Once you’ve entered the URL, the client sends a GET request to the web server to fetch the HTML web page specified in the code. Once loaded you will see the web page in your mobile browser.
269
276
270
-

277
+

271
278
272
279
### 6. Access the Board From Your Mobile Device
273
280
@@ -285,11 +292,11 @@ HTTP/1.1 200 OK
285
292
286
293
Once the server has responded to this request, it closes the connection and continues listening to next GET requests.
287
294
288
-

295
+

289
296
290
297
You’re now be able to toggle the states of the red, green and blue LED through the buttons displayed on your mobile browser. Everytime you press a button, the client sends a GET request to a URL in the format /Hx or /Lx ,where x can be ‘r’, ‘g’ or ‘b’, depending on the button pressed on the HTML page. The web server then reads the URL requested by the client, changes the state of the LED corresponding to the URL and closes the connection.
291
298
292
-

299
+

Copy file name to clipboardExpand all lines: content/tutorials/portenta-h7/por-ard-ble/content.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,10 @@
1
+
---
2
+
title: BLE Connectivity on Portenta H7
3
+
coverImage: assets/por_ard_ble_cover.svg
4
+
tags: [BLE, LED, Connectivity, Bluetooth]
5
+
description: This tutorial explains how to use BLE connectivity on the Portenta H7 to control the built-in LED using an external Bluetooth application.
6
+
---
7
+
1
8
# BLE Connectivity on Portenta H7
2
9
3
10
## Overview
@@ -24,19 +31,19 @@ The onboard WiFi/Bluetooth® module of the H7 offers low energy Bluetooth® func
24
31
### Configuring the Development Environment
25
32
To communicate with the Portenta H7 via Bluetooth®, we are going to start by uploading a pre-built sketch that starts a Bluetooth® network and allows your mobile device, which will be used to control the LEDs, to connect to it. The sketch uses the [ArduinoBLE](https://www.arduino.cc/en/Reference/ArduinoBLE) Library that enables the BLE module and handles important functions such as scanning, connecting and interacting with services provided by other devices. You will also be using a third party application (e.g. [nRF Connect](https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-mobile)), running on your mobile device that will connect your device to the board and help you control the built-in LED.
Begin by plugging in your Portenta board to the computer using a USB-C cable and open the Arduino IDE or the Arduino Pro IDE. If this is your first time running Arduino sketch files on the board, we suggest you check out how to [set up the Portenta H7 for Arduino](https://www.arduino.cc/pro/tutorials/portenta-h7/por-ard-gs) before you proceed.
32
39
33
-

40
+

34
41
35
42
### 2. Install the ArduinoBLE Library
36
43
37
44
You will need to install the ArduinoBLE library in the Arduino IDE you are using. For this example we will use the classic Arduino IDE. To install the library go to : **Tools -> Manage Libararies...** type **ArduinoBLE** and click **Install**. Make sure you install ArduinoBLE version 1.1.3 or higher.
38
45
39
-

46
+

Copy file name to clipboardExpand all lines: content/tutorials/portenta-h7/por-ard-dcp/content.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,10 @@
1
+
---
2
+
title: Dual Core Processing
3
+
coverImage: assets/por_ard_dcp_cover.svg
4
+
tags: [Multitasking, RGB, LED]
5
+
description: In this tutorial you will run two classic Arduino blink programs simultaneously on different cores of the Portenta board that blinks the RGB LED in two different colours.
6
+
---
7
+
1
8
# Dual Core Processing
2
9
3
10
## Overview
@@ -17,19 +24,19 @@ The Portenta H7 is equipped with a processor that has two processing units calle
17
24
## Cortex® M7 & M4
18
25
Processor cores are individual processing units within the board's main processing unit (don't confuse a processor core with an [Arduino core](https://www.arduino.cc/en/guide/cores)). These cores are responsible for the executing instructions at a particular clock speed. The on-board Arm Cortex processor comes with two cores (Cortex® M7 and M4), with slightly different architectures and clock speeds. The M7 runs at 480 MHz and the architecture is designed to separate Instruction and Data buses to optimize CPU latency. The M4 runs at 240 MHz and the architecture supports the ART™ accelerator (a block that speeds up instruction fetching accesses of the Cortex-M4 core to the D1-domain internal memories). The higher clock rate of the M7 makes it suitable to handle complex processing tasks such as data storage, debugging or handling input/output peripherals at a higher efficiency compared to the M4. The dual core processor of the Portenta H7 sets it apart from other single core Arduino boards by allowing true multitasking, faster data processing capabilities, enhanced processing power and application partitioning.
19
26
20
-

27
+

21
28
22
29
## Instructions
23
30
24
31
### Accessing the M7 and M4 Core
25
32
To best illustrate the idea of dual core processing, you will be running two separate sketch files. One on each of the cores which blinks the RGB LED in a different colour. The **BlinkRedLed_M7.ino** sketch will set the built-in RGB LED on the board to red and blink it with a delay of 500 ms. The **BlinkGreenLed_M4.ino** sketch will access the green LED in the RGB led and blink it with a delay of 200 ms. Both the cores will be executing the corresponding sketch file simultaneously and as a result both the green and red LED blink, however, at different intervals.
26
33
27
-

34
+

28
35
29
36
### 1. The Basic Setup
30
37
Begin by plugging-in your Portenta board to your computer using an appropriate USB-C cable and have the Arduino IDE or the Arduino Pro IDE open. If this is your first time running Arduino sketch files on the board, we suggest you check out how to [Setting Up Portenta H7 For Arduino](https://www.arduino.cc/pro/tutorials/portenta-h7/por-ard-gs) before you proceed.
31
38
32
-

39
+

33
40
34
41
**Note:** You can access the examples from the tutorials library once it's installed: **Examples -> Arduino_Pro_Tutorials -> Dual Core Processing**
35
42
@@ -85,7 +92,7 @@ If you would upload the sketch to the M4 at this point nothing would change. The
85
92
### 5. Force Booting the M4 Core
86
93
The bootloader of the H7 boards is configured in such a way that only M7 gets booted automatically. The reason is that for simple use cases the M4 may not be needed and hence be unprogrammed and doesn't need to get powered. One such instance is when the M7 doesn't have the appropriate firmware that automatically handles the initialization of the M4. As a result you need to force boot the M4 so that it can run a sketch. You can do so through the M7 using a special command, `bootM4()` that boots the M4 when the board is powered.
87
94
88
-

95
+

89
96
90
97
Before you can upload the code for the M4 core to the flash memory you need to add the `bootM4()` command in the **BlinkRedLed_M7.ino** sketch file that is uploaded and run by the M7 core. Copy and paste the following command `bootM4()` inside the `setup()` function of the **BlinkRedLed_M7.ino** sketch and upload the sketch to M7 once again.
Copy file name to clipboardExpand all lines: content/tutorials/portenta-h7/por-ard-flash/content.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,10 @@
1
+
---
2
+
title: Reading and Writing Flash Memory
3
+
coverImage: assets/por_ard_block_device_cover.svg
4
+
tags: [Storage, Flash, Block Device]
5
+
description: This tutorial demonstrates how to use the on-board flash memory of the Portenta H7 to read and write data using the BlockDevice API provided by Mbed OS.
6
+
---
7
+
1
8
# Using the Flash Storage To Read and Write Data
2
9
## Overview
3
10
This tutorial demonstrates how to use the on-board flash memory of the Portenta H7 to read and write data using the BlockDevice API provided by Mbed OS. As the internal memory is limited in size we will also take a look at saving data to the QSPI flash memory.
0 commit comments