Hydra v4.3.5.0 Exception when using R/G/B ports as Y

First time Gadgeteer so I’m not sure about proper procedures but I got my Hydra in the mail yesterday, updated it to the latest boot loader and firmware, and then immediately ran into my first bug.

Using NETMF 4.3 and the Hydra 4.3.5.0 firmware you will get an ArgumentOutOfRangeException if you attempt to use the R/G/B ports with a Y port module (in this case an LED Strip and LED7R). The exception occurs during the constructor of the module so the only work around is to not use those ports for anything but a display.

Using ILSpy and the Hydra’s native code on bitbucket.org I was able to find why the exception was thrown.

The constructor calls FezHydra.EnsureRgbSocketPinsAvailable() which calls GHI.Processor.Display.Disable().

Disable() sets the Display width and height to 0 and then calls Display.Save() which eventually calls over into the native method Display::NativeSetLcdConfiguration(…).

NativeSetLcdConfiguration() has this check:

	if (((Width * Height) > (800 * 600)) || (Width < 64) ||  (Height < 64))
	{
		hr = CLR_E_OUT_OF_RANGE;
		return FALSE;
	}

And since the width and height are 0 here we get the exception.

5 Likes

no comment other than welcome to the forum, and great first post ! :slight_smile:

1 Like

@ rygar31 - Thanks for the detailed investigation, I pushed the fix up to bitbucket if you want to take a look and it will be in our next SDK.