Community

HelloMeadow Stuck on single color

Hi everyone,

I’m unsure if this is an issue with the operator (i.e. me) or the tooling, but here goes.

I was successful in flashing the OS to the latest available (24 Dec 2019) and created the first default application. Deployed that application to the board and waited for it to run.

The LED pulsed Red, so far so good. but never progressed to Green or Blue; it just keeps pulsing Red.
Commented out the Pulse(Color.Red) line and it pulsed Green once and continuously pulsed Blue.
Commented out the Pulse(Color.Blue) line and added a Pulse(Color.Beige). Green pulsed once and then a Whiteish color pulsed continuously.

Console only shows the one log line for the last color.

Any Ideas?
Rob

Probably you are trying to debug or have unsupported code line after. :smile: I was getting the same when I put debug line in Visual Studio.

Unfortunately that is not the case for me. I made no changes initially to the HelloMeadow code, no breakpoints no debug line.
The same activity is exhibited when the Meadow board is connected only to a power supply (no connection to any PC)

Hey guys,

I have the same behavior on both my Meadows (#15xx and #19xx), running an up to date VS2019, with the Meadow Extension and the Nuget Package installed & updated in the project.

Just installed Firmware 0.3.6 today on both, apparently without problems.

I deployed the test app without changes and it just either hangs on red or sometimes moves to green and then hangs there. Never seen blue yet :cry: Well, in BL mode, ok…

As an added bonus, once it hangs I’m unable to deploy… always get the semaphore timeout.

However I can fix that by resetting the device using the RST button, and being quick enough to press deploy again from VS - within the first few seconds after pressing the RST button. If I take too long and the Meadow runs the app and hangs, I’m unable to deploy again.

Really looking forward to working on this platform! Hoping for hints…

Oh and btw, thanks for shipping my order two months early :smile: That one was unexpected, I was thinking march… I get it guys, software can have bugs, but that was freaking awesome anyway!

Thank you!

Regards


EDIT: Some more notes from debugging.

  1. The deployment thing is entirely consistent. It’s not a “sometimes I can deploy” situation, it’s never after the initial deployment, unless I press the RST button and redeploy quickly enough, then it always works. I think I’ll just try to add that as a pre-deployment action somehow, if I can.

  2. Also, I noticed the LED never actually pulses the first time it’s set - it’s just a static brightness. The second color pulses, indefinitely, it seems.

  3. There seem to be two issues related to the apparent freezing at one color pulsing forever, not sure if the same or separate; a timing issue (or maybe overflow?) and one with a call to _rgbPwmLed.StartPulse() never returning and the loop never looping. To reproduce:

    var timeOut = 300;

    while (true)
    {
    Console.WriteLine(“1”);

     _rgbPwmLed.StartPulse(Color.Green);
    
     Console.WriteLine("2");
    
     Thread.Sleep(timeOut);
    
     Console.WriteLine("3");
    
     _rgbPwmLed.Stop();
    
     Console.WriteLine("4");
    
     Thread.Sleep(timeOut);
    
     Console.WriteLine("5");
    
     _rgbPwmLed.StartPulse(Color.Red);
    
     Console.WriteLine("6");
    
     Thread.Sleep(timeOut);
    
     Console.WriteLine("7");
    
     _rgbPwmLed.Stop();
    
     Console.WriteLine("8");
    
     Thread.Sleep(timeOut);
    

    }

This produces the following console output for me:

 .
 .
 .
 DirectRegisterAccess = True
 .
 1
 2
 3
 4
 5

…and that’s it, it stops there.

However, if I set the timeOut to 3000, it only ever goes up to 2; 3 is never written, well, within the minute or so that I waited for it. In that case, the first color seems to pulse forever, contrary to what it does with the lower timeOut. But I believe it starts out static, then pulses only after ~2-3 seconds.

This is also consistent across multiple deployments and both my Meadows.

Oh and obviously the code above was changed from the original; with the blank meadow project solution deployment I get the following output:

 .
 .
 .
 DirectRegisterAccess = True
 .
 Pulsing [Color: A={1}, R={1}, G={0}, B={0}, Hue={1}, Saturation={1}, Brightness={0.5}]

…and it ends right there and pulses red forever.

  1. It seems to take a really long time to get from console output “1” to the LED actually lighting up, like 2 seconds or more. Not sure if that’s normal?

Hope that helps!


EDIT: Deployment log output before finishing.

1>------ Build started: Project: MeadowApplication2, Configuration: Debug Any CPU ------
1>MeadowApplication2 -> C:\SVN\C#\MeadowApplication2\bin\Debug\net472\App.exe
2>------ Deploy started: Project: MeadowApplication2, Configuration: Debug Any CPU ------
2>Deploying to Meadow on COM3...
2>Initializing Meadow
2>Device  MeadowOS Version: 0.3.6 (Dec 23 2019 14:03:45)
2>Checking files on device (may take several seconds)
2>Found System.dll
2>Found System.Core.dll
2>Found mscorlib.dll
2>Found Meadow.dll
2>Found App.exe
2>Found Meadow.Foundation.dll
2>Writing App.exe
2>Resetting Meadow and starting app (30-60s)

Also, changing the timeOut to 100ms while setting the PulseDuration in the StartPulse() call to 50 makes no difference, still goes up to 5 and never returns.


EDIT: Hm. I played with the code some more. The PulseDuration in the StartPulse() call seems to make a difference after all. If I leave it at the default 600 it times out in between a Thread.Sleep() and a Console.WriteLine() after lighting up the LED. If I set it to 50 I can get two steps further and at least fire off the .Stop() call. Weird…


EDIT: I… got it to work, I… guess… kinda?! I’m able to finally complete multiple loops, change colors, etc. so - yeah. Not sure yet what’s going on. I’ll post more when I know more.


EDIT: Got a “SerialPort cannot be null” message now after some more playing around, deployment failed every time. Restarting VS fixed it.


EDIT: Deploying without resetting works now too since there are no more freezes. More tomorrow hopefully.


EDIT: Probably same issue as here: F7 Micro App Hang.

I’ve learned a lot by now luckily but most importantly: just don’t try to pulse the LEDs. Replace the call to StartPulse() with StartBlink() in the sample project and carry on with what you actually meant to do :wink:

1 Like

Hey Sandor,

Thanks for the work you put in on this; I followed your last edit and change the StartPulse call with the StartBlink call and got it to continue cycling through the colours.
The to be thorougher I change it back and it got stuck after the first pulse. This would seem to indicate an issue within the StartPulse method.

Great work.