Skip to content

Commit 79cc0ab

Browse files
committed
Move AVRDUDE example with "-e" flag to Atmel platform page
1 parent 6ea7233 commit 79cc0ab

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

platforms/atmelavr_extra.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,24 @@ To upload EEPROM data (from EEMEM directive) you need to use ``uploadeep``
194194
target instead ``upload`` for :option:`pio run --target` command.
195195
For example, ``pio run -t uploadeep``.
196196

197+
Erase chip before programming
198+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
199+
200+
In some cases erasing chip memory is a mandatory procedure before uploading bootloader
201+
or setting fuses. AVRDUDE provides a special flag ``-e`` that causes a chip erase to be
202+
executed. This will reset the contents of the flash ROM and EEPROM to the value ``0xff``,
203+
and clear all lock bits. The easiest way to use it is to add this flag via the
204+
:ref:`projectconf_upload_flags` option:
205+
206+
.. code-block:: ini
207+
208+
[env:uno]
209+
platform = atmelavr
210+
framework = arduino
211+
board = uno
212+
upload_flags =
213+
-e
214+
197215
Fuses programming
198216
~~~~~~~~~~~~~~~~~
199217

projectconf/section_env_upload.rst

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,6 @@ This option can also be set by global environment variable
117117

118118
Please specify each flag/option in a new line starting with minimum 2 spaces.
119119

120-
Here are a few examples for the ``AVRDUDE`` tool used in Atmel-based platforms:
121-
122-
1. Enable verbose output and erase chip before uploading
123-
124-
.. code-block:: ini
125-
126-
[env:atmega4809]
127-
platform = atmelmegaavr
128-
board = atmega4809
129-
framework = arduino
130-
upload_flags =
131-
-V
132-
-e
133-
134-
2. Configure upload settings and set fuses
135-
136120
.. code-block:: ini
137121
138122
[env:atmega328pb]

0 commit comments

Comments
 (0)