Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Cannot delete HEX file, shows as being open in Visual Studio (Read 4431 times)
SteveAndrew
Newbies
*
Offline


Posts: 6
Joined: Feb 14th, 2023
Cannot delete HEX file, shows as being open in Visual Studio
Feb 20th, 2023 at 12:20am
Print Post  
I have an intermittent problem. I have a project running on an ATmega2560, everything compiles, uploads and runs without error. Every 5 or so edit/compile/upload cycles appear to proceed as normal but I see the following message :

Compiling 'WSPR_Test' for 'ATmega2560 (Mega 2560) (Arduino Mega)      (mega_atmega2560)'
Program size: 59456 bytes (used 23% of a 253952 byte maximum) (3.68 secs)
Minimum Memory Usage: 3160 bytes (39% of a 8192 byte maximum)
avr-objcopy*: R_Test.ino.hex: Permission denied
 
Uploading 'WSPR_Test' to 'ATmega2560 (Mega 2560) (Arduino Mega) (mega_atmega2560)' using 'COM4'
     The upload process has finished.


Although the compile cycle runs without error, the HEX file is not being updated. It appears to be open and therefore cannot be written to. When I try to delete the .HEX file, I get the following message:

File in Use
The action can't be completed because the file is open in Microsoft Visual Studio 2002

Close the file and try again

WSPR_Test.ino.hex


I have to close down Visual Studio, delete the HEX file and then restart VS. I have done an extensive search on-line but can see no report of a similar error. I can see no setting in VM or VS that should cause this sort of problem.

Has anyone experienced a similar problem ?

« Last Edit: Feb 20th, 2023 at 12:27am by SteveAndrew »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #1 - Feb 20th, 2023 at 12:34am
Print Post  
It means the file is locked and can not be regenerated. Only software such as virus checker or file uploader would cause this. or are you working on a remote drive?
« Last Edit: Feb 20th, 2023 at 12:35am by Tim@Visual Micro »  
Back to top
IP Logged
 
SteveAndrew
Newbies
*
Offline


Posts: 6
Joined: Feb 14th, 2023
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #2 - Feb 20th, 2023 at 12:45am
Print Post  
No virus checker is running, and I'm not working with a remote drive. If I try to delete the file while VS is running, I'm told file is in use. Once I close VS, I can delete the file.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #3 - Feb 20th, 2023 at 12:47am
Print Post  
Then it's possible whatever uploader is being used it hanging onto the file. Please follow the guide in yellow above. Thanks
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #4 - Feb 20th, 2023 at 12:52am
Print Post  
Thanks for the emailed output. It's potentially and issue with the build or upload tools of arduino AVR 1.8.4. Trying using board manager to update to the latest avr.

If that doesn't rosolve then switch on vmicro>general>upload verbose and send the output again after upload.
  
Back to top
IP Logged
 
SteveAndrew
Newbies
*
Offline


Posts: 6
Joined: Feb 14th, 2023
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #5 - Feb 20th, 2023 at 1:27am
Print Post  
All Arduino upload software presumably part of Arduino IDE. Currently using following software:

Arduino IDE and associated files  version: 2.0.3

VS version: Microsoft Visual Studio Community 2022 (64-bit) – Current Version 17.4.5

VM Version: Release 22.11.28.15

Dumps with file locked and not locked emailed to you as per request. Currently trying to reproduce error using just Arduino IDE, so far all seems OK
  
Back to top
 
IP Logged
 
SteveAndrew
Newbies
*
Offline


Posts: 6
Joined: Feb 14th, 2023
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #6 - Feb 20th, 2023 at 2:17am
Print Post  
Update...

Repeatedly built and uploaded using Arduino IDE - No problems.

Using VS - Problem still occurs when Cleaning and Re-building project without uploading to processor. Presumably this eliminates any problems with the uploading software.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #7 - Feb 24th, 2023 at 1:49pm
Print Post  
Please install the LATEST from our forum downloads. A gallery update will be released shortly.
  
Back to top
IP Logged
 
Advenger
Newbies
*
Offline


Posts: 4
Location: Saskatoon
Joined: Feb 23rd, 2023
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #8 - Feb 24th, 2023 at 4:15pm
Print Post  
I'm also getting the same random error.  Installed the latest version and made sure the virus check was off.  Hit the compile button and still got...

avr-objcopy*: C:\Users\Blair\AppData\Local\Temp\VMBuilds\Sketch1\uno\Release\Sketch1.ino.hex: Permission denied
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2377
Joined: Feb 13th, 2019
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #9 - Feb 24th, 2023 at 4:19pm
Print Post  
Thanks for adding to the thread.

Can you enable the settings shown at the top of the page and attach the complete Micro Build Output for us to review?

Does this happen for you every compilation or is it an intermittent error as other users have experienced?
  
Back to top
 
IP Logged
 
Advenger
Newbies
*
Offline


Posts: 4
Location: Saskatoon
Joined: Feb 23rd, 2023
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #10 - Feb 24th, 2023 at 5:09pm
Print Post  
Logs sent via email.

The first time it always works after that, sometimes it works sometimes it doesn't, there doesn't seem to be a pattern.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2377
Joined: Feb 13th, 2019
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #11 - Feb 24th, 2023 at 5:41pm
Print Post  
Thanks for the logs and the update.

Can you add a local board.txt file to the project (vMicro > Add Code > Add Local board.txt) and put the below entry in, and save the file:
bootloader.file=

Then ensure the file is unlocked (restart VS) and then try recompiling the project a number of times to see if the issue still presents itself it would be very helpful.
  
Back to top
 
IP Logged
 
Advenger
Newbies
*
Offline


Posts: 4
Location: Saskatoon
Joined: Feb 23rd, 2023
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #12 - Feb 24th, 2023 at 5:56pm
Print Post  
Sorry…. I’m not totally understanding the above instructions.
  
Back to top
 
IP Logged
 
Advenger
Newbies
*
Offline


Posts: 4
Location: Saskatoon
Joined: Feb 23rd, 2023
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #13 - Feb 24th, 2023 at 6:43pm
Print Post  
Ok... I reread the message again and came to the conclusion I was to add board.txt to the solution and add the entry  'bootloader.file=' to it.

Ran it multiple times, only managed to make it fail once.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #14 - Feb 24th, 2023 at 11:06pm
Print Post  
Thanks for all the feedback. Please install the LATEST from again. Hopefully that resolves.

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES


Delete the local board.txt that was added for testing. It will cause confusion.
« Last Edit: Feb 25th, 2023 at 1:05pm by Tim@Visual Micro »  
Back to top
IP Logged
 
SteveAndrew
Newbies
*
Offline


Posts: 6
Joined: Feb 14th, 2023
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #15 - Feb 27th, 2023 at 4:38am
Print Post  
I've downloaded and installed the latest version - 2.2023.0220 Minor 3

I've given it a fairly good thrashing  (it seemed to enjoy it  Smiley) and so far it seems to release the HEX file every time. 

I've had to be off-air the past week so will be getting into some heavy compiling over the next few days. I'll let you know how it goes, one way or another in a day or two. Many thanks for your help, and to all others who made a contribution.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #16 - Feb 28th, 2023 at 10:36pm
Print Post  
Excellent, thanks for all the testing and feedback.
  
Back to top
IP Logged
 
SteveAndrew
Newbies
*
Offline


Posts: 6
Joined: Feb 14th, 2023
Re: Cannot delete HEX file, shows as being open in Visual Studio
Reply #17 - Mar 1st, 2023 at 12:48am
Print Post  
Hi

Spent a long night with many, many edit/compile/upload cycles and I'm happy to say the problem seems to have gone away which makes me a very happy little Vegimite Smiley

Thanks lads
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint