Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flashing fails with new update #207

Open
NuclearTea opened this issue Sep 6, 2024 · 12 comments
Open

Flashing fails with new update #207

NuclearTea opened this issue Sep 6, 2024 · 12 comments

Comments

@NuclearTea
Copy link

Build succeeds however, doesnt produce the appropriate build files (build folder is basically empty).

Error:

image

Line in file:

flash: $(BUILD_DIRECTORY)/$(TARGET).elf
	"$(OPENOCD)" -f ./openocd.cfg -c "program $(BUILD_DIRECTORY)/$(TARGET).elf verify reset exit"

@DeflateAwning
Copy link
Contributor

This is v3.2.8, right? What operating system?

Can you please include a larger section of the error? The part you've included isn't possible to debug from, as every possible failure during the make flash command will show that exact message ("Error 1").

I'm unable to reproduce this issue in its current state.

@jortbmd
Copy link
Member

jortbmd commented Sep 9, 2024

Hi. Thanks for opening up an issue for this. I cannot really tell what the issue might be from the input you have given please provide some more info if available. You can also run the make processing by typing in the command: make -f STM32Make.make and see what the output is.
It might also be possible that something changed for your .stm32env file. Could you please delete this and check again?

@vaibhavkpr
Copy link

Hi! I would like to add to the issue details. The issue is with the v3.2.8 running on Windows. Here is a clearer screenshot of the flash error I am seeing.
STM32Ext_Issue

@jortbmd
Copy link
Member

jortbmd commented Sep 11, 2024

@vaibhavkpr Thanks for the additional information. Can you maybe provide you .stm32env file? Also have you tried deleting it and try flashing the device again?

@vaibhavkpr
Copy link

vaibhavkpr commented Sep 11, 2024

@jortbmd No problem! Yes so far I have attempted deleting the extension and reinstalling it, reverting back to a previous version (Seems to work after setting the correct version directory of OPENOCD in the .stm32env file, doesn't still fix the issue in the new version despite having the right paths for both OPENOCD & GCC) & deleting the .stm32env file and regenerating it by attempting a new clean build.

It does appear that OPENOCD was updated to a newer version and I did verify that the updated paths exist.

Here is what the .stm32env file looks like:

# environment variable file used by stm32-for-vscode and the STM32Make.make makefile
# Other environment variables can be added here. If wanting to use the generated makefile in CI/CD context please
# configure the following variables: GCC_PATH, OPENOCD

ARM_GCC_PATH = c:\Users\Username\AppData\Roaming\Code\User\globalStorage\bmd.stm32-for-vscode\@xpack-dev-tools\arm-none-eabi-gcc\13.3.1-1.1.1\.content\bin
OPENOCD = C:\USERS\USERNAME\APPDATA\ROAMING\CODE\USER\GLOBALSTORAGE\BMD.STM32-FOR-VSCODE\@XPACK-DEV-TOOLS\OPENOCD\0.12.0-4.1\.CONTENT\BIN\OPENOCD.EXE

@jortbmd
Copy link
Member

jortbmd commented Sep 16, 2024

That is a weird bug. Looks like the path is ok. Can you double check if you run the openocd command with the full path in your terminal with and without quotes.
e.g.
C:\USERS\USERNAME\APPDATA\ROAMING\CODE\USER\GLOBALSTORAGE\BMD.STM32-FOR-VSCODE\@XPACK-DEV-TOOLS\OPENOCD\0.12.0-4.1\.CONTENT\BIN\OPENOCD.EXE
and
"C:\USERS\USERNAME\APPDATA\ROAMING\CODE\USER\GLOBALSTORAGE\BMD.STM32-FOR-VSCODE\@XPACK-DEV-TOOLS\OPENOCD\0.12.0-4.1\.CONTENT\BIN\OPENOCD.EXE"
to see what happens. Also what shell are you using? CMD, Powershell, fish?

@DeflateAwning
Copy link
Contributor

Looks like Powershell.

The /usr/bin/sh line on the 10th line seems noteworthy (right where the failure happens from the flash command within the Makefile). Why would that appear on a Windows system? Is that perhaps the command that it can't find?

@vaibhavkpr
Copy link

vaibhavkpr commented Sep 17, 2024

Yes, I'm running PowerShell. I am able to run the OPENOCD command with the full path with and without quotes.

image

@jortbmd
Copy link
Member

jortbmd commented Sep 17, 2024

@DeflateAwning I do think your on to something right there. I did a quick inspection of the generated makefile, however it should not add this.
@vaibhavkpr could you check which version of make you have installed? If you run make --version it should tell you the version number.

@DeflateAwning
Copy link
Contributor

From the screenshot with the blue redactions, it's the xpack v4.4.1 make

@jortbmd
Copy link
Member

jortbmd commented Sep 17, 2024

@DeflateAwning Thanks for pointing that out. Somehow I seem to skip over stuff in the materials provided. So thanks for paying attention.
Seems like this is the newest make out there.
I feel like I need to run some test to check out what is causing this issue. It is one that kind of baffles me at the moment. I cannot think of a way that the /usr/bin/sh should be injected.
@vaibhavkpr as a check could you maybe add the following to the STM32Make.make makefile:

info:
	echo $(OPENOCD)

and then run: make -f STM32Make.make info.
This way I can check if it is in the Openocd string or that this originates elsewhere.

@vaibhavkpr
Copy link

vaibhavkpr commented Sep 17, 2024

@jortbmd I'm running GNU Make 4.4.1 currently. Upon injecting the echo in the STM32Make.make file here's what I found:

make -f STM32Make.make info
echo C:\USERS\Username\APPDATA\ROAMING\CODE\USER\GLOBALSTORAGE\BMD.STM32-FOR-VSCODE\@XPACK-DEV-TOOLS\OPENOCD\0.12.0-4.1\.CONTENT\BIN\OPENOCD.EXE
C:\USERS\Username\APPDATA\ROAMING\CODE\USER\GLOBALSTORAGE\BMD.STM32-FOR-VSCODE\@XPACK-DEV-TOOLS\OPENOCD\0.12.0-4.1\.CONTENT\BIN\OPENOCD.EXE

Oddly though when I added the path to make in settings.json in VSCode for the integrated terminal (PowerShell), it seems to resolve the issue altogether and run flash without errors.

"terminal.integrated.env.windows": {
        "PATH": "C:\\Users\\Username\\AppData\\Roaming\\Code\\User\\globalStorage\\bmd.stm32-for-vscode\\@xpack-dev-tools\\windows-build-tools\\4.4.1-2.1\\.content\\bin;C:\\Program Files\\msys64\\usr\\bin;${env:PATH}"
},
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants