PlatformIO Community

Disable sketch verification after upload for Arduino Due

Hi everyone,
I would like to ask how to disable the sketch verification step after it is uploaded in my Arduino Due board. I already read this but I cannot find said directory. Could someone help me?

Thanks in advance

Please go to ~/.platformio/platforms/atmelsam and comment this

1 Like

Thank you! Very usefull advice

Thank you!
Would it be possible to add an option to platformio.ini just to turn verification on/off, without having to rewrite the entire upload script?

You should be able to remove the --verify option (added here) by adding a extra_script that removes it. Basically from here you want

no_verify.py

Import("env")

old_flags = env["UPLOADERFLAGS"]
# filter out the --verify 
new_flags = [opt for opt in old_flags if opt != "--verify"]
# replace and update
env.Replace(
    UPLOADERFLAGS=new_flags,
    UPLOADCMD="$UPLOADER $UPLOADERFLAGS $SOURCES"
)

in platformio.ini

extra_scripts = no_verify.py
3 Likes

Thanks a lot! That’s simple enough.

Can anyone confirm if this still works with the latest version?

I’ve tried using the file in extra_scripts and it seems doesn’t work. Also tried searching for “verify” in main.py and its no longer there.

Is there a different way to disable verify on the latest version of platformio?

Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:30:08.229Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 5.0.0-29-generic

You need to post a verbose upload log (pio run -t upload -v) and your platformio.ini in order for us to be able to help you…

platformio.ini:

[env:pro16MHzatmega328]
platform = atmelavr
board = pro16MHzatmega328
framework = arduino
monitor_speed = 115200
     
lib_deps = 
 Adafruit GFX Library
 Adafruit PCD8544 Nokia 5110 LCD library
 EEPROM
 1569       ;RotaryEncoder
 FastPID
 SPI

extra_scripts = noverify.py

noverify.py

Import("env")

old_flags = env["UPLOADERFLAGS"]
# filter out the --verify 
new_flags = [opt for opt in old_flags if opt != "--verify"]
# replace and update
env.Replace(
    UPLOADERFLAGS=new_flags,
    UPLOADCMD="$UPLOADER $UPLOADERFLAGS $SOURCES"
)

Upload logs:

greg@greg-EX58-UD3R:~/Documents/PlatformIO/Projects/hakko_t12$ pio run -t upload -v
Processing pro16MHzatmega328 (platform: atmelavr; board: pro16MHzatmega328; framework: arduino; monitor_speed: 115200; lib_deps: Adafruit GFX Library, Adafruit PCD8544 Nokia 5110 LCD library, EEPROM, 1569, FastPID, SPI; extra_scripts: noverify.py)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/pro16MHzatmega328.html
PLATFORM: Atmel AVR 1.15.0 > Arduino Pro or Pro Mini ATmega328 (5V, 16 MHz)
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash
PACKAGES: toolchain-atmelavr 1.50400.190710 (5.4.0), framework-arduinoavr 4.1.2, tool-avrdude 1.60300.190424 (6.3.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 10 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <Adafruit GFX Library> 1.5.7 (/home/greg/Documents/PlatformIO/Projects/hakko_t12/.pio/libdeps/pro16MHzatmega328/Adafruit GFX Library_ID13)
|   |-- <SPI> 1.0 (/home/greg/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/SPI)
|-- <Adafruit PCD8544 Nokia 5110 LCD library> 1.1.0 (/home/greg/Documents/PlatformIO/Projects/hakko_t12/.pio/libdeps/pro16MHzatmega328/Adafruit PCD8544 Nokia 5110 LCD library_ID81)
|   |-- <Adafruit GFX Library> 1.5.7 (/home/greg/Documents/PlatformIO/Projects/hakko_t12/.pio/libdeps/pro16MHzatmega328/Adafruit GFX Library_ID13)
|   |   |-- <SPI> 1.0 (/home/greg/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/SPI)
|   |-- <SPI> 1.0 (/home/greg/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/SPI)
|-- <EEPROM> 2.0 (/home/greg/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/EEPROM)
|-- <RotaryEncoder> 1.2.0 (/home/greg/Documents/PlatformIO/Projects/hakko_t12/.pio/libdeps/pro16MHzatmega328/RotaryEncoder_ID1569)
|-- <FastPID> 1.3.1 (/home/greg/Documents/PlatformIO/Projects/hakko_t12/.pio/libdeps/pro16MHzatmega328/FastPID_ID5220)
|-- <SPI> 1.0 (/home/greg/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/SPI)

warning: Ignoring missing SConscript 'noverify.py'
File "/home/greg/.platformio/penv/local/lib/python2.7/site-packages/platformio/builder/main.py", line 134, in <module>
MethodWrapper(["checkprogsize"], [".pio/build/pro16MHzatmega328/firmware.elf"])
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [=====     ]  52.6% (used 1077 bytes from 2048 bytes)
PROGRAM: [=====     ]  47.7% (used 14658 bytes from 30720 bytes)
.pio/build/pro16MHzatmega328/firmware.elf  :
section                     size      addr
.data                        262   8388864
.text                      14396         0
.bss                         815   8389126
.comment                      92         0
.note.gnu.avr.deviceinfo      64         0
.debug_info                 1524         0
.debug_abbrev               1442         0
.debug_line                   26         0
.debug_str                   520         0
Total                      19141
<lambda>(["upload"], [".pio/build/pro16MHzatmega328/firmware.hex"])
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
BeforeUpload(["upload"], [".pio/build/pro16MHzatmega328/firmware.hex"])
Auto-detected: /dev/ttyUSB0
avrdude -v -p atmega328p -C /home/greg/.platformio/packages/tool-avrdude/avrdude.conf -c arduino -b 57600 -D -P "/dev/ttyUSB0" -U flash:w:.pio/build/pro16MHzatmega328/firmware.hex:i

avrdude: Version 6.3, compiled on Sep 12 2016 at 15:21:49
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/greg/.platformio/packages/tool-avrdude/avrdude.conf"
         User configuration file is "/home/greg/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 2
         Firmware Version: 1.16
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: reading input file ".pio/build/pro16MHzatmega328/firmware.hex"
avrdude: writing flash (14658 bytes):

Writing | ################################################## | 100% 7.36s

avrdude: 14658 bytes of flash written
avrdude: verifying flash memory against .pio/build/pro16MHzatmega328/firmware.hex:
avrdude: load data flash data from input file .pio/build/pro16MHzatmega328/firmware.hex:
avrdude: input file .pio/build/pro16MHzatmega328/firmware.hex contains 14658 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 6.24s

avrdude: verifying ...
avrdude: 14658 bytes of flash verified

avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done.  Thank you.

=======================================================================

This is thread about disabling --verify with the invocation of bossac for Atmel SAMD type MCUs, not your ATMega328…

Anyways, avrdude --help will tell you

 -V                         Do not verify.

The documentation will tell you:

upload_flags
Extra flags for uploader. Will be added to the end of uploader command

Since we just need to add a -V and not modify existing flags you do not need a extra_script, you just need

upload_flags = -V

Also the error

indicates that noverify.py is not even found (must be at the same directory level at platformio.ini). But anyways since you don’t need it, just delete the extra_script directive.

1 Like

Thanks for the info. You learn something new every day :slight_smile:
Added

upload_flags = -V

and works like a charm.

2 Likes