Interesting G120 Bug

Hi!

I just managed to isolate an issue in a G120 application that i’m currently developing. It’s incredibly easy to reproduce. I have tested it on one hand-soldered board and one FEZ Cobra II Wifi, both crashes identically with firmware and loader of version 4.3.6.0:


        public static void Main()
        {
            SerialPort Com1 = new SerialPort("COM1", 9600);
            Com1.Open();

            for (int i = 10; i > 0; i--)
            {
                byte[] text = System.Text.Encoding.UTF8.GetBytes("Killing G120 in " + i + "\r\n");
                Com1.Write(text, 0, text.Length);

                Thread.Sleep(1000);
            }

            WiFiRS9110 _wifi = new WiFiRS9110(SPI.SPI_module.SPI2, G120.P1_10, G120.P2_11, G120.P1_9, 4000);
            if (!_wifi.Opened) _wifi.Open();

            BitConverter.ToString(_wifi.PhysicalAddress);
        }

The output looks like the following:


EXCEPTION 0x06:
  cpsr=0x00000000
  pc  =0xa0306154
  lr  =0x00000000
  sp  =0x1000ac00
  r00 =0x00000000
  r01 =0x00000000
  r02 =0x00000001
  r03 =0x00000000
  r04 =0x00000001
  r05 =0x00000000
  r06 =0xa0306154
  r07 =0x00000000
  r08 =0xa00255d0
  r09 =0xa0024f98
  r10 =0x00000000
  r11 =0x00000000
  r12 =0x00000001

Connecting external power does not seem to make any difference.

1 Like

Excellent bug report. I wish all reports are like this, short and to the point. We will investigate immediately, thanks.

After a little bit more debugging i managed to reduce it to:


            byte[] b = {03, 51, 67, 73, 11, 58, 82};
            BitConverter.ToString(b);

@ cluez - I was able to reproduce it on a few of our boards, but it looks like its an issue in NETMF itself: http://netmf.codeplex.com/workitem/2299

Thanks!

I guess it will be fixed somewhere in .NETMF vNext then. In the meantime this workaround should work:


        public String GetPhysicalAddress()
        {
            String result = String.Empty;
            foreach (byte b in _wifi.PhysicalAddress)
            {
                result += b.ToString("X2") + "-";
            }
            return result.TrimEnd('-');
        }