New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not clear how to overwrite $BOARD.options.resetmethod .. #444

Closed
seclorum opened this Issue Jan 8, 2016 · 9 comments

Comments

Projects
None yet
4 participants
@seclorum

seclorum commented Jan 8, 2016

I would like to force my board.options.resetmethod="ck", but see no way to do that outside of editing the board.json file .. is there a way to override this for my board in a project-local config? (i.e. through platformio_extra_script.py - tried to override it like "esp12.board.options.resetmethod=ck" but no go ..

@valeros

This comment has been minimized.

Member

valeros commented Jan 8, 2016

Hi @seclorum!
How about create custom board based on esp12 with needed reset method?

@seclorum

This comment has been minimized.

seclorum commented Jan 12, 2016

I'd really rather not do that, since it means maintaining another set of file(z) outside the project repository - rather would like to know how to over-ride the defaults for this key (esp12e.upload.resetmethod) in platformio_extra_script.py, since that is already a build artifact of platformio being tracked in the project repo:

    "esp12e": {
        "build": {
            "core": "esp8266",
            "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12",
            "f_cpu": "80000000L",
            "ldscript": "esp8266.flash.4m.ld",
            "mcu": "esp8266",
            "variant": "nodemcu"
        },
        "frameworks": ["arduino"],
        "name": "Espressif ESP8266 ESP-12E",
        "platform": "espressif",
        "upload": {
            "maximum_ram_size": 81920,
            "maximum_size": 4194304,
            "resetmethod": "ck",
            "require_upload_port" : true,
            "speed": 115200
        },
        "url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
        "vendor": "Espressif"
    },

It seems that this should be possible with UPLOAD_RESETMETHOD, per tools/platformio.py .. but my overriding of this var is not propagating and I'm probably not doing it properly anyway.

@ivankravets ivankravets self-assigned this Jan 13, 2016

@ivankravets

This comment has been minimized.

Member

ivankravets commented Jan 13, 2016

Please use http://docs.platformio.org/en/latest/projectconf.html#extra-script

platformio.ini

[env:esp12e]
platform = espressif
framework = arduino
board = esp12e
extra_script = extra_script.py

extra_script.py

from SCons.Script import DefaultEnvironment

env = DefaultEnvironment()
env['BOARD_OPTIONS']['upload']['resetmethod'] = 'ck'

@ivankravets ivankravets added this to the 2.7.2 milestone Jan 13, 2016

ivankravets added a commit that referenced this issue Jan 13, 2016

@ivankravets

This comment has been minimized.

@ivankravets

This comment has been minimized.

Member

ivankravets commented Jan 13, 2016

@ivankravets

This comment has been minimized.

Member

ivankravets commented Jan 13, 2016

@ivankravets

This comment has been minimized.

@crushedice2000

This comment has been minimized.

crushedice2000 commented Jan 14, 2016

@ivankravets: Thank you very much!

ivankravets added a commit that referenced this issue Jan 29, 2016

@seclorum

This comment has been minimized.

seclorum commented Jan 29, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment