Unverified Commit e8bb3278 authored by per1234's avatar per1234 Committed by GitHub

[skip changelog] Fix typos in documentation (#635)

parent 06a328f1
......@@ -42,9 +42,9 @@ same folder.
## Running the tests
There are several checks and test suites in place to ensure the code works as
expected but it's also written in a way that's consistent across the whole
codebase. To avoid pushing changes that will cause the CI system to fail, you
can run most of the tests locally.
expected and is written in a way that's consistent across the whole codebase.
To avoid pushing changes that will cause the CI system to fail, you can run most
of the tests locally.
To ensure code style is consistent, run:
......@@ -87,7 +87,8 @@ Being a command line interface, Arduino CLI is heavily interactive and it has to
stay consistent in accepting the user input and providing the expected output
and proper exit codes. On top of this, many Arduino CLI features involve
communicating with external devices, most likely through a serial
port, so unit tests can only put our confidence that the code is working so far.
port, so unit tests can only go so far in giving us confidence that the code is
working.
For these reasons, in addition to regular unit tests the project has a suite of
integration tests that actually run Arduino CLI in a different process and
......@@ -166,7 +167,7 @@ command do:
task docs:serve
```
If you dont' see any error, hit http://127.0.0.1:8000 with your browser.
If you don't see any error, hit http://127.0.0.1:8000 with your browser.
## Pull Requests
......
......@@ -3,16 +3,15 @@
When you run `arduino-cli board list`, your board doesn't show up. Possible causes:
- Your board is a cheaper clone, or
- It mounts a USB2Serial converter like FT232 or CH320: these chips
always reports the same USB VID/PID to the operating system, so the
only thing that we know is that the board mounts that specific
USB2Serial chip, but we don’t know which board is.
- It mounts a USB2Serial converter like FT232 or CH340: these chips
always report the same USB VID/PID to the operating system, so the
only thing we know is that the board mounts that specific
USB2Serial chip, but we don’t know which board that chip is on.
## What's the FQBN string?
For a deeper understanding of how FQBN works, you should understand
Arduino Hardware specification. You can find more information in the
[Arduino platform specification][0].
the [Arduino platform specification][0].
[0]: platform-specification.md
Despite there's no feature parity at the moment, Arduino CLI provides many of
the features you can find in the Arduino IDE, let's see some examples.
Despite the lack of feature parity at the moment, Arduino CLI provides many of
the features you can find in the Arduino IDE. Let's see some examples.
## Before you start
......@@ -44,15 +44,15 @@ Use "arduino-cli core [command] --help" for more information about a command.
Arduino CLI doesn't strictly require a configuration file to work because the
command line interface provides any possible functionality. However, having one
can spare you a lot of typing when issuing a command, so let's create it
right ahead with:
can spare you a lot of typing when issuing a command, so let's go ahead and
create it with:
```sh
$ arduino-cli config init
Config file written: /home/luca/.arduino15/arduino-cli.yaml
```
If you inspect `arduino-cli.yaml` contents, you'll find out the available
If you inspect the contents of `arduino-cli.yaml`, you'll find the available
options with their respective default values.
## Create a new sketch
......@@ -104,7 +104,7 @@ $ arduino-cli core update-index
Updating index: package_index.json downloaded
```
After connecting the board to your PCs by using the USB cable, you should be
After connecting the board to your PC by using the USB cable, you should be
able to check whether it's been recognized by running:
```sh
......@@ -198,8 +198,8 @@ ID Version Name
esp8266:esp8266 2.5.2 esp8266
```
Alternatively, you can pass a link to the the additional package index file with
the `--additional-urls` option, that has to be specified every time and for every
Alternatively, you can pass a link to the additional package index file with the
`--additional-urls` option, that has to be specified every time and for every
command that operates on a 3rd party platform core, for example:
```sh
......@@ -213,7 +213,7 @@ esp8266:esp8266 2.5.2 esp8266
## Compile and upload the sketch
To compile the sketch you run the `compile` command passing the proper FQBN
To compile the sketch you run the `compile` command, passing the proper FQBN
string:
```sh
......
......@@ -30,7 +30,7 @@ curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.
You can download the latest version of the pre-built binaries for the supported
platforms from the [release page](https://github.com/arduino/arduino-cli/releases)
or following the links in the following table. Once downloaded, extract the
binary `arduino-cli` into a directory that's is in your `PATH`.
binary `arduino-cli` into a directory that is in your `PATH`.
Platform | | |
--------- | ------------------ | ------------------ |
......
This diff is collapsed.
This specification is a 3rd party Hardware format to be used in Arduino IDE starting from 1.5.x series.<br>
This specification is a 3rd party hardware format to be used in Arduino IDE starting from 1.5.x series.<br>
This specification allows a 3rd party vendor/maintainer to add support for new boards inside the Arduino IDE by providing a file to unzip into the *hardware* folder of Arduino's sketchbook folder.<br>
It is also possible to add new 3rd party boards by providing just one configuration file.
## Hardware Folders structure
The new hardware folders have a hierarchical structure organized in two levels:
- the first level is the vendor/maintainer
- the second level is the supported architecture
......@@ -57,7 +58,7 @@ will set the property **tools.bossac.cmd** to the value **bossac** on Linux and
#### Global Predefined properties
The Arduino IDE sets the following properties that can be used globally in all configurations files:
The Arduino IDE sets the following properties that can be used globally in all configuration files:
* `{runtime.platform.path}`: the absolute path of the [board platform](#platform-terminology) folder (i.e. the folder containing boards.txt)
* `{runtime.hardware.path}`: the absolute path of the hardware folder (i.e. the folder containing the [board platform](#platform-terminology) folder)
......@@ -79,13 +80,14 @@ The following meta-data must be defined:
version=1.5.3
The **name** will be shown in the Boards menu of the Arduino IDE.<br>
The **version** is currently unused, it is reserved for future use (probably together with the libraries manager to handle dependencies on cores).
The **version** is currently unused, it is reserved for future use (probably together with the Boards Manager to handle dependencies on cores).
### Build process
The platform.txt file is used to configure the build process performed by the Arduino IDE. This is done through a list of **recipes**. Each recipe is a command line expression that explains how to call the compiler (or other tools) for every build step and which parameter should be passed.
The Arduino IDE, before starting the build, determines the list of files to compile. The list is composed by:
The Arduino IDE, before starting the build, determines the list of files to compile. The list is composed of:
- the user's Sketch
- source code in the selected board's Core
- source code in the Libraries used in the sketch
......@@ -413,7 +415,7 @@ In this example if the user enables verbose mode, then **{upload.params.verbose}
tools.avrdude.upload.params.verbose => upload.verbose
If the user didn't enable verbose mode, the **{upload.params.quiet}** is used in **{upload.verbose}**:
If the user didn't enable verbose mode, then **{upload.params.quiet}** is used in **{upload.verbose}**:
tools.avrdude.upload.params.quiet => upload.verbose
......@@ -429,7 +431,7 @@ A specific **upload.tool** property should be defined for every board in boards.
leonardo.upload.tool=avrdude
[......]
Also other upload parameters can be defined together, for example in the Arduino boards.txt we have:
Also other upload parameters can be defined together, for example in the Arduino AVR Boards boards.txt we have:
[.....]
uno.name=Arduino Uno
......@@ -453,15 +455,15 @@ Most **{upload.XXXX}** variables are used later in the avrdude upload recipe in
tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"
[.....]
#### 1200bps bootloader reset
Most Arduino boards use a dedicated USB-to-serial chip, that takes care of restarting the main MCU (starting the bootloader) when the serial port is opened. However, boards that have a native USB connection (such as the Leonardo or Zero) will have to disconnect from USB when rebooting into the bootloader (after which the bootloader reconnects to USB and offers a new serial port for uploading). After the upload is complete, the bootloader disconnects from USB again, starts the sketch, which then reconnects to USB. Because of these reconnections, the standard restart-on-serial open will not work, since that would cause the serial port to disappear and be closed again. Instead, the sketch running on these boards interpret a bitrate of 1200bps as a signal the bootloader should be started.
#### 1200 bps bootloader reset
Most Arduino boards use a dedicated USB-to-serial chip, that takes care of restarting the main MCU (starting the bootloader) when the serial port is opened. However, boards that have a native USB connection (such as the Leonardo or Zero) will have to disconnect from USB when rebooting into the bootloader (after which the bootloader reconnects to USB and offers a new serial port for uploading). After the upload is complete, the bootloader disconnects from USB again, starts the sketch, which then reconnects to USB. Because of these reconnections, the standard restart-on-serial open will not work, since that would cause the serial port to disappear and be closed again. Instead, the sketch running on these boards interprets a bitrate of 1200 bps as a signal the bootloader should be started.
To let the IDE perform these steps, two board parameters can be set:
* `use_1200bps_touch` causes the IDE to briefly open the selected serial port at 1200bps (8N1) before starting the upload.
* `wait_for_upload_port` causes the IDE to wait for the serial port to (re)appear before and after the upload. This is only used when `use_1200bps_touch` is also set. When set, after doing the 1200bps touch, the IDE will wait for a new serial port to appear and use that as the port for uploads. Alternatively, if the original port does not disappear within a few seconds, the upload continues with the original port (which can be the case if the board was already put into bootloader manually, or the IDE missed the disconnect and reconnect). Additionally, after the upload is complete, the IDE again waits for a new port to appear (or the originally selected port to be present).
* `use_1200bps_touch` causes the IDE to briefly open the selected serial port at 1200 bps (8N1) before starting the upload.
* `wait_for_upload_port` causes the IDE to wait for the serial port to (re)appear before and after the upload. This is only used when `use_1200bps_touch` is also set. When set, after doing the 1200 bps touch, the IDE will wait for a new serial port to appear and use that as the port for uploads. Alternatively, if the original port does not disappear within a few seconds, the upload continues with the original port (which can be the case if the board was already put into bootloader manually, or the IDE missed the disconnect and reconnect). Additionally, after the upload is complete, the IDE again waits for a new port to appear (or the originally selected port to be present).
Note that the IDE implementation of this 1200bps touch has some peculiarities, and the newer `arduino-cli` implementation also seems different (does not wait for the port after the reset, which is probably only needed in the IDE to prevent opening the wrong port on the serial monitor, and does not have a shorter timeout when the port never disappears).
Note that the IDE implementation of this 1200 bps touch has some peculiarities, and the newer `arduino-cli` implementation also seems different (does not wait for the port after the reset, which is probably only needed in the IDE to prevent opening the wrong port on the serial monitor, and does not have a shorter timeout when the port never disappears).
### Serial port
......@@ -554,7 +556,7 @@ Note that we don't need to specify any architecture since the same architecture
The platform.txt settings are inherited from the referenced core platform, thus there is no need to provide a platform.txt unless there are some specific properties that need to be overridden.
The libraries from the referenced platform are used, thus there is no need to provide a libraries. If libraries are provided the list of available libraries are the sum of the 2 libraries where the referencing platform has priority over the referenced platform.
The libraries from the referenced platform are used, thus there is no need to provide those libraries. If libraries are provided the list of available libraries are the sum of the 2 libraries where the referencing platform has priority over the referenced platform.
In the same way we can use variants and tools defined on another platform:
......@@ -570,6 +572,7 @@ Note that referencing a variant in another platform does *not* inherit any prope
### Platform Terminology
Because boards can reference cores, variants and tools in different platforms, this means that a single build or upload can use data from up to four different platforms. To keep this clear, the following terminology is used:
* The "board platform" is the platform that defines the currently selected board (e.g. the platform that contains the board.txt the board is defined in.
* The "core platform" is the the platform that contains the core to be used.
* The "variant platform" is the platform that contains the variant to be used.
......
......@@ -7,12 +7,13 @@ A number of things have to happen for your Arduino code to get onto the Arduino
## Pre-Processing
The Arduino environment performs a few transformations to your sketch before passing it to the avr-gcc compiler:
- All .ino and .pde files in the sketch folder (shown in the IDE as tabs with no extension) are concatenated together, starting with the file that matches the folder name followed by the others in alphabetical order, and the .cpp extension is added to the filename.
- If not already present, `#include <Arduino.h>` is added to the sketch. This header file (found in the core folder for the currently selected board) includes all the definitions needed for the standard Arduino core.
- Prototypes are generated for all function definitions in .ino/.pde files that don't already have prototypes. In some rare cases prototype generation may fail for some functions. To work around this, you can provide your own prototypes for these functions.
- `#line` directives are added to make warning or error messages reflect the original sketch layout.
No pre-processing is done to files in a sketch with any extension other than .ino or .pde. Additionally, .h files in the sketch are not automatically #included from the main sketch file. Further, if you want to call functions defined in a .c file from a .cpp file (like one generated from your sketch), you'll need to wrap its declarations in an 'extern "C" {}' block that is defined only inside of C++ files.
No pre-processing is done to files in a sketch with any extension other than .ino or .pde. Additionally, .h files in the sketch are not automatically #included from the main sketch file. Further, if you want to call functions defined in a .c file from a .cpp file (like one generated from your sketch), you'll need to wrap its declarations in an `extern "C" {}` block that is defined only inside of C++ files.
## Dependency Resolution
......@@ -37,6 +38,7 @@ If multiple libraries contain a file that matches the `#include` directive, the
### Architecture Matching
A library is considered **compatible** with architecture `X` if the `architectures` field in [library.properties](library-specification.md#library-metadata):
- explicitly contains the architecture `X`
- contains the catch-all `*`
- is not specified at all.
......@@ -83,7 +85,7 @@ Sketches are compiled by avr-gcc and avr-g++ according to the variables in the b
The sketch is built in a temporary directory in the system-wide temporary directory (e.g. /tmp on Linux).
Files taken as source files for the build process are .S, .c and .cpp files (including the .cpp file generated from the sketch's .ino and .pde files during the sketch pre-processing step).
Source files of the target are compiled and output with .o extensions to this build directory, as are the main sketch files and any other source files in the sketch and any source files in any libraries which are #included in the sketch.
Source files of the target are compiled and output with .o extensions to this build directory, as are the main sketch files and any other source files in the sketch and any source files in any libraries which are `#include`d in the sketch.
Before compiling a source file, an attempt is made to reuse the previously compiled .o file, which speeds up the build process. A special .d (dependency) file provides a list of all other files included by the source. The compile step is skipped if the .o and .d files exist and have timestamps newer than the source and all the dependent files. If the source or any dependent file has been modified, or any error occurs verifying the files, the compiler is run normally, writing a new .o & .d file. After a new board is selected from the Tools menu, all source files are rebuilt on the next compile.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment