PlatformIO Community

How to build or copy after build in additional directory?

Hello,
usually after building any project generated file “firmware.bin” is located under “.pioenvs / board” folder.
Is there a way to specify different folder for that output file?

Is there a way after producing such output file to copy it somewhere else( shared folder for example)?

Let me know what would be the best approach to achieve it.

Regards.

See http://docs.platformio.org/en/stable/projectconf/section_platformio.html#build-dir

Hello Ivan,
thanks for pointing that out… but I was already trying to understand this particular documentations, but I was not able to understand what exactly I have to do…
Any help or example will be appreciated.

Put to platformio.ini this

[platformio]
envs_dir = custom_dir

[env:...]
...

Thanks a lot !
How we can achieve - remain the default build in the default folder and add additional folder for generation or copy?

You need http://docs.platformio.org/en/stable/projectconf/advanced_scripting.html where you can write own logic when build process is successed.

Sorry to dig this up, I am not able to get this working, I want the build directory to appear in a visible directory, I set it like this

[platformio]
PLATFORMIO_WORKSPACE_DIR=“mybuildfiles”

I assumed build files will start appearing under mybuildfiles, but it is still going inside .pio

Can you advise what is incorrect

Have you tried what build_dir from the documentation?

http://docs.platformio.org/en/stable/projectconf/section_platformio.html#build-dir

build_dir = mybuildfiles

in the platformio.ini. This will puit all build files in the folder, as if it were .pio\build. As ivan said above, if you want to copy specific files, a python script is needed.

Many thanks, that sorted it