Releasing the NETMF and Gadgeteer Package 2014 R3!

@ Mr. John Smith - All in good time, :smiley: and trust me the last thing we need laying around the office is cupcakes! lol

@ andre.m - yeah, there are only a few more things to determine internally before talking about with insiders.

I think we are not at the same page… I took one of our other development PC’s and installed R3 with default settings, no changes to option. De system had GHI 2014-R2 (GHI SDK 4.2 & 4.3) and MS MF SDK 3.0 - 4.3 installed. Our solutions (plain netmf) are developed in VS2010 but are also editable/compilable in VS2012. After installing 2014-R3 (and the same happened with R2) MS MF SDK 4.2 is de-installed.
Also the solution can’t be loaded anymore in VS2010 after installing R3.
Of coarse i can reinstall MS 4.2 to get things running but the installer should not destroy what was running.

@ RobvanSchelven - The NETMF 4.2 SDK is uninstalled because it is not supported side-by-side with ours and Microsoft’s current SDKs. VS2010 is not supported in the latest Micro Framework release either. In order to facilitate supported and functional upgrades for existing 4.2 users, we uninstall the 4.2 NETMF SDK.

If installing the NETMF 4.2 SDK after you install our SDK works for you, that is fine, but it is not supported by us and our installer will keep uninstalling it.

@ John - Ok, thanks for explaining.

@ John - Does this apply to the MS NETMF SDK 4.1 as well?
I would like to use the latest firmware and SDK on Cobra 1, but still need to use 4.1 on Panda II.

@ jasdev - After installing 2014 R3, you should be able to install our 4.1 SDK just fine. It will use the 4.1 assemblies in the NETMF 4.3 QFE 1 SDK. Since 2010 is not supported anymore, you will likely lose the templates found in 4.1.

Ok, thanks!

@ jasdev - If you have 4.1 already installed your solution/project it is no way effected by 2014-R3, just checked …

Just tested FEZConfig without installing it (and without my registry hack :smiley: )
Works as expected, thank you :clap:

First experiments with the usb-host on the cerbuinobee were not very succesfull:
The examples for usb-mass storage and usb-mouse/keyboard as shown at:
https://www.ghielectronics.com/docs/36/usb-host
did not work properly:

  • plugging in a usb mass storage device ( a memory stick) resulted in an exception (Hresult -1) on the mount statement…A usb-drive was not recognised at all (or is this a feature?)

  • keyboard/mouse: both devices were recognised, but no data is received

I reinstalled all the software, but had no effect…

@ freeck - maybe a power issue. Did you try to plug a power pack to your board?

@ Gus - yes I did, but had no effect…
on a second Cerbuino same result…

Hello,

We just ran test again, keyboard, mouse work OK.
USB 4G,8G, 16G MicroCenter. 8 and 16 work fine while 4 failed when writing.

Code below is all in one, usb drive, mouse, key board, usb serial, joystick…
And, when run code in VS, can you please hit Reset button to make sure all are reset, please.

using System;
using System.IO;
using System.Threading;
using GHI.Processor;
using GHI.Usb;
using GHI.Usb.Host;
using GHI.IO;
using GHI.IO.Storage;
using Microsoft.SPOT;
using Microsoft.SPOT.IO;
using Microsoft.SPOT.Hardware;

namespace Test_USBH
{
    public class Program
    {
        static OutputPort led = new OutputPort((Cpu.Pin)(0 * 16 + 2), true); // PA2 - pin 4 - socket 2
        static InputPort button = new InputPort((Cpu.Pin)(0 * 16 + 6), false, Port.ResistorMode.PullUp); // PA6 pin 3 socket 2 

      


        static Boolean testWrite = true;
       
        static GHI.Usb.Host.MassStorage ps;
        public static void Main()
        {
          
            led.Write(true);
            
            int i=0; 
            int ii= 0;
            while (button.Read()==true ) 
            
            {
               
                Thread.Sleep(100);
                led.Write(true);
                Thread.Sleep(100);
                led.Write(!true);
               
            }
            Debug.Print("Starting test...");
            RemovableMedia.Insert += new InsertEventHandler(RemovableMedia_Insert);
            RemovableMedia.Eject += new EjectEventHandler(RemovableMedia_Eject);
            GHI.Usb.Host.Controller.MassStorageConnected += Controller_MassStorageConnected;
            GHI.Usb.Host.Controller.MouseConnected += Controller_MouseConnected;            
            GHI.Usb.Host.Controller.KeyboardConnected += Controller_KeyboardConnected;
            GHI.Usb.Host.Controller.JoystickConnected += Controller_JoystickConnected;
            GHI.Usb.Host.Controller.UsbSerialConnected += Controller_UsbSerialConnected;
            GHI.Usb.Host.Controller.Start();


            led.Write(!true);
            const int BLOCK_LEN = 1024;
            const int BLOCK_COUNT_WRITE = 1000; // 1M
            const int BLOCK_COUNT_READ = 100;
            byte[] bufferwrite = new byte[BLOCK_LEN];
            for (i = 0; i < BLOCK_LEN; i++)
            {
                bufferwrite[i] = (byte)(i % 0xFF);
            }
            Thread.Sleep(2000);
            while (true)
            {
                Thread.Sleep(100);
                if (button.Read()== false)
                {
                    Debug.Print("Collelect info....");
                    VolumeInfo vol = VolumeInfo.GetVolumes()[0];
                    Debug.Print("Get volume....");
                    Debug.Print("Please wait for formating..");
                    //vol.Format("FAT", 0);
                    Debug.Print("Formated.");
                    string root =  vol.RootDirectory;
                    Debug.Print("root = " + root);
                    Debug.Print("lable = " + vol.VolumeLabel);
                    Debug.Print("size = " + vol.TotalSize);
        
                    if (testWrite )
                    {
                       
                        Debug.Print(" Open fs...");
                        FileStream fswrite = new FileStream(root + @ "\tester1.txt", FileMode.Create);
                        Debug.Print(" start write...");
                        while (button.Read() == true)
                        {
                            Thread.Sleep(1000);
                        }
                        for (i = 0; i < BLOCK_COUNT_WRITE; i++)
                        {

                            Debug.Print("Write block " + i + " passed.");
                            try
                            {
                                fswrite.Write(bufferwrite, 0, BLOCK_LEN);
                            }
                            catch (Exception ex)
                            {

                                throw new Exception("Write error at: " + " block count " + i);
                                                                                    
                            }
                        }
                        Debug.Print(" Close file...");
                        fswrite.Close();
                        fswrite.Dispose();
                        fswrite = null;

                        FileStream fswrite2 = new FileStream(root + @ "\tester2.txt", FileMode.Create);
                        fswrite2.Write(bufferwrite, 0, BLOCK_LEN);
                        fswrite2.Close();
                        fswrite2.Dispose();
                        fswrite2 = null;

                   

                        canWrite = false;
                        Debug.Print("Write done");
                        led.Write(true);
                        // test Read
                        FileStream fsread = new FileStream(root + @ "\tester1.txt", FileMode.Open);
                        byte[] readdata = new byte[BLOCK_LEN];

                        for (i = 0; i < BLOCK_COUNT_READ; i++)
                        {
                            if (BLOCK_LEN != fsread.Read(readdata, 0, BLOCK_LEN))
                            {
                                throw new Exception("Can not read!");
                            }
                            else
                            {
                                for (ii = 0; ii < BLOCK_LEN; ii++)
                                {
                                    if (readdata[ii] != bufferwrite[ii])
                                    {
                                        throw new Exception("Read error at: " + " block count " + i + ", len :" + ii);
                                    }
                                }
                                Debug.Print("Read block " + i + " passed.");
                                
                            }
                        }
                        Debug.Print("Read total " + (i * BLOCK_LEN  + ii) + " bytes passed.");
                        fsread.Close();
                        fsread.Dispose();
                        fsread = null;
                        ps.Unmount();
                        break;

                    }
                }

            }
            Thread.Sleep(-1);
        }

        static void Controller_UsbSerialConnected(object sender, UsbSerial e)
        {
            Debug.Print("UsbSerial connected...");
            e.DataReceived += e_DataReceived;
        }

        static void e_DataReceived(UsbSerial sender, UsbSerial.DataReceivedEventArgs e)
        {
            Debug.Print(" data received:" + e.Data[0]);
            for (int i = 0; i < 10; i++)
            {
                sender.Write((byte)((byte)'A' + i));
            }

        }

        static void Controller_JoystickConnected(object sender, Joystick e)
        {
            Debug.Print("Joystick connected...");
            e.ButtonChanged += (a, b) => Debug.Print(b.State.ToString() + " " + b.Which);
            e.Disconnected += (a, b) => Debug.Print("Joystick disconnected.");
        }

        static void e_Disconnected(BaseDevice sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        static void Controller_KeyboardConnected(object sender, Keyboard e)
        {
            Debug.Print("Keyboard connected...");
            e.KeyUp += (a, b) => Debug.Print("U " + b.Which.ToString());
            e.KeyDown += (a, b) => Debug.Print("D " + b.Which.ToString());
            e.Disconnected += (a, b) => Debug.Print("Keyboard disconnected.");

        }

        static void Controller_MouseConnected(object sender, Mouse e)
        {
            
            Debug.Print("Mouse connected...");
            e.ButtonChanged += (a, b) => Debug.Print(b.State.ToString() + " " + b.Which);
            e.CursorMoved += (a, b) => Debug.Print(b.Delta.ToString() + " " + b.NewPosition.ToString());
            e.WheelMoved += (a, b) => Debug.Print(b.Delta.ToString() + " " + b.NewPosition.ToString());
            e.Disconnected += (a, b) => Debug.Print("Mouse disconnected.");
        }

        static void e_CursorMoved(Mouse sender, Mouse.CursorMovedEventArgs e)
        {
            
        }

        static void Controller_MassStorageConnected(object sender, MassStorage e)
        {
            Debug.Print("Thumb drive connected...");
            ps = e;
            ps.Mount();
            Debug.Print("Thumb drive mounted...");
            ps.Disconnected += (a, b) => { Debug.Print("Thumb drive disconnected."); ps.Dispose(); };
        }

       

        static void Controller_DeviceConnectFailed()
        {
            Debug.Print("Device disconnected...");
            //Debug.Print("ID: " + device.ID + ", Interface: " +
            //         device.INTERFACE_INDEX + ", Type: " + device.TYPE);
        }

       

        static void mouse_CursorMoved(Mouse sender, Mouse.CursorMovedEventArgs e)
        {
            Debug.Print(" X = " + e.Delta.X);
            Debug.Print(" Y = " + e.Delta.Y);

        }

        static void keyb_KeyDown(Keyboard sender, Keyboard.KeyboardEventArgs args)
        {
            Debug.Print("" + args.ASCII.ToString());
        }

        static void RemovableMedia_Eject(object sender, MediaEventArgs e)
        {
            canWrite = false;
        }
        static bool canWrite= false;
        static void RemovableMedia_Insert(object sender, MediaEventArgs e)
        {
            canWrite = true;
        }
    }
}

Dat,

Same exception on mount().

@ freeck -

try without VS?

And do mouse and keyboard work?

With VS:
Mouse and keyboard connect/ disconnect event detected, but stil no data from both.

After a RESET and without VS: Mount error…

Transfered my problem with usb host to a new topic: https://www.ghielectronics.com/community/forum/topic?id=16761

It’s a bit too early to say it for sure, but it seems I have alot less problems with USB, even with BuiltIn ethernet. God I hate to say this, but… Good job guys! :hand:

3 Likes

@ Simon from Vilnius - this seriously made me laugh hard. You hate to say to say good job :slight_smile:

Thank you and from now on it is all improving. No new features our major updated until all is perfect, like it was in 4.1.

By the way PPP if mostly working now. We should have a beta in couple weeks.

5 Likes

This is the best news for a long time! Remember to leverage the testers that volunteered last time you asked.
:dance:

1 Like