Windows CE CAN

Why I cannot read message from CAN under Window CE 8?
Here is sample of my program

class Program
    static gpio.uIo _canRx = new gpio.uIo((ushort)63, (ushort)gpio.tIoType.ioColibriPin);
    static gpio.uIo _canTx = new gpio.uIo((ushort)55, (ushort)gpio.tIoType.ioColibriPin);
    static IntPtr hCan;
    static IntPtr _gpio;
    static can.tCanMsg tmsg = new can.tCanMsg();
    static void Main(string[] args)
        _gpio = gpio.Gpio_Init(null);
        if (_gpio == null)
        if (!gpio.Gpio_Open(_gpio))
        hCan = can.Can_Init("CAN1");
        if (hCan == null)
        can.Can_SetConfigInt(hCan, "ioRx", _canRx.GenericDefinition, TdxCommon.ParamStorageType.StoreVolatile);
        can.Can_SetConfigInt(hCan, "ioTx", _canTx.GenericDefinition, TdxCommon.ParamStorageType.StoreVolatile);
        can.Can_SetConfigInt(hCan, "BitRateHz", 125000, TdxCommon.ParamStorageType.StoreVolatile);
        can.Can_SetConfigString(hCan, "Implementation", "FlexCAN", TdxCommon.ParamStorageType.StoreVolatile);
        can.Can_SetConfigString(hCan, "FilterFrameFormat", "Extended", TdxCommon.ParamStorageType.StoreVolatile);
        //can.Can_SetConfigString(hCan, "FilterRemote", "none", TdxCommon.ParamStorageType.StoreVolatile);
        //can.Can_SetConfigString(hCan, "RtrFormat", "data", TdxCommon.ParamStorageType.StoreVolatile);
        //can.Can_SetConfigInt(hCan, "FilterID", 0x00, TdxCommon.ParamStorageType.StoreVolatile);
        //can.Can_SetConfigInt(hCan, "FilterMask", 0x00, TdxCommon.ParamStorageType.StoreVolatile);
        //can.Can_SetConfigInt(hCan, "SingleThread", 0, TdxCommon.ParamStorageType.StoreVolatile);

        if (!can.Can_Open(hCan))

        TdxCommon.tVersion version = new TdxCommon.tVersion();
        can.Can_GetVersion(ref version);

        while (true)
            can.tCanMsg _msgWrite1 = new can.tCanMsg();
            _msgWrite1.dataLen = 8;
   = 0x90;
   = new char[] { (char)2, (char)0, (char)1, (char)0, (char)0, (char)0, (char)0, (char)0 };
            IntPtr _canWrite1Buff = Marshal.AllocHGlobal(Marshal.SizeOf(_msgWrite1));
            can.Can_Write(hCan, _canWrite1Buff, _msgWrite1.dataLen);

            can.tCanMsg _msgRead2 = new can.tCanMsg();
   = 0x90;
            _msgRead2.dataLen = 8;
   = new char[8];
            IntPtr _canRead2Buff = Marshal.AllocHGlobal(Marshal.SizeOf(_msgRead2));
            Marshal.StructureToPtr(_msgRead2, _canRead2Buff, false);
            //IntPtr _canRead2Buff = Marshal.AllocHGlobal(Marshal.SizeOf(_msgRead2));
            can.Can_SetConfigInt(hCan, "Timeout", 200, TdxCommon.ParamStorageType.StoreVolatile);

            Debug.WriteLine(can.Can_Read(hCan, _canRead2Buff, 8).ToString());


We use colibry iMX6 with Iris carrier board and Windows CE 2013 OS. I conneted CAN TX (55) with CAN RX(63), so I expect some kind of ECHO.
Bud Debug output looks like
1,0,0,0,0… First data is present since if (!can.Can_Open(hCan)) line in code. I see with osciloscope that data is beeing send. So why I dont receive nothing?


I guess you are using v2.1 release toradex ce libraries.

Did you try our default Can_Demo application?

Did you loopback Can_Tx to Can_Rx internally?

Is there termination resistor placed on TX and RX?

Could you please share other CAN controller interface details?

Refer this documentation : for How-to.