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 Project-level board.txt recipe hooks not executing (Atmel Studio 7 + Visual Micro) (Read 90 times)
Dave_K
Junior Member
**
Offline


Posts: 25
Joined: Dec 14th, 2017
Project-level board.txt recipe hooks not executing (Atmel Studio 7 + Visual Micro)
Mar 24th, 2026 at 9:38am
Print Post  
Environment:
- IDE: Atmel Studio 7.0
- Visual Micro: extension for Atmel Studio 7
- Platform: MegaCoreX v1.1.5 (ATmega4809)
- Board ID: 4809 (runtime.vm.boardinfo.id=MegaCoreX_4809)
- OS: Windows 11 ARM running in Parallels virtual machine on macOS
- Build configuration: Release

Problem:

Custom recipe.hooks.* entries defined in the project-level board.txt are completely ignored during the build. They do not appear in the resolved Board Properties and are never executed.

Hardware property overrides in the same board.txt file (bootloader fuses, build.f_cpu, etc.) work correctly - only recipe.hooks.* entries are affected.

This setup worked without any issues on a previous installation (Windows 11 x86 on Parallels). The current environment is a fresh install on Windows 11 ARM on Parallels. Drive G: is a network-mapped drive (mapped from macOS host), same as on the previous installation where it worked fine.

I need to run a post-build step that calls an external tool on the output .hex file.

Project board.txt (simplified):

nona4809.build.f_cpu=20000000L
nona4809.build.text_section_start=.text=0x0800
recipe.hooks.postbuild.preupload.pattern.windows=cmd.exe /c "G:\MyProject\PostBuild.bat" "{build.mcu}" "{build.path}\{build.project_name}.hex"

The nona4809.* lines above are applied correctly. The recipe.hooks.* line is silently ignored.

What I've tried:

- recipe.hooks.postbuild.preupload.pattern.windows=...
- recipe.hooks.savehex.presavehex.3.pattern.windows=...
- recipe.hooks.savehex.postsavehex.1.pattern.windows=...
- 4809.recipe.hooks.savehex.presavehex.3.pattern.windows=...
- nona4809.recipe.hooks.savehex.presavehex.3.pattern.windows=...
- MSBuild AfterBuild target in .cppproj (gets overwritten when Visual Micro regenerates the project file)

None of the above appeared in Board Properties or executed.

What DOES work:

Hooks defined in platform.txt (MegaCoreX) execute correctly. presavehex.1 and presavehex.2 from platform.txt appear in Board Properties and run during the build. Only hooks from project-level board.txt are ignored.

Current workaround:

Patching platform.txt directly to add a presavehex.3 hook. This works but affects all MegaCoreX projects globally and will be lost on platform updates.

Questions:

1. Is this expected behavior - that recipe.hooks.* in project board.txt are not supported in Visual Micro for Atmel Studio 7?
2. Is there a recommended way to add per-project post-build steps that persist?
3. Could running Windows 11 ARM under Parallels be a factor?

Visual Micro is updated to the latest release. Build output with "vMicro > Compiler > Show Build Properties" enabled is attached as a .txt file.

Thank you.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2883
Joined: Feb 13th, 2019
Re: Project-level board.txt recipe hooks not executing (Atmel Studio 7 + Visual Micro)
Reply #1 - Mar 24th, 2026 at 9:42am
Print Post  
Thanks for the report.

Can you attach your board.txt file and we can reproduce this and advise any changes needed to the hooks to get them working.

The short answer is they should all work as expected in Visual Micro as they do in Arduino.
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2883
Joined: Feb 13th, 2019
Re: Project-level board.txt recipe hooks not executing (Atmel Studio 7 + Visual Micro)
Reply #2 - Mar 25th, 2026 at 3:11pm
Print Post  
In the log the hooks were prefixed with the board id, which means they wont be picked up.  If the hook is shortened to just recipe.hooks.postbuild.preupload.pattern then it should work as expected.

Does that solve the issue?
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint