G400D development board - Nav Buttons not working in samples

Hey guys,

So, i got a G400 development board and started playing around with the netmf 4.3 samples.
I was able to deploy the samples and eventually get them to work, like the touch calibration sample (which is needed).

I ran into the issue that the HardwareProvider class was not returning the correct ID that referenced the left button.


            // Use the hardware provider to get the pins.  If the left pin is 
            // not set, assume none of the pins are set and set the left pin 
            // back to the default emulator value.
            if ((pinLeft = hwProvider.GetButtonPins(Button.VK_LEFT)) ==
                Cpu.Pin.GPIO_NONE)
                pinLeft = Cpu.Pin.GPIO_Pin0;
            else
            {
                pinRight = hwProvider.GetButtonPins(Button.VK_RIGHT);
                pinUp = hwProvider.GetButtonPins(Button.VK_UP);
                pinSelect = hwProvider.GetButtonPins(Button.VK_SELECT);
                pinDown = hwProvider.GetButtonPins(Button.VK_DOWN);
            }

Specifically the

 calls are returning pins that are not mapped to the buttons located on the development board. Are there any changes (beside hard coding the pins) that can be done to correctly report these values, or does this require a firmware update?

Those examples are made for the emulator. You need to change the hardware provider pins to match the board. The pin numbers are printed right on the board.

Still, most examples will not work without minor changes. I suggest starting with the netmf book on the support page.

Looking at the old code from ChipworkX graphic demo, the exact same code is in there as well. (I was working through porting the demo to 4.3)

It looks up the pins for the VK_Up from the Hardware Provider class, which apparently can have customisations done some how, see [url]Microsoft Learn: Build skills that open doors in your career

In fact, the sample code states, the emulator will not set these pins and the sample code implements a default of GPIO_Pin0 through GPIO_Pin5 (set prior to the code i included above)