Can I upload code on OS rather than firmware?

I have a raspberry pi running raspbian on it. I want to create code and upload code on the same hardware (Host and Guest are same hardware). So I have a raspberry pi with raspbian and vscode on it. I create the code on the raspberry pi(platformIO vscode) then I want to run that code on the same raspberry pi(upload the code to the hardware that created the code).

I currently have vscode and platformIO installed on my raspberry pi, and I just tried uploading but it failed because the upload_port doesn’t know how to redirect back to itself(its expects the Host and Guest to be different rather than the same).

How do I upload code onto an OS rather than as firmware?

PS. As a hack I’m using ‘pio test’ to run the code on top of the raspbian OS, but I do not like this solution at all!

After building the binary will be stored to .pio\build\<environment name>\program.exe. When I try to upload it via pio run -t upload just says

*** Do not know how to make File target `upload' (C:\Users\Maxi\native_test\upload).  Stop.

So I guess there is no sensible implementation there. I would expect to set upload_port to a folder path and for it to then put the program there, but that doesn’t seem to happen. You should create an issue at Issues · platformio/platform-native · GitHub to ask for an implementation of the “upload” behavior.

Meanwhile you can write a simple bash script which just executes the binary after compiling it.

pio run && ./pio/build/<environment name>/program

Please file an issue here Issues · platformio/platform-linux_arm · GitHub and we will implement upload for native dev/platforms. Thanks!