GHI Electronics NETMF 2016 SDK Pre-Release 1

[url]https://www.ghielectronics.com/tracker/entry/177[/url]

Oh it is not open and that is why I didn’t see it.

Hi guys,
I need help with updating FEZ Raptor :slight_smile:

I’ve installed G400 Bootloader to Raptor according to this guide https://www.ghielectronics.com/docs/336/g400-bootloader-installation and now I’m trying to update Raptor’s loader but I can’t find any instructions for it. The link for loading the loader at the end of the document (point 11) refers here https://www.ghielectronics.com/docs/344/ghi-bootloader but that is just information about bootloader versions not instructions for loading the loader.

Now Raptor is showed in device manager as GHI Bootloader Interface and I can’t do anything with it. :frowning:
Was anyone successful with loading the loader to FEZ Raptor? How did you do it?

@ miroga - You should be able to do it through FEZ Config, under Advanced > Loader Update in the upper left.

@ John - Thanks for pointing it to me :). I didn’t know it was there :-[.

@ Gary -

NETMF 2016 SDK Pre-Release 1

I loaded it on my Windows 10 Pro. I use Visual Studio 2013 Pro.

Updated my G120E Dev Board 1.2 to 4.3.8.0 and everything went well.
Although I scratched my head a bit wondering why the display was all white…

Then in a moment of brilliance I remembered to set the display with FEZ Config.

Existing code required a few Reference changes but ran as expected.

Just information…

@ willgeorge - it maybe useful for FEZ config to remind users that three configuration is lost, such as display config and network settings.

@ Gus - it would be even better if it gave you the option to backup the config region and reapply it assuming there are no breaking changes… :whistle:

@ networkfusion - you do not have to update the config region. Also, typical commercial applications may use IFU and handle the config as an update step.

Each application is different so we try to keep things generic.

@ Gus - I realise that… I will eventually use ifu without updating the config once I have finished the infrastructure (especially now tiny booter can be done now :dance: ). But, it would still be handy to give the option in fez config…

@ networkfusion - you have the option, just do not load the config file.

Trying to deploy really simple default project to Cobra II Wifi with extender and cellular module connected to socket 8, but fails with:


The thread '<No Name>' (0x2) has exited with code 0 (0x0).
Using mainboard GHI Electronics FEZ Cobra II Eco Extender version Rev B
    #### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) ####
    #### Message: 
    #### Microsoft.SPOT.Hardware.Port::ReservePin [IP: 0000] ####
    #### System.IO.Ports.SerialPort::HandlePinReservations [IP: 0050] ####
    #### System.IO.Ports.SerialPort::Open [IP: 001d] ####
    #### Gadgeteer.Modules.GHIElectronics.CellularRadio::.ctor [IP: 0089] ####
    #### testcandelete.Program::InitializeModules [IP: 0006] ####
A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.dll
    #### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) ####
    #### Message: 
    #### System.IO.Ports.SerialPort::HandlePinReservations [IP: 0093] ####
    #### System.IO.Ports.SerialPort::Open [IP: 001d] ####
    #### Gadgeteer.Modules.GHIElectronics.CellularRadio::.ctor [IP: 0089] ####
    #### testcandelete.Program::InitializeModules [IP: 0006] ####
A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.SerialPort.dll
An unhandled exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.SerialPort.dll

EDIT: Tried with Cobra II Wifi — considering this to be something that I missed about the extender??
EDIT2: Has uninstalled GHI discontinued Modules AND products and re-installed the Beta-release… nothing changed

you can edit your post - probably worth cutting most of the debug info like this one out

[quote]‘Microsoft.SPOT.Debugger.CorDebug.12.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\mscorlib.dll’, Symbols loaded.
[/quote]

@ njbuch - We were able to reproduce the issue but don’t have a work around at this time.

@ njbuch - This should be fixed for the next release.

2 Likes

I got a couple of questions about the IFU for tinybooter:

  • Is it possible to determine the tinybooter version on runtime? Or must tinybooter always be flashed if the firmware version changes?
  • What file contains the tinybooter image? Is it “Loader.ghi”?

@ jjs - Loader.ghi is indeed TinyBooter. I do not believe it is possible to determine the version of TinyBooter from your application. TinyBooter only needs to be flashed when an update is available.

Thank you!

There seems to be a slight issue when trying to load the TinyBooter image in parts (multiple calls to InFieldUpdate.Load()).

  • If multiple types are to be flashed (e.g. Firmware + TinyBooter), there is an InvalidArgument exception thrown when trying to load the second data chunk of TinyBooter. This might be expected behaviour?
  • If only TinyBooter is to be flashed, no exception occurs but the device becomes unresponsive after calling InfieldUpdate.FlashAndReset(). It does not show up in FEZ Config and the application code is not run. It can be reactivated by flashing TinyBooter through FEZ Config.

If the whole TinyBooter image is supplied to InFieldUpdate.Load() in one go, everything seems to work fine.

I am using a FEZ Spider II.

Correct, you should not load few bytes from Firmware, few bytes from tinybooter and come back with firmware.
Once loaded you should load whole file, finish it before jump to another file.

I was not clear about it. Give us some code that has the exception, please?

Do you mean load 10K, then 10K… until end of file that doesn’t work?

[quote]Do you mean load 10K, then 10K… until end of file that doesn’t work? [/quote]Yes, this is exactly what I mean. If I try this I get either the first or second case that I described depending on how I call InFieldUpdate.Initialize (with multiple types or only with InFieldUpdate.Types.TinyBooter).

Edit: Take this sample code, it is just your modified IFU tutorial.

         public const int BLOCK_SIZE = 32768; // <- bock size smaller than the TinyBooter image!

    public static void FlashFirmware()
    {
        // uncomment the next line to get an exception (my first described case)
        InFieldUpdate.Initialize(InFieldUpdate.Types.TinyBooter | InFieldUpdate.Types.Firmware);

        // uncomment the next line to get a non-functional device (second case)
        //InFieldUpdate.Initialize(InFieldUpdate.Types.TinyBooter);

        LoadFile("\\SD\\Loader.ghi", InFieldUpdate.Types.TinyBooter);
        InFieldUpdate.FlashAndReset();
    }

    // this function comes straight from your example
    public static void LoadFile(string filename, InFieldUpdate.Types type)
    {
        using (var stream = new FileStream(filename, FileMode.Open))
        {
            var data = new byte[BLOCK_SIZE];

            for (int i = 0; i < stream.Length / BLOCK_SIZE; i++)
            {
                stream.Read(data, 0, BLOCK_SIZE);
                InFieldUpdate.Load(type, data, BLOCK_SIZE);
            }

            stream.Read(data, 0, (int)stream.Length % BLOCK_SIZE);
            InFieldUpdate.Load(type, data, (int)stream.Length % BLOCK_SIZE);
        }
    }


    void ProgramStarted()
    {
      FlashFirmware();
    }