VS Arduino
Visual Micro >> Other Hardware >> Problem compiling for Z-Uno 2 - .ino not found
https://www.visualmicro.com/forums/YaBB.pl?num=1632414101

Message started by principia on Sep 23rd, 2021 at 4:21pm

Title: Problem compiling for Z-Uno 2 - .ino not found
Post by principia on Sep 23rd, 2021 at 4:21pm
Tim
I have added the published Z-Uno 2 board definition to my Arduino IDE setup (1.8.16) and I can compile blink with no errors. When I create a new project in VS 2019 (latest versions of VS and Visual Micro) for the Z-Uno 2 board I get the errorĀ  - Input sketch "C:\Users\Andy\AppData\Local\Temp\VMBuilds\Blink\Z-Uno2G_zuno2\Debug\Blink.ino" doesn't exists!.

I'm using the VS 2019 + Visual Micro successfully for various Arduino boards so I think that my setup is OK.

I've checked the AppData\...\Debug folder which does exist and contains blink.cpp but not blink.ino.

I've attached the VS Output Window text. Could you please have a look at this?
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Output_Window.txt ( 70 KB | 4 Downloads )

Title: Re: Problem compiling for Z-Uno 2 - .ino not found
Post by Tim@Visual Micro on Sep 23rd, 2021 at 9:47pm
We will have to install the package and look into the source of "C:\Users\Andy\AppData\Local\arduino15\packages\Z-Uno2G\tools\zme_make\0.3.1/zme_make"

The zme_make is run via a build event hook. It is passed the location of the Blink.ino. Can confirm the .ino exists this will prove the file has been correctly copied to the temmp build folder by visual micro? If the file exists, which is should, then we will look at why zme_make says it does not.

[code]"C:\Users\Andy\AppData\Local\Temp\VMBuilds\Blink\Z-Uno2G_zuno2\Debug/Blink.ino"[/code]

Title: Re: Problem compiling for Z-Uno 2 - .ino not found
Post by principia on Sep 24th, 2021 at 7:39am
I've checked the ..\Debug directory and there is no Blink.ino. When i execute a clean build the ..\Debug directory is populated with Blink.cpp, .VM_ProjectPreProcessor.cache.txt, \core, \.vmpreproc and \.vm_sys

The Zuno-2 board download URL is https://rus.z-wave.me/files/z-uno/g2/beta-index/package_z-wave2.me_index.json

When you first open a new project there may be an intellisense error on custom_cdecl.h not found - this file is auto generated by the Zuno pre-processor and goes away after the first build.

Title: Re: Problem compiling for Z-Uno 2 - .ino not found
Post by principia on Sep 25th, 2021 at 8:22am
Update: manually copying Blink.ino into ..\VMBuilds\...\Debug\ enables a successful build.

Title: Re: Problem compiling for Z-Uno 2 - .ino not found
Post by Tim@Visual Micro on Sep 25th, 2021 at 2:27pm
The tool should be looking for the .CPP.

I forgot that when I replied before.

Using the .into should be referenced from the project folder and in a project with multiple ino files it's going to be an issue.

Does the project build okay in the Arduino IDE?

Title: Re: Problem compiling for Z-Uno 2 - .ino not found
Post by principia on Sep 25th, 2021 at 4:09pm
The project builds from the Arduino IDE - tested by opening the sketch directly which is in the same location as the VS2019 .sln file.

There is only a single .ino source file in the project. No other .ino or .cpp files and no source sub-folders.

The VS2019 / Visual Micro error message says the .ino file cannot be found. The .cpp file does exist in the correct VMBuild folder but there is no .ino file. I noted your comment about expecting a .cpp file but this is not consistent with the error message.

As mentioned previously, manually copying the .ino file to the VMBuild folder enables a successful build.

I've looked at Boards.txt and extracted in the attached file the "recipe" and what the VS2019 output window records as the substitutions. it looks as if {build.project_name} goes to the .ino filename.

Hope this helps
Andy
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Zuno-2_board_compile_pattern.txt ( 1 KB | 5 Downloads )

Title: Re: Problem compiling for Z-Uno 2 - .ino not found
Post by Tim@Visual Micro on Sep 25th, 2021 at 10:43pm
Thanks, we will take a look.

When arduino project is compiled all .ino files are combined into a .cpp that is created in a temp folder. The .cpp has some other manipulations such as adding prototypes and other arduino specific code references. It is the .cpp that is built, not the .ino. Therefore the toolchain you are using is actually looking at the wrong file.

Having said that, if the Arduino IDE is copying and leaving the original .ino files in the temp folder then Visual Micro should do the same. The reference you see to "{build.project_name}" should probably be "{build.project_name}.cpp". There might even be a build propery with the full "ino.cpp" code file name.  However, we will look at a solution same as arduino ide.






Title: Re: Problem compiling for Z-Uno 2 - .ino not found
Post by principia on Sep 26th, 2021 at 8:34am
Tim, thanks for your help and hints. I've now established that the zme_make executable and the python scripts that it calls generate the .ino file and not the Arduino IDE itself. I'll try and work out why the same does not happen on the VisualMicro project. I'll let you know what the results are and if there might be any VisualMicro problems.

Title: Re: Problem compiling for Z-Uno 2 - .ino not found
Post by principia on Sep 28th, 2021 at 2:59pm
Simon, Tim
Thanks for the update which I've installed on VS2019. I've built my "blink" test program with VS2019 and the Arduino IDE and compared the two ".hex" files. They are identical except for one record at the start which I assume is a timestamp or similar. The test project has an included .h file that references a .cpp - all correct with this too.

So it all looks good - thank you for your efforts. VisualMicro has been my preferred "Arduino" platform for many years, I really like it as a seasoned MS C++ and C# developer.

I will post on the Z-Uno forum to let those developers know that VisualMicro supports the Z-Uno G2.

Andy

Title: Re: Problem compiling for Z-Uno 2 - .ino not found
Post by Simon@Visual Micro on Sep 29th, 2021 at 11:47am
Thanks for confirming, and we have re-released the VS2022 build of this version (21.09.17.2) to resolve a separate unrelated issue (in case you have both installed).
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES


VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.