Skip to content

Commit e5924c9

Browse files
authored
[skip changelog] Update outdated information in platform specification (#787)
* Update statement re: prevalence of usb to serial chip on Arduino boards It's no longer true that "most" Arduino boards have a dedicated USB to serial chip (and becoming increasingly less so). * Update documentation for sketch size regex properties The platform specification was outdated in regard to the sketch size determination regular expression properties. - Document recipe.size.regex.data - Update Arduino AVR Boards' recipe.size.regex value * Update docs re: platform.local.txt location Previously, the location specified by the platform specification applied only to the folder structure of manually installed platforms. When a platform is installed via Boards Manager, there is an additional version folder level and it is under this folder the platform.local.txt must be placed. The documentation now applies equally well to either platform installation type. * Modernize statement re: upload tools The statement was written at a time when there was only two Arduino platforms. Although still correct, it had a decidedly outdated feel that was fixed by a minor rewording.
1 parent 2920cec commit e5924c9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

docs/platform-specification.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,19 @@ A full example for the AVR platform can be:
193193

194194
#### Recipes to compute binary sketch size
195195

196-
At the end of the build the Arduino development software shows the final binary sketch size to the user. The size is calculated using the recipe **recipe.size.pattern**. The output of the command executed using the recipe is parsed through the regular expression set in the property **recipe.size.regex**. The regular expression must match the sketch size.
196+
At the end of the build the Arduino development software shows the final binary sketch size to the user. The size is calculated using the recipe **recipe.size.pattern**. The output of the command executed using the recipe is parsed through the regular expressions set in the properties:
197+
198+
* **recipe.size.regex**: Program storage space used.
199+
* **recipe.size.regex.data**: Dynamic memory used by global variables.
197200

198201
For AVR we have:
199202

200203
compiler.size.cmd=avr-size
201204
[....]
202205
## Compute size
203206
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.hex"
204-
recipe.size.regex=Total\s+([0-9]+).*
207+
recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).*
208+
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
205209

206210
#### Recipes to export compiled binary
207211

@@ -275,7 +279,7 @@ Properties defined in a platform.txt created in the **hardware** subfolder of th
275279

276280
## platform.local.txt
277281

278-
Introduced in Arduino IDE 1.5.7. This file can be used to override properties defined in platform.txt or define new properties without modifying platform.txt (e.g. when platform.txt is tracked by a version control system). It should be placed in the architecture folder.
282+
Introduced in Arduino IDE 1.5.7. This file can be used to override properties defined in platform.txt or define new properties without modifying platform.txt (e.g. when platform.txt is tracked by a version control system). It should be placed in the same folder as the platform.txt it supplements.
279283

280284

281285
## boards.txt
@@ -367,7 +371,7 @@ The parameter **build.variant.path** is automatically generated.
367371

368372
## Tools
369373

370-
The Arduino development software uses external command line tools to upload the compiled sketch to the board or to burn bootloaders using external programmers. Currently *avrdude* is used for AVR based boards and *bossac* for SAM based boards, but there is no limit, any command line executable can be used. The command line parameters are specified using **recipes** in the same way used for platform build process.
374+
The Arduino development software uses external command line tools to upload the compiled sketch to the board or to burn bootloaders using external programmers. For example, *avrdude* is used for AVR based boards and *bossac* for SAM based boards, but there is no limit, any command line executable can be used. The command line parameters are specified using **recipes** in the same way used for platform build process.
371375

372376
Tools are configured inside the platform.txt file. Every Tool is identified by a short name, the Tool ID.
373377
A tool can be used for different purposes:
@@ -456,7 +460,7 @@ Most **{upload.XXXX}** variables are used later in the avrdude upload recipe in
456460
[.....]
457461

458462
#### 1200 bps bootloader reset
459-
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.
463+
Some 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.
460464

461465
To let the Arduino development software perform these steps, two board parameters can be set:
462466

0 commit comments

Comments
 (0)