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 SAMD21 'SerialUSB' was not declared in this scope in Debug (Read 3415 times)
Martin Boissonneault
Newbies
*
Offline


Posts: 6
Location: near Montreal, Quebec, Canada
Joined: Sep 19th, 2018
SAMD21 'SerialUSB' was not declared in this scope in Debug
Sep 20th, 2018 at 1:19am
Print Post  
Hi!
  On my Adafruit Metro M0 Express (ATSAMD21G18A) I keep getting
Code
Select All
BlinkWithoutDelay.ino: 46:57: error: 'SerialUSB' was not declared in this scope 

while building in Debug configuration. The code compiles and runs correctly while in Release configuration. 

  I was trying to follow: https://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging-Walkthrough-1.htm...

  I have attached the compiler output in verbose modes and the project.

  Should the #include be <Arduino.h> ??? The Adafruit SAMD core uses Arduino.h I think es\arduino\Arduino.h). I tried to add it to the example but it still failed to compile with the same error. 

Here is the .cpp code created by vMicro from the .ino:
Code (C++)
Select All
#include <arduino.h>
#line 1 "C:\\Users\\Martin\\Documents\\Arduino\\My Examples\\BlinkWithoutDelay\\BlinkWithoutDelay.ino"
#line 1 "C:\\Users\\Martin\\Documents\\Arduino\\My Examples\\BlinkWithoutDelay\\BlinkWithoutDelay.ino"

 #include <VM_DBG.h>

//
//

#line 32 "C:\\Users\\Martin\\Documents\\Arduino\\My Examples\\BlinkWithoutDelay\\BlinkWithoutDelay.ino"
unsigned long __VisualMicro_DEBUG_1_HITCOUNTER__=0L;bool __VisualMicro_DEBUG_1_HITCOUNTER___COMPLETE=0;unsigned long __VisualMicro_DEBUG_1_GLastMillis__=0L;

const int ledPin =  LED_BUILTIN;

int ledState = LOW;

unsigned long previousMillis = 0;

const long interval = 1000;

void setup() { MicroDebug.init(3000); MicroDebug.begin(&SerialUSB,115200);if (MicroDebug.outPacketStart(true)) {MicroDebug.outPacketEnd();} MicroDebug.start(false,true);

pinMode(ledPin, OUTPUT);
}

void loop() {if (millis()>0 || millis()>1) {__VisualMicro_DEBUG_1_GLastMillis__=MicroDebug.DBG_Millis();if ( __VisualMicro_DEBUG_1_GLastMillis__<__VisualMicro_DEBUG_1_HITCOUNTER__ ){__VisualMicro_DEBUG_1_HITCOUNTER__=__VisualMicro_DEBUG_1_GLastMillis__;}if   ) { g.OnBreakPointBegin(500);if (MicroDebug.outPacketStart(true)) ketEnd();}MicroDebug.DBG_YieldAndWait(5);MicroDebug.OnBreakPointEnd();}}

unsigned long currentMillis = millis();

if (currentMillis - previousMillis >= interval) {

previousMillis = currentMillis;

if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}

digitalWrite(ledPin, ledState);
}
}
 



Thanks! The extension is great!

Martin Boissonneault
near Montreal, Quebec, Canada
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: SAMD21 'SerialUSB' was not declared in this scope in Debug
Reply #1 - Sep 30th, 2018 at 7:57pm
Print Post  
Resolved in the next release thanks
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint