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) Problems with Digispark AtTiny (Read 10947 times)
Lars Ryssel
Newbies
*
Offline


Posts: 4
Joined: Nov 23rd, 2015
Problems with Digispark AtTiny
Nov 23rd, 2015 at 7:34pm
Print Post  
I installed the Digispark bords as shown here using this link http://digistump.com/package_digistump_index.json:

http://digistump.com/wiki/digispark/tutorials/connecting
It’s work fine from the arduino environment, but when I try to compile in Visual Micro I get errors.

My code is the simple blink...:
void setup() {
                           //All pins are capable of Digital output, though P5 is 3 V at HIGH instead of 5 V
                           pinMode(1, OUTPUT); //0 is P0, 1 is P1, 2 is P2, etc. - unlike the analog inputs, for digital outputs the pin number matches.
}
 
void loop() {
                           digitalWrite(1, HIGH); //Turn the pin HIGH (5 V)
                           delay(1000);
                           digitalWrite(1, LOW); //Turn the pin LOW (GND)
                           delay(1000);
}


If I compile for debug I get:
 
Compiling debug version of 'AtTiny' for 'Digispark (Default - 16.5mhz)'
AtTiny.ino:In function 'void setup()
AtTiny.ino:6:70: error: no matching function for call to 'VisualMicroDebug::begin(TinyDebugSerial*, long int)
:void setup() { 
    debugger: The error shown above might be caused by invalid breakpoint syntax?
AtTiny.ino:candidates are
AtTiny.ino:In file included from
VM_DBG.h:begin(HardwareSerial*)
:void begin(HardwareSerial *theSerial)
VM_DBG.h:candidate expects 1 argument, 2 provided
VM_DBG.h:begin(HardwareSerial*, long unsigned int)
:void begin(HardwareSerial *theSerial, unsigned long baud)
VM_DBG.h:no known conversion for argument 1 from 'TinyDebugSerial*' to 'HardwareSerial*
Error compiling project sources
 
If I compile for release i get:
 
Compiling 'AtTiny' for 'Digispark (Default - 16.5mhz)'
Binary sketch size: 650 bytes (used 11% of a 6.012 byte maximum) (0,60 secs)
Uploading to I/O board using 'COM6'
Upload failed. Did you select the correct upload method for this board?
System.NullReferenceException: Object reference not set to an instance of an object.
   at Visual.Micro.MiroAppAPI.debug.AvrdudeUploader.uploadUsingPreferences(String buildPath, String className, Boolean verbose, Boolean ProgrammerUploadUsing, String mcuProgrammerOverrideName)
   at Visual.Micro.MiroAppAPI.SketchEditor.Upload(Boolean verbose)
 
Beside the compilation problems, I don’t know how to select COM port.
 
When compiling and uploading form Arduino, it asks me to connect the AtTiny after compiling:
 
Build options changed, rebuilding all
 
Sketch uses 302 bytes (5%) of program storage space. Maximum is 6,012 bytes.
Global variables use 9 bytes of dynamic memory.
Running Digispark Uploader...
Plug in device now... (will timeout in 60 seconds)

What am I doing wrong?
« Last Edit: Nov 23rd, 2015 at 7:36pm by Lars Ryssel »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with Digispark AtTiny
Reply #1 - Nov 23rd, 2015 at 8:33pm
Print Post  
Thanks for the post. The digispark board uses a different Serial class than standard Arduino boards which is unknown to the debugger. 

Support will be added in the next release and I will post here to confirm when it's available.

In the meantime you can switch the toolbar from "Debug/Local Windows Debugger" to "Release" then compile and upload will work.
  
Back to top
IP Logged
 
Lars Ryssel
Newbies
*
Offline


Posts: 4
Joined: Nov 23rd, 2015
Re: Problems with Digispark AtTiny
Reply #2 - Nov 24th, 2015 at 8:28am
Print Post  
Hi Tim

As I wrote, I did try that, if I compile for release i get:

Compiling 'AtTiny' for 'Digispark (Default - 16.5mhz)'
Binary sketch size: 650 bytes (used 11% of a 6.012 byte maximum) (0,60 secs)
Uploading to I/O board using 'COM6'
Upload failed. Did you select the correct upload method for this board?
System.NullReferenceException: Object reference not set to an instance of an object.
   at Visual.Micro.MiroAppAPI.debug.AvrdudeUploader.uploadUsingPreferences(String buildPath, String className, Boolean verbose, Boolean ProgrammerUploadUsing, String mcuProgrammerOverrideName)
   at Visual.Micro.MiroAppAPI.SketchEditor.Upload(Boolean verbose)

I can't figure out how to deselect the COM port in Visual Studio.

I even tried copying the .ino file to a new empty folder, but Visual Micro remembers that it should use COM6.

I'm using Visual Studio 2015.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with Digispark AtTiny
Reply #3 - Nov 24th, 2015 at 10:39am
Print Post  
Yes the release compile works but upload fails.

I am assuming the digi has a programmer for upload instead of a COM port. 

In that case please confirm you see the required programmer in the programmers list and ensure "Visual Micro>Always upload using programmer" is checked.

How do you upload when using the arduino id? What do you click?
  
Back to top
IP Logged
 
Lars Ryssel
Newbies
*
Offline


Posts: 4
Joined: Nov 23rd, 2015
Re: Problems with Digispark AtTiny
Reply #4 - Nov 24th, 2015 at 1:28pm
Print Post  
I didn't do anything special, but I can see that Arduino selected "AVRISP mkII" as prgrammer when I selected the board from Digispark.

I tried to do as you suggested and select "AVRISP mkII" as programmer and select"Always upload using programmer".

Now I get this error about MCUPreference not found:

Compiling 'AtTiny' for 'Digispark (Default - 16.5mhz)'
Binary sketch size: 650 bytes (used 11% of a 6.012 byte maximum) (0,14 secs)
 
Uploading to I/O board using 'AVRISP mkII'
Error during upload using programmer
MCUPreference property not found: program.pattern
The uploader returned an error
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with Digispark AtTiny
Reply #5 - Nov 24th, 2015 at 6:23pm
Print Post  
Hi, If you do not use "File>Upload using programmer" in the arduino ide then "always upload using programmer" must NOT be checked in Visual Micro. 

I'll try it
« Last Edit: Nov 24th, 2015 at 6:40pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Lars Ryssel
Newbies
*
Offline


Posts: 4
Joined: Nov 23rd, 2015
Re: Problems with Digispark AtTiny
Reply #6 - Nov 24th, 2015 at 7:15pm
Print Post  
I did not use "File>Upload using programmer", it just worked.
If I don't use "always upload using programmer" i get this error:

Compiling 'AtTiny' for 'Digispark (Default - 16.5mhz)'
Binary sketch size: 650 bytes (used 11% of a 6.012 byte maximum) (0,37 secs)
 
Uploading to I/O board using 'USB'
Upload failed. Did you select the correct upload method for this board?
System.NullReferenceException: Object reference not set to an instance of an object.
   at Visual.Micro.MiroAppAPI.debug.AvrdudeUploader.uploadUsingPreferences(String buildPath, String className, Boolean verbose, Boolean ProgrammerUploadUsing, String mcuProgrammerOverrideName)
   at Visual.Micro.MiroAppAPI.SketchEditor.Upload(Boolean verbose)

The error with MCUPreference is also described here:
http://www.visualmicro.com/forums/YaBB.pl?num=1416119668
and here:
http://www.visualmicro.com/forums/YaBB.pl?num=1448307248
but nobody found a solution.
It can be reproduced without having the device connected.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with Digispark AtTiny
Reply #7 - Nov 24th, 2015 at 8:39pm
Print Post  
Thanks I have found the problem and it's certainly causes some confusion.

If you look at the bottom of the programmers menu in the arduino ide you will see an entry for Micronucleus. However you can't use it because it will throw an error. the programmer is a partial definition which is then used by the standard upload system. Eh!! Smiley

Visual micro does not show the Micronuclues programmer because it is ignoring the partial definition. Therefore when the standard upload is invoked an error appears.

I'll look into it over the next few days in the meantime you might be able to use the "File>Preferences>External Editor" checkbox in the arduino ide whch allows the sketch to remain open while being edited in Visual Studio. Allowing upload via the arduino ide.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with Digispark AtTiny
Reply #8 - Dec 14th, 2015 at 3:34am
Print Post  
The latest release hopefully fixes this issue. Please download from "tools>extensions & updates"

For some reason the digiboard has both a bootloader upload tool defined and a programmer (micronucleus) tool defined. Visual Micro defaulted to using the programmer but the digi definitions are only part complete.

The arduino ide used the bootloader and ignored the programmer setting so visual micro now does the same.

+ The debugger should support the TinySerial however the serial is defined to be transmit only, I expect that is because only one pin can be used? Anyway you will need to ensure all your breakpoints are Trace points that are set to continue execution  (no break) otherwise I doubt the debug will work.

Thanks for the report.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint