luni64 / VisualTeensy

VisualCode projects for PJRC Teensy boards
Other
116 stars 11 forks source link

Unable to upload image using teensy.exe build task #46

Closed benpeart closed 3 years ago

benpeart commented 3 years ago

When I use the "Upload (teensy.exe) build task, I get the following error:

> Executing task: & 'C:/Program Files/VisualTeensy/make.exe' upload -j -Otarget <

Teensy Loader could not find the file HelloBlinkingWorld
quitmake: *** [makefile:164: upload] Error 1
The terminal process "C:\Program Files\PowerShell\7\pwsh.exe -Command & 'C:/Program Files/VisualTeensy/make.exe' upload -j -Otarget" terminated with exit code: 1.

I have been unable to figure out why it is unable to find my binary (HelloBlinkingWorld in this case). The tycommander build task uploads fine in this same project. I've created several different projects trying to figure out why it is failing but without success.

2021-04-20 (2)

luni64 commented 3 years ago

Interesting, I can have a closer look if you post the following files:

.vsteensy/vsteensy.json .vscode/c_cpp_properties.json and the generated makefile

luni64 commented 3 years ago

I'm wondering why it uses the powershell instead of the usual cmd.exe to execute make. Did you apply a special Windows setting for this?

dontfeedthenerd commented 3 years ago

I have the same problem both with TYcommander and the PJRC. I have attached my files

c_cpp_properties.zip

luni64 commented 3 years ago

Unfortunately I can't reproduce this here. Your files look perfectly normal. Can you please open the makefile and remove the @ in lines 164 and 165:

image

You then should see the actual command issued when it tries to upload the file. Check if the path and filename correspond to the location of your hex image. You can also copy the line into a new vscode terminal and execute it manually. Screenshots of those experiments would be helpful.

I get the following (Teensy.exe) image

(TyCommander) image

dontfeedthenerd commented 3 years ago

image Looks like the .hex isn't being appended to the -file?

dontfeedthenerd commented 3 years ago

Nope that's not it... hmmm. I think it may need the full path to-file?

luni64 commented 3 years ago

Just to make sure: Your project is called teensyproj and you find the file teensyproj.hex in the vsteensy/build folder, right? Did you try to manually call the command from a vscode terminal? Does it work then?

dontfeedthenerd commented 3 years ago

That is correct I can find a teensyproj.hex As a matter of fact I've been using VisualTeensy to build then manually loading using the teensyloader.

On Thu, Apr 22, 2021 at 11:01 AM luni64 @.***> wrote:

Just to make sure: Your project is called teensyproj and you find the file teensyproj.hex in the vsteensy/build folder, right? Did you try to manually call the command from a vscode terminal? Does it work then?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/luni64/VisualTeensy/issues/46#issuecomment-825067562, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFF5YTQF4WGWX6RHE6JOETTKBP7JANCNFSM43I6L2TA .

luni64 commented 3 years ago

As a matter of fact I've been using VisualTeensy to build then manually

yes but did you try exactly the command which is shown in your screenshot?

This works here since years without issue. Very weird. What is the output of a call to TyCommander?

dontfeedthenerd commented 3 years ago

image This is the output to TyCommander let me try running it manually

dontfeedthenerd commented 3 years ago

image

This is the output while running manually

dontfeedthenerd commented 3 years ago

did it in a command prompt running as admin same issue and here's proof the .hex exists: image

luni64 commented 3 years ago

Sorry, didn't mean to run the makefile manually but the upload command. I.e. the ...postcmpile -test -file=.... command.

Need to leave for an hour or so...

dontfeedthenerd commented 3 years ago

Thank you for your help!

This is the result of that: image

It just hangs I have to ctrl+C out of it

dontfeedthenerd commented 3 years ago

oh wait here we go: image

luni64 commented 3 years ago

Ok, now I can reproduce it. You obviously removed the "" around the command otherwise powershell reports an errror right? If I do the same I get the file not found issue. Looks like this only happens if vscode uses the powershell terminal. Can you switch to a cmd terminal and try if it works then?

open the terminal combobox and select "Select Default Profile" image

Select "Command Prompt" (instead of the currently selected PowerShell)

image

Close all open termials: image

and try to upload....

dontfeedthenerd commented 3 years ago

No Joy :(

image

dontfeedthenerd commented 3 years ago

image tried running the command manually

dontfeedthenerd commented 3 years ago

image same issue trying to run in a command prompt with admin privilege as well

luni64 commented 3 years ago

does it even find the file if you do type .vsteensy\build\teensyproj.hex in the vscode terminal? Should print the contents of the hex file

dontfeedthenerd commented 3 years ago

it does image

luni64 commented 3 years ago

Sorry, need to sleep over it. Maybe something changed in the call parameters of the teensy uploader. Can you check what your Arduino installation spits out to upload the hex (need to switch to verbose output to see it).

dontfeedthenerd commented 3 years ago

Yeah take your time, I don't mind using teensy to upload

On Thu, Apr 22, 2021, 12:48 PM luni64 @.***> wrote:

Sorry, need to sleep over it. Maybe something changed in the call parameters of the teensy uploader. Can you check what your Arduino installation spits out to upload the hex (need to switch to verbose output to see it).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/luni64/VisualTeensy/issues/46#issuecomment-825138884, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFF5YUZJFEWKUDJ6QK3IWDTKB4SHANCNFSM43I6L2TA .

benpeart commented 3 years ago

Switching to "Command Prompt" as the default terminal window got the teensy uploader working for me. Would be nice if it worked in powershell as well but at least I have a good workaround. Thank you!

nmccoy commented 1 year ago

For anyone else searching this in the future: I had the same error message but a different root cause. Turns out I just needed to close the teensy.exe loader window opened by the Arduino app.