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) Object reference not set to an instance of an object (Read 10805 times)
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Object reference not set to an instance of an object
Mar 25th, 2017 at 11:56am
Print Post  
Hello,

after updating to the latest vm version, i have started to experience problems .
i trued with same arduino version 1.6
latest vm pro
and VS 2015
I do think the problem is related with the program not able to find some file ( a path that gets changed after update), but of course i don't know for sure


---


Searching for libraries ...
Library Include Paths (1)
Include Path 'C:\Users\gnkarn\Documents\Arduino\libraries\FastLED_GFX'
-gcc\1.20.0-26-gb404fb9\bin\xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ .0/tools/sdk/include" .0/tools/sdk/lwip/include" emcuv2\Release/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DARDUINO=10609 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_NODEMCU" -DESP8266 -I"C:\Users\gnkarn\Documents\Arduino\libraries\FastLED_GFX" -I"C:\Users\gnkarn\Documents\Arduino\libraries" .0\cores\esp8266" .0\variants\nodemcu" cuv2\Release\Funky_Control8266-jqm.cpp" -o "nul"
El sistema no puede encontrar el archivo especificado
     Preprocess: -gcc\1.20.0-26-gb404fb9\bin\xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ .0/tools/sdk/include" .0/tools/sdk/lwip/include" emcuv2\Release/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DARDUINO=10609 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_NODEMCU" -DESP8266 -I"C:\Users\gnkarn\Documents\Arduino\libraries\FastLED_GFX" -I"C:\Users\gnkarn\Documents\Arduino\libraries" .0\cores\esp8266" .0\variants\nodemcu" cuv2\Release\Funky_Control8266-jqm.cpp" -o "nul"
   Object reference not set to an instance of an object



     An error was encountered during the 'Deep Search' library discovery process.

appreciate your support as im stuck after  update.

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Object reference not set to an instance of an object
Reply #1 - Mar 25th, 2017 at 12:14pm
Print Post  
Question: Does this file exist?

C:\Users\gnkarn\AppData\Local\arduino15\packages\esp8266\tools\xtensa-lx106-elf
-gcc.exe

or

this one?

f
-gcc.exe

  
Back to top
WWW  
IP Logged
 
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Re: Object reference not set to an instance of an object
Reply #2 - Mar 25th, 2017 at 12:32pm
Print Post  
ok, now i have installed the arduino IDE version 1.8.1 , 
nothing significant changed .

it can't find a file, it uses a lot of temp, files that i have no control over , please take a look at the output.


Code
Select All
Building project code ...
  Using previously compiled file: uv2\Release\Funky_Control8266-jqm.cpp.o
  Using previously compiled file: uv2\Release\SettingsServer.cpp.o

Linking it all together ...
-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-gcc" -g -w -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static .0/tools/sdk/lib" .0/tools/sdk/ld" "-Teagle.flash.4m1m.ld" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy -o cuv2\Release/Funky_Control8266-jqm.ino.elf" -Wl,--start-group cuv2\Release\Funky_Control8266-jqm.cpp.o" cuv2\Release\WebSockets\WebSockets.cpp.o" cuv2\Release\WebSockets\WebSocketsClient.cpp.o" cuv2\Release\WebSockets\WebSocketsServer.cpp.o" cuv2\Release\WebSockets\libb64\cdecode.c.o" cuv2\Release\WebSockets\libb64\cencode.c.o" cuv2\Release\WebSockets\libsha1\libsha1.c.o" cuv2\Release\Hash\Hash.cpp.o" cuv2\Release\Hash\sha1\sha1.c.o" cuv2\Release\ESP8266WiFi\ESP8266WiFi.cpp.o" cuv2\Release\ESP8266WiFi\ESP8266WiFiAP.cpp.o" cuv2\Release\ESP8266WiFi\ESP8266WiFiGeneric.cpp.o" cuv2\Release\ESP8266WiFi\ESP8266WiFiMulti.cpp.o" cuv2\Release\ESP8266WiFi\ESP8266WiFiScan.cpp.o" cuv2\Release\ESP8266WiFi\ESP8266WiFiSTA.cpp.o" cuv2\Release\ESP8266WiFi\WiFiClient.cpp.o" cuv2\Release\ESP8266WiFi\WiFiClientSecure.cpp.o" cuv2\Release\ESP8266WiFi\WiFiServer.cpp.o" cuv2\Release\ESP8266WiFi\WiFiUdp.cpp.o" cuv2\Release\ESP8266WebServer\ESP8266WebServer.cpp.o" cuv2\Release\ESP8266WebServer\Parsing.cpp.o" cuv2\Release\ESP8266HTTPUpdateServer\ESP8266HTTPUpdateServer.cpp.o" cuv2\Release\DNSServer\DNSServer.cpp.o" cuv2\Release\ArduinoOTA\ArduinoOTA.cpp.o" cuv2\Release\EEPROM\EEPROM.cpp.o" cuv2\Release\ESP8266mDNS\ESP8266mDNS.cpp.o" cuv2\Release\ESP8266SSDP\ESP8266SSDP.cpp.o" cuv2\Release\FastLED\bitswap.cpp.o" cuv2\Release\FastLED\colorpalettes.cpp.o" cuv2\Release\FastLED\colorutils.cpp.o" cuv2\Release\FastLED\FastLED.cpp.o" cuv2\Release\FastLED\hsv2rgb.cpp.o" cuv2\Release\FastLED\lib8tion.cpp.o" cuv2\Release\FastLED\noise.cpp.o" cuv2\Release\FastLED\power_mgt.cpp.o" cuv2\Release\FastLED\wiring.cpp.o" cuv2\Release\FastLED_GFX\glcdfont.c.o" cuv2\Release\FastLED_GFX\FastLED_GFX.cpp.o" cuv2\Release\WiFiManager-master\WiFiManager.cpp.o" cuv2\Release\SettingsServer.cpp.o" cuv2\Release/core.a" -lm -lgcc -lhal -lphy -lpp -lnet80211 -lwpa -lcrypto -lmain -lwps -laxtls -lsmartconfig -lmesh -lwpa2 -llwip_gcc -lstdc++ -Wl,--end-group emcuv2\Release"
## recipe.objcopy.hex.pattern
"{runtime.tools.esptool.path}/esptool.exe" -eo /bootloaders/eboot/eboot.elf" -bo cuv2\Release/Funky_Control8266-jqm.ino.bin" -bm dio -bf 40 -bz 4M -bs .text -bp 4096 -ec -eo cuv2\Release/Funky_Control8266-jqm.ino.elf" -bs .irom0.text -bs .text -bs .data -bs .rodata -bc -ec
	Process: "{runtime.tools.esptool.path}\esptool.exe" -eo /bootloaders/eboot/eboot.elf" -bo cuv2\Release/Funky_Control8266-jqm.ino.bin" -bm dio -bf 40 -bz 4M -bs .text -bp 4096 -ec -eo cuv2\Release/Funky_Control8266-jqm.ino.elf" -bs .irom0.text -bs .text -bs .data -bs .rodata -bc -ec 


El sistema no puede encontrar el archivo especificado

Program Funky_Control8266-jqm size: 389.828 bytes (used 37% of a 1.044.464 byte maximum) (5,09 secs)
Minimum Memory Usage: 49072 bytes (60% of a 81920 byte maximum)
« Last Edit: Mar 25th, 2017 at 12:46pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Re: Object reference not set to an instance of an object
Reply #3 - Mar 25th, 2017 at 12:38pm
Print Post  
thanks Tim, yes that really is a folder , that contains 2 other folders , named 
1.20.0-26-gb404fb9
and
1.20.0-26-gb404fb9-2

inside there are other folders, and one with the name:

xtensa-lx106-elf

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Object reference not set to an instance of an object
Reply #4 - Mar 25th, 2017 at 12:46pm
Print Post  
1)
Open the visual micro explorer and click the board manager tab. Then click rescan or restart the ide. does that work?

2)
Does it work from within the arduino ide?

« Last Edit: Mar 25th, 2017 at 12:58pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Re: Object reference not set to an instance of an object
Reply #5 - Mar 25th, 2017 at 3:25pm
Print Post  
no now it is nor working 

it claims for some functions to be declared ( is a file order problem in arduino die ) , but shouldn't be a problem on VM

now the error is 

-gcc\1.20.0-26-gb404fb9\bin\xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ .0/tools/sdk/include" .0/tools/sdk/lwip/include" emcuv2\Release/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DARDUINO=10801 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_NODEMCU" -DESP8266 .0\cores\esp8266" .0\variants\nodemcu" cuv2\Release\Funky_Control8266-jqm.cpp" -o "nul"
El sistema no puede encontrar el archivo especificado
     Preprocess: -gcc\1.20.0-26-gb404fb9\bin\xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ .0/tools/sdk/include" .0/tools/sdk/lwip/include" emcuv2\Release/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DARDUINO=10801 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_NODEMCU" -DESP8266 .0\cores\esp8266" .0\variants\nodemcu" cuv2\Release\Funky_Control8266-jqm.cpp" -o "nul"
   Object reference not set to an instance of an object



     An error was encountered during the 'Deep Search' library discovery process.
Build failed for project 'Funky_Control8266-jqm'



something is missing after update ,
some change on the configuration files happened after the VM update process , as this was working just fine before .

rgds
  
Back to top
 
IP Logged
 
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Re: Object reference not set to an instance of an object
Reply #6 - Mar 25th, 2017 at 3:42pm
Print Post  
other problem i see after update , is that Teensy does not appear any more   as an option for hardware
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Object reference not set to an instance of an object
Reply #7 - Mar 25th, 2017 at 3:49pm
Print Post  
Hi,

Firstly let me say that the visual micro installation process does not have the capability to change the installed board/hardware configuration. Visual Micro is read only for that so we must look at other things that have changed.

The process of discovery of tool chains has been extended in line with the way the arduino ide works. Form what you are saying I gather that the current arduino ide also fails to compile? There has been some improvements in the way tool chain version numbers are handled in both visual micro and arduino, so maybe you had an older esp installation that was not quite correct.

I suggest the following:-

1 Close all IDE's

2 Delete the esp8266 package that you have installed by deleting this folder "C:\Users\gnkarn\AppData\Local\arduino15\packages\esp8266"

3 Open the Arduino IDE and follow the esp8266 installation guide to ensure the latest esp8266 (2.3.x) package is installed via the arduino ide board manager

4 Confirm that a simple esp8266 program builds and uploads correctly in the arduino ide

5 Then visual micro should also be working.


  
Back to top
WWW  
IP Logged
 
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Re: Object reference not set to an instance of an object
Reply #8 - Mar 25th, 2017 at 7:05pm
Print Post  
this is was i did, found that there were two folders named similar :
one 1.20.0-26-gb404fb9, which was empty
and one 1.20.0-26-gb404fb9-2
which had folders 

so i just copied the files form one to other ,
and that made the trick 

i think that the installation process somehow modified the folders ,  there are no other explanations .

as you suggested , probably deleting all , and installing again would have made it also , but now we have better idea of what happens .

tis
  
Back to top
 
IP Logged
 
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Re: Object reference not set to an instance of an object
Reply #9 - Mar 25th, 2017 at 7:10pm
Print Post  
thank you
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Object reference not set to an instance of an object
Reply #10 - Mar 25th, 2017 at 9:25pm
Print Post  
Thanks for the update.

I can assure you the install can't change any files, visual studio does not give it permission. You will see that a Visual Studio .vsix extension file is just a zip with a different extension. Visual Studio unpacks the zip but does not run any code.

What happened was that you always had the two folders caused by installing and update the esp core with early versions of the Arduino Board Manager. Later versions of both arduino and visual studio use the version numbers from disk more strictly than before. This is important for reliability but an annoying result is that a few users of early arduino 1.6 versions, like yourself, will encounter this issue and need to clean up the downloaded packages folder (like you have done).
« Last Edit: Mar 25th, 2017 at 9:26pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Re: Object reference not set to an instance of an object
Reply #11 - Mar 26th, 2017 at 11:21am
Print Post  
thank you for the details , it is very clear .

now im experiencing again the message " the system can not find the specified file"
so i turned off the computer yesterday with all working ok, and rebooted this morning with the problem ...

and the  "very long message" does not specify which file is the one missing
also what i have my configuration set for english, and that particular message is shown in spanish , strange isn it?
« Last Edit: Mar 26th, 2017 at 11:21am by GusKar »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Object reference not set to an instance of an object
Reply #12 - Mar 26th, 2017 at 11:40am
Print Post  
Code
Select All
it claims for some functions to be declared ( is a file order problem in arduino die ) , but shouldn't be a problem on VM 



The file order of .ino files is important. 

Why not zip your project and email to info[at]visualmicro.com.

Also switch on "vMicro>compiler>show build properties" and the "verbose" option then build and email the output as a .TXT file to info[at]visualmicro.com. Include a link to this post in the email.
  
Back to top
WWW  
IP Logged
 
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Re: Object reference not set to an instance of an object
Reply #13 - Mar 26th, 2017 at 12:03pm
Print Post  
i think i found the problem now ,
i was selecting arduino 1.6 1.8 as IDE instead of VM, so the linker was acting as an arduino ..

it works fine now !
« Last Edit: Mar 26th, 2017 at 12:03pm by GusKar »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Object reference not set to an instance of an object
Reply #14 - Mar 26th, 2017 at 12:15pm
Print Post  
Well done to get it working but I think we still need to understand what was going wrong.

Here is some information and some answers that might help us get closer or make it easier to observe the problem if it happens again...

I am not so sure your solution should change/fix anything. Arduino 1.6/1.8 and "Visual micro" should be identical for esp boards. It should only have an affect for users of standard arduino avr boards such as the Uno.

The long message is only because you have "Verbose" enabled on the vMicro>Compiler menu.

The Teensy boards are the only boards that install into the arduino ide folder. So if you change Ide then you have to reinstall.

Your project was building better than yesterday. The compiler tools were found correctly.

The problem this time was that the final tool used in the link could not be found. When you see these braces in the output, {tool name}, this means a tool location has not been resolved. In this case it is the esptool.exe location that can not be found.

Process: "{runtime.tools.esptool.path}\esptool.exe"

If the tool can not be found we ask windows to run an invalid file name. "{runtime.tools.esptool.path}\esptool.exe"

Windows then returns an error in your language which is why you were seeing a non-english error message.

Summary

When you have time please download the latest arduino ide from arduino.cc. Use the "admin install zip" and unpack into a new folder on your pc. Then in the visual micro <configuration manager> set the arduino 1.6/1.8 location to the folder where the arduino.exe you unzipped is located.

This will give us a clean arduino ide install. Then try visual micro with Arduino 1.6/1.8.

Thanks
  
Back to top
WWW  
IP Logged
 
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Re: Object reference not set to an instance of an object
Reply #15 - Mar 26th, 2017 at 2:10pm
Print Post  
i did , and it worked perfectly , thank you for your help .have a good day ( evening for you now ..)
  
Back to top
 
IP Logged
 
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Re: Object reference not set to an instance of an object
Reply #16 - Aug 2nd, 2017 at 6:22pm
Print Post  
i have started to receive this message :
Uploading 'Funky_Control8266-jqm' to 'NodeMCU 1.0 (ESP-12E Module)' using 'COM4'
Uploader started for board NodeMCU 1.0 (ESP-12E Module)
Upload method will be: bootloader
Uploading via Bootloader 
{runtime.tools.esptool.path}\esptool.exe -vv -cd nodemcu -cb 115200 -cp "COM4" -ca 0x00000 -cf IN
El sistema no puede encontrar el archivo especificado

it is similar to a problem we talked in the past, after that i did a clean install of IDE,. 
also i tested to upload using OTA, and it seams to work , no errors during compile or upload , but , the program itself do not get updated !! ,  the program running after upload is the same as before , 
so im lost here , 
appreciate your help as always .

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Object reference not set to an instance of an object
Reply #17 - Aug 2nd, 2017 at 7:13pm
Print Post  
In Visual Micro try opening platform manager > board manager then clicking the re-scan button
  
Back to top
WWW  
IP Logged
 
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Re: Object reference not set to an instance of an object
Reply #18 - Aug 2nd, 2017 at 9:26pm
Print Post  
it seams the problem is how to setup this env variables
"{runtime.tools.esptool.path}\

i have tried  everything on the VM configuration , with no success .
  
Back to top
 
IP Logged
 
GusKar
Junior Member
**
Offline


Posts: 22
Joined: Mar 25th, 2017
Re: Object reference not set to an instance of an object
Reply #19 - Aug 2nd, 2017 at 9:41pm
Print Post  
it is now working , but i have no idea what is the change , so  it will happen again ..
until then ..
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint