SCM20260D thread

Questions and answer around this board.

Known issues: (we will update this post)

  • ???

I have a board based on the old G400D and keen to see if this just plugs in and works.

It does but please try it once you have :nerd_face:

I have a board that I sell commercially based upon the G400D and after getting the SCM20260D firmware updated and the blinky test app running I popped it in my board and it works like a charm. I haven’t tried anything else at this time, but it does run and can be programmed on my board so it looks like I’m ready to start the process of getting the SDIO, LCD, WIFI, USB Host, Ethernet, IO and SPI devices up and running. That will be a big job, but looking forward to it :roll_eyes:

3 Likes

That is the plan. You are welcome :nerd_face:

Quite impressed with this SC20260D module. Running my IPS 7.0" LCD at 1024x600 and 60Mhz clock rate, I ran the camera demo and adjusted to 640 x 480 and it runs about the same frame rate as it did on the 4.3" LCD when I first got the dev unit.

I’ll upload the video later as it is still being processed by Google :frowning:

3 Likes

Ultra short video of camera demo. That’s me in the corner. REM??

2 Likes

Nice video Dave! I’m glad to see the performance increase of the SITCORE chipset. Makes me want to start another project. Problem is: WHAT??? :roll_eyes:

1 Like

It’s is even faster by three folds. Stay tuned for the release coming this week!!

1 Like

dropped from 3.6s to 0.9, likely 4x.

Drawing same code, screen size 166fps on G400 compare to 350fps on SITCORE.

But don’t see much different on camera because the speed is most from camera.

We believe it can be more, just temporary stop at there for other important thing.

That is some incredible performance gain! I’m looking to port a commercial app that I’ve written for NETMF 4.3 to TinyCLR 2.0 and see just how much faster it is on SITCORE. Presently I’m using Glide as my GUI and will continue to use it until I get up to speed with WPF.

Currently we are using G400D but I just learned it will not have direct replacement in the new SC series. Is it possible we get two mounting holes like the Raspberry Pi Compute Module have?


SCM20260D is a drop in replacement http://new-docs.ghielectronics.com/hardware/netmf/upgrade.html

Why do you need these holes? If you are concerned about vibration then you should use SCM20260E or N.

Sorry I actually mean we are using G400S not G400D. My bad.
The fact I am looking at SCM20260D is the ability upgrade to a more powerful module in future with little to none circuit change. The vibration is the initial concern and is why we picked the G400S at the first place.

Then we advice to use the N or E modules

I don’t think vibration is an issue with these SIMM card sockets. I have G400D modules installed on sea vessels and they have survived for about 6 years now without a single failure. If you needed extra security, some of that silicone gunk could be applied at the 2 corners.

2 Likes

I am flagging an issue with serial ports. I am running some simple code that sends a firmware request to an RFID board. I disconnected everything from the board and am just sending the command in a loop. When I look with a scope, the command is sent properly for a while, then just flat lines. If I feel the chip on the module, its pretty hot. I can unplug and let it all cool down. After this, it will again output for a while till it gets hot. If I flash a program that does not use the UART and leave the system powered, nothing it heating up. This is happening regardless of the UART I am using. Could there be something in the UART code putting load on the processor and causing this? Defective module? What are we thinking. I can still talk to the module and use it for other tasks, so there is still progress that can be made, but I use 3 UARTs in my product, so this is the central item I’d like to test.

This is extremely strange as nothing should cause the chip to warm up. can you please disconnect everything and only run a small example that you can share with us?

Here is a simple program. I am midstream developing the RFID, so pay no attention to the errors in the data received event. They aren’t important. If I run this with nothing attached to the board, the chip heats up and after 1-2 min will stop outputting the waveform.

Program:

using System;
using System.Collections;
using System.Text;
using System.Threading;
using IPT.RFIDReader;

    namespace UART_DemoApp
    {
        class Program
        {
            private RFIDReader reader;
            static void Main()
            {

                Program myApplication = new Program();
                myApplication.initialize();
            }

            void initialize()
            {
                CreateRFIDReader();
            }

            private void CreateRFIDReader()
            {
                //"GHIElectronics.TinyCLR.NativeApis.STM32H7.UartController\\7"
                reader = RFIDReader.CreateAndAddress("GHIElectronics.TinyCLR.NativeApis.STM32H7.UartController\\7", "RFID", 19200);

                var select = new RFIDReadFirmware(reader);
                var tag = select.Run();
            }
        }
    }

The RFID Class (stripped down)

using System;
using System.Collections;
using System.Text;
using System.Threading;
using IPT;
using GHIElectronics.TinyCLR.Pins;
using GHIElectronics.TinyCLR.Devices.Uart;

namespace IPT.RFIDReader
{
    public class RFIDReader
    {
        public static RFIDReader CreateAndAddress(string com, string name, int baudRate)
        {
            var newRFIDReader = new RFIDReader();
            int dataBits = 8;
            UartController serialPort = UartController.FromName(com);
            serialPort.SetActiveSettings(baudRate, dataBits, UartParity.None, UartStopBitCount.One, UartHandshake.None);

            newRFIDReader.serialLine.Enable();
            newRFIDReader.name = name;

            newRFIDReader.serialLine.DataReceived += newRFIDReader.SerialLine_DataReceived;

            return newRFIDReader;
        }

        internal readonly byte HEADER = 0xFF;
        internal readonly byte RESERVED = 0x00;
        

        internal UartController serialLine;
        internal object padLock = new object();
        public string name { get; set; }
        internal bool IsSent;
        internal string ReturnString { get; set; }

        internal int TimeOut { get; set; }
        internal int TimeOutInterval { get; set; }

        internal byte[] data;
        byte[] returnData;

