G120HDR Gadgeteer programs

@ steenis
I guess he’s off drinking coffee, so I’ll offer my two cents:
He doesn’t know what you’re doing - he is acting like the manufacturer of a mainboard and defining the sockets. When you use the gadgeteer plug-n-play view to attach modules, they use the information he supplied in his definition to see what module can be plugged into which socket.

socket type example:
http://gadgeteer.codeplex.com/wikipage?title=.NET%20Gadgeteer%20Socket%20Types

mainboard definition for Cobra II, which uses the G120:
http://gadgeteer.codeplex.com/SourceControl/latest#Main/Mainboards/GHIElectronics/FEZCobra%20II/Software/FEZCobra%20II/FEZCobra_II_42/FEZCobra_II_42.cs

<edit: the builder’s guide (.pdf) might help with socket types etc.
http://gadgeteer.codeplex.com/releases/view/105388 >

Finished my coffee :smiley:

http://www.ingenuitymicro.com/media/642/G120Hdr-v1.0.2.zip

Another version : socket 3 is the user socket…

Include the source to the module driver (BeamBreaker)

You just tell it what pins you have wired up.

Then instantiate from code:

using System;
using Gadgeteer.Modules.IngenuityMicro;
using Microsoft.SPOT;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using GHI.Hardware.G120;

namespace GadgeteerApp37
{
    public partial class Program
    {
        void ProgramStarted()
        {
            GT.Socket socket = GT.Socket.GetSocket(3, false, null, "");
            socket.CpuPins[3] = Pin.P0_0;

            BeamBreaker beamBreaker = new BeamBreaker(3);
            beamBreaker.BeamBroken += new BeamBreaker.BeamEventHandler(beamBreaker_BeamBroken);
        }

        void beamBreaker_BeamBroken(BeamBreaker sender)
        {
            Debug.Print(DateTime.Now.ToString());
        }
    }
} 

The discussion in post #33 is purely there to help you take drivers for modules and move them back to pure netmf code. Some will be easy, some will not - how easy they are is relative to how experiences you are, as well as how complex the driver is and what it relies on.

@ Justin
@ Lurch
I have a lot to do this evening …

i just did a G120HDR mainboard installer so this should help allot of people with this board
www.ghielectronics.com/community/codeshare/entry/755

Edit:
I just got caught up on the thread and i see Justin was already doing this.
Sorry Justin I did this over the weekend and i din’t read through this thread before i posted.
Good work

@ Justin,

I tried the MulticolorLed again. I could only connect it to 1.SPI, 4.Red, and 6.Blue, nut not to the user socket. I connected it to Blue, because that is also an X-socket. The solution compiled without errors, after uploading it stopped so quickly that I could not see error messages.
Thread.Sleep(20000);
and
Thread.Sleep(Timeout.Infinite);
did not work.

I tried to connect several other modules, but a lot could not be connected at all.

@ steenis - open your output window, any errors?

are you running the latest firmware?

Sorry, that I did not see that, Yes there were errors

Found debugger!
Create TS.
Loading start at a0e856b0, end a0e9ce0c
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0)
Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: Microsoft.SPOT.IO (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0) Attaching deployed file.
Assembly: Gadgeteer (2.42.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Graphics (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net.Security (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Touch (4.2.0.0) Attaching deployed file.
Assembly: System.Http (4.2.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: GadgeteerApp2 (1.0.0.0) Attaching deployed file.
Assembly: System.Net.Security (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.TinyCore (4.2.0.0) Attaching deployed file.
Assembly: System.IO (4.2.0.0) Attaching deployed file.
Assembly: GHI.Premium.System (4.2.10.0) ***********************************************************************

  •                                                                 *
    
  • ERROR!!! Firmware version does not match managed code version!!! *
  •                                                                 *
    
  •                                                                 *
    
  • Invalid native checksum: GHI.Premium.System 0x8AF38F5C!=0xF398D25B *
  •                                                                 *
    

Resolving.
Link failure: some assembly references cannot be resolved!!
Assembly: Gadgeteer (2.42.0.0) needs assembly ‘Microsoft.SPOT.Net’ (4.2.0.0)
Assembly: System.Http (4.2.0.0) needs assembly ‘System’ (4.2.0.0)
Assembly: System.Http (4.2.0.0) needs assembly ‘System.Net.Security’ (4.2.0.0)
Assembly: System (4.2.0.0) needs assembly ‘Microsoft.SPOT.Net’ (4.2.0.0)
Assembly: GadgeteerApp2 (1.0.0.0) needs assembly ‘Gadgeteer’ (2.42.0.0)
Assembly: GadgeteerApp2 (1.0.0.0) needs assembly ‘GTM.GHIElectronics.MulticolorLed’ (1.1.2.0)
Assembly: GadgeteerApp2 (1.0.0.0) needs assembly ‘IngenuityMicro.Gadgeteer.G120Hdr’ (1.0.2.0)
Assembly: System.Net.Security (4.2.0.0) needs assembly ‘System’ (4.2.0.0)
Error: a3000000
Waiting for debug commands…
The program ‘[2] Micro Framework application: Managed’ has exited with code 0 (0x0).

I installed

.NET Micro Framework SDK 4.2 (RTM QFE2)
and
GHI Software Package v4.2 May. 1, 2013
from:
https://www.ghielectronics.com/support/.net-micro-framework
and your driver

Because the G120HDR did not show in VS2010 (prof) I uninstalled everything and reinstalled everything in the the correct order. The installation was different, for instance GHI.Premium.Hardware.G120 has disappeard, also Display_HD44780 has disappeared from the Toolbox.

addendum:
all the missing assemblies are in the reference list.

I am going to bed now, I am too tired. Hope to see you tomorrow.

Pinging says:

Ping… TinyCLR
Connecting to device…G120_G120
Loader (TinyBooter) Version: 4.2.9.0
Firmware (TinyCLR) Version: 4.2.9.0

I see I need 4.2.10.0, how to know
I will try to change the firmware

Updated the firmware. pinging says:
Connecting to device…G120_G120
Loader (TinyBooter) Version: 4.2.9.0
Firmware (TinyCLR) Version: 4.2.10.1

Installed:
.NET Micro Framework SDK 4.2 (RTM QFE2)
GHI NETMF v4.2 and .NET Gadgeteer Package (04-30-2013)
G120Hdr-v1.0.2

I connected the MulticolorLed to Blue.

This still results in this error
ERROR!!! Firmware version does not match managed code version!!! *

This is the output in the output screen:

Found debugger!
Create TS.
Loading start at a0e85768, end a0e9cec4
Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2.0.0)
Assembly: System.Security (4.2.0.0) Loading Deployment Assemblies.
Attaching deployed file.
Assembly: Microsoft.SPOT.IO (4.2.0.0) Attaching deployed file.
Assembly: Gadgeteer (2.42.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Graphics (4.2.0.0) Attaching deployed file.
Assembly: System.Http (4.2.0.0) Attaching deployed file.
Assembly: Gadgeteer.DaisyLink (2.42.0.0) Attaching deployed file.
Assembly: System (4.2.0.0) Attaching deployed file.
Assembly: Microsoft.SPOT.Net.Security (4.2.0.0) Attaching deployed file.
Assembly: GHI.Premium.Hardware (4.2.10.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Touch (4.2.0.0) ***********************************************************************

  •                                                                 *
    
  • ERROR!!! Firmware version does not match managed code version!!! *
  •                                                                 *
    
  •                                                                 *
    
  • Invalid native checksum: Microsoft.SPOT.Touch 0x4940D53E!=0x2D4E2DCC *
  •                                                                 *
    

Resolving.
Link failure: some assembly references cannot be resolved!!
Assembly: Gadgeteer (2.42.0.0) needs assembly ‘Microsoft.SPOT.TinyCore’ (4.2.0.0)
Assembly: Gadgeteer (2.42.0.0) needs assembly ‘Microsoft.SPOT.Net’ (4.2.0.0)
Assembly: Gadgeteer (2.42.0.0) needs assembly ‘System.IO’ (4.2.0.0)
Assembly: System.Http (4.2.0.0) needs assembly ‘System’ (4.2.0.0)
Assembly: System.Http (4.2.0.0) needs assembly ‘System.Net.Security’ (4.2.0.0)
Assembly: Gadgeteer.DaisyLink (2.42.0.0) needs assembly ‘Gadgeteer’ (2.42.0.0)
Assembly: System (4.2.0.0) needs assembly ‘Microsoft.SPOT.Net’ (4.2.0.0)
Assembly: GHI.Premium.Hardware (4.2.10.0) needs assembly ‘GHI.Premium.System’ (4.2.10.0)
Error: a3000000
Waiting for debug commands…
The program ‘[2] Micro Framework application: Managed’ has exited with code 0 (0x0).

I do not know what is wrong

@ steenis - if you check the release notes f or the latest SDK, you will see that you have. a problem with the firmware / tinybooter versions. https://www.ghielectronics.com/docs/40/netmf-4.2-developer

I have to update the tinybooter too ?

@ steenis - yes

Can anybody give me a more comprehensive explanation on how to update the tinybooter. The G120 Developer manual is very unclear about that. From that manual I understand that I have to do something with the buttons LDR0 and LDR1 and then go to the EMX manual. There it becomes blurry: pressing Up and Down and Select and using TeraTerm. Can somebody help me ?

Just quickly, the command about LDR0/LDR1 simply replace the UP/Down buttons.

That should then surface a COM port on your PC. Open Device Manager to find what your COM port is. Then connect via Tera Term to that port.

If you want to ping me I’m online on Skype or Messenger , if you want some help to walk through this?

I am not familiar to Skype or Mess\enger. Can we can go through here, so other people can use this too ?

Sure.

https://www.ghielectronics.com/docs/38/g120hdr-developer#337 says to follow the EMX instructions except for using the LDR0 and LDR1 button to get into bootloader mode.

So connect LDR0 and LDR1 to GND (that’s P2.10 and P0.22 - see the “special pins” section of the above page for more info)

https://www.ghielectronics.com/docs/54/firmware-update-emx is where you next need to take up.

From the section “TinyBooter Update through GHI Boot Loader”, you need to make sure you have Tera Term installed (link in point 2 if you need it).

At this point I always open Device Manager so you can see what COM ports are visible, and what new one appears.

Then connect the device to your PC via USB cable.

Then you should see the new COM port appear in Device Manager - you might be prompted for a driver as mentioned in point 9. The device is then in GHI bootloader mode

edit: If no COM port appears, your LDR0/1 pins haven’t been successful in going into BL mode.

At this point it’s best to remove the LDR0/1 to GND jumpers/wires/switches/whatever you’ve done, so that when the device reboots it’ll come back into normal device mode.

Then start at step 10 - connect Tera Term to the new COM port shown in device manager.

Press b, then B, then V, and see it’s response each time (step 11)

Press E then Y to erase (step 13). Press X, and transfer the tinybooter (the long step 14)

So then you need to re-load the full netmf with mfdeploy.

Hope that helps

Your instructions are very clear, thank you. But it went wrong. In step 14, TeraTerm says:

Filetransfer Fiished Successfully
BL

The G120 did not boot.

The manual says to check if G120_TinyBooter.GHI is not corrupted, How to do that?
I Checked the checkbox 1K.

Do you have any ideas?