PlatformIO Community

Custom upload protocol not working

Hi all,

I just installed the windows_x86 platform and built my first windows program with platformio.

Sidenote: since there are no boards defined for the platform, you cannot create the project in the gui. Not good for a beginner. Maybe you want to add a dummy “Generic Intel PC” board?

Now that this worked, I wanted to (ab?)use the upload target to “install” the program in a search path directory.
Unfortunately I get this error and cannot figure out why:

Compiling .pioenvs\windows_x86\src\main.o
Linking .pioenvs\windows_x86\program.exe
Checking size .pioenvs\windows_x86\program.exe
*** Do not know how to make File target `upload' (C:\Users\joba1\Documents\PlatformIO\Projects\Present\upload).  Stop.

I use PlatformIO, version 3.6.4 on Windows 10

platformio.ini:

[env:windows_x86]
platform = windows_x86
extra_scripts = upload_target.py
upload_protocol = custom

upload_target.py:

Import('env')
environ = env['ENV']
target='%s\\Microsoft\\WindowsApps' % environ['LOCALAPPDATA']
env.Replace(UPLOADCMD='copy /y $SOURCE %s' % target)

Can you please help me spot the error?

BR,
Joachim

There is no upload target for desktop dev/platforms. See https://github.com/platformio/platform-windows_x86/blob/develop/builder/main.py

You implement own as

from SCons.Script import AlwaysBuild

Import('env')
AlwaysBuild(env.Alias("upload", "$BUILD_DIR/${PROGNAME}", "copy /y ......"))

Please read: