Skip to content
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
Closed

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

seclorum opened this issue Jan 8, 2016 · 9 comments
Assignees
Milestone

Comments

@seclorum
Copy link

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
Copy link
Member

valeros commented Jan 8, 2016

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

@seclorum
Copy link
Author

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
Copy link
Member

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
Copy link
Member

@ivankravets
Copy link
Member

TODO: Implement upload_resetmethod option for http://docs.platformio.org/en/latest/projectconf.html#uploading-options

Ping @crushedice2000

@ivankravets
Copy link
Member

@ivankravets
Copy link
Member

@0x2b3bfa0
Copy link

@ivankravets: Thank you very much!

@seclorum
Copy link
Author

Thanks!

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

No branches or pull requests

4 participants