        internal byte[] buffer = new byte[1024];


        private void LineReceived(UartController sender, byte[] line)
        {
            //first byte in line is the data count
            int dataBytesCount = line[0];
            //create array of proper size
            byte[] dataBytes = new byte[dataBytesCount];
            //copy to array
            Array.Copy(line, 2, dataBytes, 0, dataBytesCount);


            ReturnString = UTF8Encoding.UTF8.GetString(dataBytes);
            IsSent = true;

            this.serialLine.DataReceived -= this.SerialLine_DataReceived;
            this.serialLine.ClearReadBuffer();
            this.serialLine.ClearWriteBuffer();
        }


        internal void SerialLine_DataReceived(UartController sender, DataReceivedEventArgs e)
        {
            UartController reader = (UartController)sender;
            
            //clear the read buffer
            Array.Clear(buffer, 0, buffer.Length);

            //read new data
            int read = reader.Read(buffer, 0, reader.BytesToRead);
            data = new byte[read];
            //copy read bytes into local array with correct size
            Array.Copy(buffer, 0, data, 0, read);

            //if not a full response, return
            if(data.Length <5)
            {
                return;
            }

            //if framing character isnt present
            int headerIndex = Array.IndexOf(data, HEADER);


            if (headerIndex == -1)
            {
                return;
            }

            returnData = new byte[data.Length - (headerIndex + 2)];
            //get return data
            Array.Copy(data, headerIndex + 2, returnData, 0, data.Length - (headerIndex + 2));


            LineReceived(reader, returnData);
        }

        private byte[] checksum(byte[] command)
        {
            byte xorsum = 0x00;
            for (int i = 1; i < command.Length; i++)
            {
                xorsum += command[i];
            }

            byte[] xsummedcommand = new byte[command.Length + 1];
            command.CopyTo(xsummedcommand, 0);
            xsummedcommand[xsummedcommand.Length - 1] = xorsum;

            return xsummedcommand;
        }

        internal void SendLine(byte[] command)
        {
            byte[] xsummedCommand = checksum(command);
            lock(padLock)
            {

                serialLine.Write(xsummedCommand, 0, xsummedCommand.Length);

            }

            Thread.Sleep(100);
        }


    }

    #region Exceptions
    public class RFIDReaderException : Exception
    {
        public RFIDReaderException()
        {

        }
        public RFIDReaderException(string message)
            : base(message)
        {

        }

        public RFIDReaderException(string message, Exception inner)
            : base(message, inner)
        {

        }
    }
    #endregion

    public abstract class Event
    {
        protected byte[] command;
        protected RFIDReader reader;

        protected Event(RFIDReader reader)
        {
            this.reader = reader;
        }

        //protected SSResponse response = SSResponse.CreateEmpty();
    }

    public abstract class FastEvent : Event
    {
        public FastEvent(RFIDReader reader)
            : base(reader) { }

        public void Send(byte[] command)
        {
            reader.serialLine.DataReceived += reader.SerialLine_DataReceived;

            lock(reader.padLock)
            {
                int counter = 0;
                reader.IsSent = false;

                while(!reader.IsSent)
                {
                    reader.SendLine(command);
                    Thread.Sleep(reader.TimeOutInterval);
                    counter += reader.TimeOutInterval;

                    if(counter>= reader.TimeOut)
                    {
                        //throw new RFIDReaderException("Timed out while sending command: " + Encoding.UTF8.GetString(command));
                    }
                }
            }
        }

    }

    public class RFIDReadFirmware : FastEvent, Ievent
    {
        public RFIDReadFirmware(RFIDReader reader)
            : base(reader)
        {
            // {Header, reserved, length (command + data), Command, Data, CSUM
            command = new byte[] { reader.HEADER, reader.RESERVED, 0x01, 0x81 };
        }

        public object Run()
        {
            try
            {
                Send(command);
            }
            catch (RFIDReaderException ex)
            {
                //response.ID = "RFIDReadFirmware" + reader.name;
                //response.Status = SSResponse.CreateError();
                //response.Value = ex.Message;
                //return response;
            }

            //response.ID = "RFIDReadFirmware" + reader.name;
            //response.Status = SSResponse.CreateSuccess();
            //return response;
            return new object();
        }
    }

    public interface Ievent
    {
        object Run();
    }
}

@Phil_C How long before you see your issue?

I am running the following code on a SC20260D Dev board with a Windows app sending a random string at 10ms interval and the SC sending back the sent string. It has been running without issue for 10mins+ with the SITCore processor getting barely warm.

I will leave it running to see what happens.

using System;
using System.Collections;
using System.Diagnostics;
using System.Text;
using System.Threading;
using GHIElectronics.TinyCLR.Devices.Uart;
using GHIElectronics.TinyCLR.Pins;

namespace UartTest
{
    class Program
    {
        private static UartController myUart;
        private static byte[] txBuffer;
        private static byte[] rxBuffer;
        static void Main()
        {

            myUart = UartController.FromName(SC20260.UartPort.Usart1);
            myUart.SetActiveSettings(115200, 8, UartParity.None, UartStopBitCount.One,UartHandshake.None);
            myUart.Enable();
            myUart.DataReceived += MyUart_DataReceived;

            Thread.Sleep(Timeout.Infinite);
        }
        private static void MyUart_DataReceived(UartController sender, DataReceivedEventArgs e)
        {
            rxBuffer = new byte[e.Count];
            var bytesReceived = myUart.Read(rxBuffer, 0, e.Count);
            Debug.WriteLine(Encoding.UTF8.GetString(rxBuffer, 0, bytesReceived));
            myUart.Write(rxBuffer, 0, rxBuffer.Length);
        }
    }
}