Hey all!
Is there a way to get the currently used framework path as variable inside an extra script invoked from the platformio,ini file?
What i’m trying to achieve is:
- I’m using the megatinycore for a project using attiny806.
- Inside the framework (~/.platformio/packages/framework-arduino-megaavr-megatinycore/) there is a
tools
directory containing the pymcuprog based uploaderprog.py
, which as far as i know is not implemented as an option forupload_protocol
. - I’d like to use that program together with my own designed UPDI programmer. In my platformio.ini file i add an extra script:
extra_scripts = updi_upload.py
with the content:
Import("env", "projenv")
# Python callback
def on_upload(source, target, env):
firmware_path = str(source[0])
# here invoke the prog.py from
# ~/.platformio/packages/framework-arduino-megaavr-megatinycore/tools/
# with pio's pyenv and other params
env.Replace(UPLOADCMD=on_upload)
Is there a way i can get the path to the currently used framework as a variable
~/.platformio/packages/framework-arduino-megaavr-megatinycore/
inside my script, thus getting the path to the prog.py
?
I know i can get the python path using env.subst("$PYTHONEXE")
Thanks!