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 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 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.
-
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.
-
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.
-
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.
- 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