Notifications
Clear all

Seeeduino XIAO  


codecage
(@codecage)
Member Admin
Joined: 2 years ago
Posts: 815
Topic starter  

I took delivery today on a box of three of these tiny processors, and one issue I ran into right away was that I could not print anything with Serial.println() while the code was still running in the Setup{} section of the code.  However, once I dropped into the Loop{} section, everything seemed fine.

SteveG


Quote
frogandtoad
(@frogandtoad)
Honorable Member
Joined: 2 years ago
Posts: 671
 
Posted by: @codecage

I took delivery today on a box of three of these tiny processors, and one issue I ran into right away was that I could not print anything with Serial.println() while the code was still running in the Setup{} section of the code.  However, once I dropped into the Loop{} section, everything seemed fine.

Thanks Steve!

I first saw this little controller on educ8.tv with nick; quite a while back, and I have to say it was impressive!

I'm not sure why you had the problem you noted?

Can you please post the full code that caused your problem? obviously removing any sensitive information in the process, if any?

Hopefully that will help identify where the actual problem is.

Cheers


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 2 years ago
Posts: 815
Topic starter  

@frogandtoad

I found the issue.  And there is a workaround for what I wanted to happen.  It has been my experience on the UNO, Mega, Nano, and maybe others, that when I start the Serial Monitor in the IDE, that this actually seems to reset the Arduino and the board reinitializes.  But this doesn't seem to happen on the XIAO.

I was trying to print the filename and version of the compiled code to the serial monitor while in the setup function.  If the serial monitor was not already open when I uploaded code to the device, the code would have already gotten though the setup function before I could open the serial monitor.  And stopping and starting the serial monitor doesn't seem to 'reset' the XIAO.  There are two work arounds to resolve this.  One is to have the serial monitor already open when you upload code, and the other is to put a delay before what you want to print that is long enough for you to get the serial monitor opened.

SteveG


ReplyQuote
frogandtoad
(@frogandtoad)
Honorable Member
Joined: 2 years ago
Posts: 671
 

@codecage

Thanks, I see what you mean now.... actually, I had wondered for a while whether that was an Arduino bug or not, as it got me thinking that, what if I wanted to connect to the controller to send an ad-hoc serial command?  Does it mean that it has to reboot itself during a critical task it may be performing?

I actually prefer what you're experiencing with the XIAO, and think that should be the correct behavior for the reason I mentioned, but I may be over thinking it - It would be good to hear what people think about this feature.

Posted by: @codecage

There are two work arounds to resolve this.  One is to have the serial monitor already open when you upload code, and the other is to put a delay before what you want to print that is long enough for you to get the serial monitor opened.

...here's a third 🙂

void showVersion() {
  static bool runOnce = true;

  if(runOnce) {
    Serial.println(__FILE__);
    runOnce = false;
   } 
 }

void setup() {
  Serial.begin(9600);
 }

void loop() {
  showVersion();
  
 }

Cheers.


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 2 years ago
Posts: 815
Topic starter  

@frogandtoad

I like that, thanks!

SteveG


ReplyQuote
byron
(@byron)
Reputable Member
Joined: 2 years ago
Posts: 389
 

@codecage @dronebotworkshop 

I got a couple of these boards and had a quick play yesterday.  But I have seeming bricked one already.  I connected the first one to my iMac and found that when it loads a program, and when at the end of loading I get a message in the Arduino compile window that the CPU is restarted, my mac gives the message that the device was not ejected correctly?!?  The program ran OK but when disconnected and then reconnected to the serial port then the board refused to show up as a serial port.   

I tried with a second xiao  and got the same strange message about incorrect ejection, but this time the board could be disconnected and reconnected OK.   The first board still appears to be bricked.   A look on the internet revealed quite a few bricked boards and on the Seeed studio site even a suggested way of unbricking using a Rpi. and some soldering!

So a warning that these boards seem to be buggy and be careful before using them for your more important projects.


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 2 years ago
Posts: 815
Topic starter  

@byron

Thanks for the heads up!

SteveG


ReplyQuote
DroneBot Workshop
(@dronebot-workshop)
Workshop Guru Admin
Joined: 2 years ago
Posts: 842
 
Posted by: @byron

I got a couple of these boards and had a quick play yesterday.  But I have seeming bricked one already.  I connected the first one to my iMac and found that when it loads a program, and when at the end of loading I get a message in the Arduino compile window that the CPU is restarted, my mac gives the message that the device was not ejected correctly?!?  The program ran OK but when disconnected and then reconnected to the serial port then the board refused to show up as a serial port.  

Did you try doing a Reset on the board? I found that in one of my computers I had to constantly reset the XIAO  because the Arduino IDE kept failing to "see" the port, even though it listed it.  On a second computer, I had no problem with the same board.

You could also take the "bricked" one and see if it can use a new bootloader, such as the one for CircuitPython.  Maybe it is still functional.

I also have read about people having issues with the XIAO boards, they are still pretty new so hopefully Seeeduino will release some updates to improve them soon.

😎

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


ReplyQuote
byron
(@byron)
Reputable Member
Joined: 2 years ago
Posts: 389
 
Posted by: @dronebot-workshop

Did you try doing a Reset on the board?

Doh! I did not see a reset button on the board, but your email triggered me to remember you covered this in your video.  And a dupont wire prodded in the right places and I have  a working board again 😀 


ReplyQuote
DroneBot Workshop
(@dronebot-workshop)
Workshop Guru Admin
Joined: 2 years ago
Posts: 842
 
Posted by: @byron

I have  a working board again

Wonderful!

😎

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


ReplyQuote