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
Normal Topic recipe.hooks.postbuild starts when HEX file is still older version (Read 2104 times)
Tomin
Newbies
*
Offline


Posts: 5
Joined: Aug 7th, 2023
recipe.hooks.postbuild starts when HEX file is still older version
Aug 13th, 2023 at 12:07pm
Print Post  
Hi.

(AVR, Visual Studio)

I observed a strange behaviour in this hook.
I have BAT file what takes actual HEX file and merge it with my bootloader.
But, the hex file what is merged with bl. is always one version older than actual.

I tried disclose it, so in a BAT file I added TIME >c:\temp\time.txt
to check what time is when hook starts.

I can see a console window on a screen (with my BAT file runnig) first
and AFTER that I can see updated HEX on the disk.
(my burning software gongs after updating HEX)

It seems the hook is started in time, when the HEX file is NOT already fully updated or closed/released. (Maybe is already updated, but not CLOSED in VMicro/Visual Studio ???)

Thank you for every info in advance.
Tomas
« Last Edit: Aug 14th, 2023 at 8:08am by Tomin »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: recipe.hooks.postbuild starts when HEX file is still older version
Reply #1 - Aug 13th, 2023 at 5:24pm
Print Post  
You always need to post the info requested in yellow at the top of the page or we can't answer.
  
Back to top
IP Logged
 
Tomin
Newbies
*
Offline


Posts: 5
Joined: Aug 7th, 2023
Re: recipe.hooks.postbuild starts when HEX file is still older version
Reply #2 - Aug 14th, 2023 at 8:10am
Print Post  
Sorry. Missed. Added into the first msg.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2730
Joined: Feb 13th, 2019
Re: recipe.hooks.postbuild starts when HEX file is still older version
Reply #3 - Aug 14th, 2023 at 8:49am
Print Post  
For manipulating the resulting HEX files the Postbuild hook can be too early (as the build has finished but the hex may still be being moved to the project folder at this point), so the PostSaveHex hook would be a better option:

recipe.hooks.savehex.postsavehex.1.use_shell_execute=true
recipe.hooks.savehex.postsavehex.1.working_directory={build.project_path}\..
recipe.hooks.savehex.postsavehex.1.create_no_window=false
recipe.hooks.savehex.postsavehex.1.pattern=cmd.exe /c mergeAppAndBootload.bat

Does this help to resolve the issue?


  
Back to top
IP Logged
 
Tomin
Newbies
*
Offline


Posts: 5
Joined: Aug 7th, 2023
Re: recipe.hooks.postbuild starts when HEX file is still older version
Reply #4 - Aug 14th, 2023 at 9:26am
Print Post  
It seems this part.hook does not start. Sad
Do I need something set on ?

Thanks very much for you help.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2730
Joined: Feb 13th, 2019
Re: recipe.hooks.postbuild starts when HEX file is still older version
Reply #5 - Aug 14th, 2023 at 10:15am
Print Post  
Apologies, if you also enable vMicro > Compiler > Always Export Binary this will ensure the hook runs.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint