UART Problem In fez spider Main board

in this Mainboard I have try all UART socket but no UART Responding. in other Mainboard it works perfectly . so how to solve this problem? any suggestion plz reply as soon as possible.

Tell us more. Show your code.

@ Architect -
this is serial data recevied event it calls when data recive. second mainboard it works perfect but in this mainboard it not responding.


  public void OnSerialDataRcv(object sender, SerialDataReceivedEventArgs e)
        {
            int buffLen = 0;

            if (e.EventType == SerialData.Chars)
            {
            
                buffLen = UART.BytesToRead;

                read_count = UART.Read(rx_byte, 0, buffLen);

                for (j = 0; j <= buffLen - 1; j++)
                {
                    // ReadByte = Convert.ToChar(rx_byte[j]);
                    ReadByte = rx_byte[j];
                    if (start == false)
                    {
                        if (ReadByte == START_BYTE)
                        {
                            dt[count] = ReadByte;
                            //dt[count] = ReadByte;
                            count++;
                            start = true;
                        }
                    }
                    else
                    {
                        dt[count] = ReadByte;
                        count++;
                    }

                    if (count == g_PACKET_LENGTH)
                    {
                        long chkSum;
                        long finalChkSum;
                        chkSum = 0;
                        finalChkSum = 0;
                        bFirstPacketRcvd = true;

                        for (i = 0; i <= g_PACKET_LENGTH - 2; i++)
                        {
                            chkSum = finalChkSum + dt[i];
                            if (chkSum > 255)
                            {
                                finalChkSum = chkSum - 256;
                            }
                            else
                            {
                                finalChkSum = chkSum;
                            }
                        }

                        if (dt[1] == 0)
                        {
                            if (finalChkSum + dt[g_PACKET_LENGTH - 1] == 256)
                            {
                                if (m_status != int.MaxValue)
                                {
                                    m_status++;
                                }
                                else
                                {
                                    m_status = 0;
                                }
                                SetupUI();
                                j = buffLen + 1;

                                count = 0;
                                start = false;
                            }
                            else
                            {
                                count = 0;
                                start = false;
                            }
                        }

                        else
                        {
                            count = 0;
                            start = false;
                        }

                    }
                }
            }
        }



How and where do you create UART. How do you subscribe to the event? Remember port has to be opened first.

@ Architect - port is open. and UART called on program started function.


   void ProgramStarted()
        {


            UART = new SerialPort("COM1", 19200, Parity.Mark, 8, StopBits.One);
            UART.Handshake = Handshake.None;
            UART.Open();

            showglidedisplay();

            UART.DataReceived+= new SerialDataReceivedEventHandler(OnSerialDataRcv);
            UART.ErrorReceived += new SerialErrorReceivedEventHandler(UART_ErrorReceived);

            rx_byte = new byte[10000];

           
            //thrTimer = new Thread(new ThreadStart(timer_Tick));
            //thrTimer.Priority = ThreadPriority.Highest;
            //thrTimer.Start();

            thrcurve = new Thread(new ThreadStart(drawgraph));
            thrcurve.Priority = ThreadPriority.Highest;
            thrcurve.Start();

            //showKeyboard();
            //thrKeyboard = new Thread(new ThreadStart(key_hit));
            //thrKeyboard.Priority = ThreadPriority.Normal;
            //thrKeyboard.Start();

            for (int c = 0; c < 29; c++)
            {
                skewpoint[c].X = 0;
                skewpoint[c].Y = 0;
            }
            for (int d = 0; d < 29; d++)
            {
                bowpoint[d].X = 0;
                bowpoint[d].Y = 0;
            }

            GT.Timer skewbowgraph = new GT.Timer(60000);
            skewbowgraph.Tick += new GT.Timer.TickEventHandler(skewbowgraph_Tick);
            skewbowgraph.Start();
           
        }

Are both of your mainboards Spiders or is the other one different? If they are the same can you confirm they are both on the same firmware version?

I think OnSerialDataRcv() consumes a lot of time to execute. Event must exit as fast as possible.

@ ianlee74 -
both mainboard are same

@ Joe - no this code work perfect on second mainboard

@ ianlee74 -
how can i check firmware version? both mainboard are same one is working fine but second is not.

Check “Device Capabilities” in MFDeploy.

@ ianlee74 -
when i am ping in MF deploy i get the answer Pinging… TinyCLR.


HalSystemInfo.halVersion:               4.1.2821.0
HalSystemInfo.halVendorInfo:            Microsoft Copyright (C) Microsoft Corporation.  All rig
HalSystemInfo.oemCode:                  255
HalSystemInfo.modelCode:                0
HalSystemInfo.skuCode:                  65535
HalSystemInfo.moduleSerialNumber:       FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
HalSystemInfo.systemSerialNumber:       FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
ClrInfo.clrVersion:                     4.1.2821.0
ClrInfo.clrVendorInfo:                  Microsoft Copyright (C) Microsoft Corporation.  All rig
ClrInfo.targetFrameworkVersion:         4.1.2821.0
SolutionReleaseInfo.solutionVersion:    4.1.8.0
SolutionReleaseInfo.solutionVendorInfo: GHI Electronics, LLC
SoftwareVersion.BuildDate:              Dec 22 2011
SoftwareVersion.CompilerVersion:        410561
FloatingPoint:                          True
SourceLevelDebugging:                   True
ThreadCreateEx:                         True
LCD.Width:                              800
LCD.Height:                             480
LCD.BitsPerPixel:                       16
AppDomains:                             True
ExceptionFilters:                       True
IncrementalDeployment:                  True
SoftReboot:                             True
Profiling:                              False
ProfilingAllocations:                   False
ProfilingCalls:                         False
IsUnknown:                              False


now what i can i do?

Biren, you have TWO of the devices, you need to show us BOTH the MFDeploy outputs, and tell us which one is from the working and which from the failing one.

What SDK version do you have installed? Please open the readme in the program files ghielectronics netmf4.1 directory and confirm what version is listed as the EMX version.

If you have two devices is there any chance you have two PCs with different SDKs installed as well?

@ Brett - this is first mainboard output show in mf deploy


 Microsoft.SPOT.Net.Security,4.1.2821.0
    Microsoft.SPOT.Touch,4.1.2821.0
    GHIElectronics.NETMF.USBClient,4.1.8.0
    GHIElectronics.NETMF.Glide,0.1.0.4
    Microsoft.SPOT.Net,4.1.2821.0
    System.Net.Security,4.1.2821.0
    GHIElectronics.Gadgeteer.FEZSpider,4.1.2.0
    Microsoft.SPOT.Hardware.SerialPort,4.1.2821.0
    Gadgeteer.WebClient,2.41.0.0
    GTM.GHIElectronics.Display_T35,4.1.2.0
    GHIElectronics.NETMF.IO,4.1.8.0
    System,4.1.2821.0
    GTM.GHIElectronics.Button,4.1.1.0
    GHIElectronics.NETMF.Hardware.EMX,4.1.8.0
    GHIElectronics.NETMF.Hardware,4.1.8.0
    System.Xml,4.1.2821.0
    System.Http,4.1.2821.0
    GadgeteerApp1,1.0.0.0
    Microsoft.SPOT.TinyCore,4.1.2821.0
    Microsoft.SPOT.Hardware.Usb,4.1.2821.0
    System.IO,4.1.2821.0
    Microsoft.SPOT.Hardware,4.1.2821.0
    GHIElectronics.NETMF.System,4.1.8.0
    Microsoft.SPOT.Graphics,4.1.2821.0
    Microsoft.SPOT.IO,4.1.2821.0
    GTM.GHIElectronics.UsbClientDP,4.1.1.0
    Gadgeteer,2.41.0.0


@ Brett - this is second mainboard output show in mf deploy.


 mscorlib,4.1.2821.0
    Microsoft.SPOT.Native,4.1.2821.0
    Gadgeteer.WebServer,2.41.0.0
    GTM.GHIElectronics.RS232,4.1.0.0
    Microsoft.SPOT.Net.Security,4.1.2821.0
    Microsoft.SPOT.Touch,4.1.2821.0
    GHIElectronics.NETMF.USBClient,4.1.8.0
    GHIElectronics.NETMF.Glide,0.1.0.4
    GTM.GHIElectronics.Display_CP7,1.0.0.0
    Microsoft.SPOT.Net,4.1.2821.0
    System.Net.Security,4.1.2821.0
    GHIElectronics.Gadgeteer.FEZSpider,4.1.2.0
    Microsoft.SPOT.Hardware.SerialPort,4.1.2821.0
    Gadgeteer.WebClient,2.41.0.0
    GHIElectronics.NETMF.IO,4.1.8.0
    System,4.1.2821.0
    GHIElectronics.NETMF.Hardware.EMX,4.1.8.0
    GHIElectronics.NETMF.Hardware,4.1.8.0
    System.Xml,4.1.2821.0
    System.Http,4.1.2821.0
    GadgeteerApp1,1.0.0.0
    Microsoft.SPOT.TinyCore,4.1.2821.0
    Microsoft.SPOT.Hardware.Usb,4.1.2821.0
    System.IO,4.1.2821.0
    Microsoft.SPOT.Hardware,4.1.2821.0
    GHIElectronics.NETMF.System,4.1.8.0
    Microsoft.SPOT.Graphics,4.1.2821.0
    Microsoft.SPOT.IO,4.1.2821.0
    GTM.GHIElectronics.UsbClientDP,4.1.1.0
    Gadgeteer,2.41.0.0


It’s interesting that those lists aren’t the same. I would reapply the same firmware on both boards.