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 VMBuild Error "The operation failed with exception: Specified cast is not valid." (Read 2627 times)
Harry Mann
Newbies
*
Offline


Posts: 5
Joined: Jul 13th, 2018
VMBuild Error "The operation failed with exception: Specified cast is not valid."
Jul 13th, 2018 at 8:33pm
Print Post  
I tried to use VMBuild to compile a test project but I'm running into the error.  "Specific cast in not valid"

I'm using the following command line command. 
VMBuild.exe -builder.verbose=true -builder.build=true -builder.project_path="C:\dev\TestBlink\TestBlink\TestBlink.vcxproj" builder.board_id="STM32_Disco"
The operation failed with exception: Specified cast is not valid.

The project works great in visual studio micro ide but no luck using VMBuild.exe. 

Also dump of the boards  
--- Boards ---
id= STM32_Nucleo_144 [desc=Nucleo-144]
id= STM32_Nucleo_64 [desc=Nucleo-64]
id= STM32_Nucleo_32 [desc=Nucleo-32]
id= STM32_Disco [desc=Discovery]
id= STM32_GenF103 [desc=Generic STM32F103 series]
id= STM32_Maple [desc=Maple series]

Any help with this would be great.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12136
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VMBuild Error "The operation failed with exception: Specified cast is not valid."
Reply #1 - Jul 13th, 2018 at 10:57pm
Print Post  
Hi

In your boards.txt what is the id of the board you want to test first?

The id is whatever is on the left of the =

In your example it just shows id=

Thanks
  
Back to top
IP Logged
 
Harry Mann
Newbies
*
Offline


Posts: 5
Joined: Jul 13th, 2018
Re: VMBuild Error "The operation failed with exception: Specified cast is not valid."
Reply #2 - Jul 13th, 2018 at 11:23pm
Print Post  
In the boards.txt file it has the following info for the board I want to test


# Discovery boards

Disco.name=Discovery

Disco.build.vid=0x0483
Disco.build.pid=0x5711
Disco.vid.0=0x0483
Disco.pid.0=0x5711

# DISCO_F407VG board
# Support: USB HID
Disco.menu.pnum.DISCO_F407VG=STM32F407G-DISC1
Disco.menu.pnum.DISCO_F407VG.node=DIS_F407VG
Disco.menu.pnum.DISCO_F407VG.upload.maximum_size=1048576
Disco.menu.pnum.DISCO_F407VG.upload.maximum_data_size=196608
Disco.menu.pnum.DISCO_F407VG.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
Disco.menu.pnum.DISCO_F407VG.build.board=DISCO_F407VG
Disco.menu.pnum.DISCO_F407VG.build.series=STM32F4xx
Disco.menu.pnum.DISCO_F407VG.build.product_line=STM32F407xx
Disco.menu.pnum.DISCO_F407VG.build.variant=DISCO_F407VG
Disco.menu.pnum.DISCO_F407VG.build.cmsis_lib_gcc=arm_cortexM4l_math


So what should I be using for the builder.board_id in this case?  I'm still new to the embedded world so thanks for your patience
  
Back to top
 
IP Logged
 
Harry Mann
Newbies
*
Offline


Posts: 5
Joined: Jul 13th, 2018
Re: VMBuild Error "The operation failed with exception: Specified cast is not valid."
Reply #3 - Jul 13th, 2018 at 11:28pm
Print Post  
In the first post the board dump was take by the command
vmbuild -builder.dump_boards=true

Since vmbuild cannot find the ID in this case could this be part of my issue?

Thanks
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12136
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VMBuild Error "The operation failed with exception: Specified cast is not valid."
Reply #4 - Jul 13th, 2018 at 11:30pm
Print Post  
The board_id should be Disco but I will test over next few days

board_id=Disco
  
Back to top
IP Logged
 
Harry Mann
Newbies
*
Offline


Posts: 5
Joined: Jul 13th, 2018
Re: VMBuild Error "The operation failed with exception: Specified cast is not valid."
Reply #5 - Jul 14th, 2018 at 4:52am
Print Post  
I believe Disco was one of the first things I tried but I still get the same issue.   

C:\Backup\VMBuilderTool>VMBuild.exe -builder.verbose=true -builder.build=true -builder.project_path="C:\dev\TestBlink\TestBlink\TestBlink.vcxproj" builder.board_id="Disco"
The operation failed with exception: Specified cast is not valid.

Are there any settings that I can set to get a little more debug info or enable some logging to help out? 

Again thanks for your help
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12136
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VMBuild Error "The operation failed with exception: Specified cast is not valid."
Reply #6 - Jul 14th, 2018 at 3:08pm
Print Post  
Sorry I forgot how it worked. The board_id can be any part or the entire string you see when the board is selected so fairly flexible.

The problem was a new setting to control if local board.txt can be used was not referenced correctly.

The builder has been updated so please download the update from this page

https://www.visualmicro.com/page/Visual-Micro-Command-Line-Interface.aspx

Thanks for the post

  
Back to top
IP Logged
 
Harry Mann
Newbies
*
Offline


Posts: 5
Joined: Jul 13th, 2018
Re: VMBuild Error "The operation failed with exception: Specified cast is not valid."
Reply #7 - Jul 14th, 2018 at 4:29pm
Print Post  
Worked perfectly.   

Thank you very much for all your work.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint