BitConverter & EMX fault

Hello GHI!

We have an error with module EMX and BitConverter on the latest firmware (R5).
Try to reproduce it, please see source bellow:


using System;
using Microsoft.SPOT;
namespace MFConsoleApplication1
{
    public class Program
    {
        public static void Main()
        {
            float f = 100.101f;
            byte[] buf = BitConverter.GetBytes(f); // 182 51 200 66
            byte[] buf2 = new byte[17] { 0, 0, 0, 0, 0, 0, 0, 182, 51, 200, 66, 0, 0, 0, 0, 0, 0 };
            f = BitConverter.ToSingle(buf, 0); // Correct
            Debug.Print(f.ToString());
            f = BitConverter.ToSingle(buf2, 7); // Wrong in EMX, correct in Emulator & G120
            Debug.Print(f.ToString());
        }
    }
}

@ 4egod - There are some issues with non-aligned access using BitConverter. See my comment in https://netmf.codeplex.com/workitem/2288

Why am I not seen this before :slight_smile: and we tortured RS485 line :slight_smile: Thanks.