Is there any method to tell which SoC my C# program is running on? I’m planning on having both the T30 and the iMX6 SoCs used in my product, but I want my program to detect which type of processor the program is running on so it can use the appropriate libraries without having the program crash. I see there is some sort of library called SYS INFO and other functions like cop_getsoc() but I don’t know how to call upon them in c#. I’m even willing to use any kind of return of the BSP version from update.exe, I just need some method of returning some form of processor type to my program.
Insert the following statements into your C# code:
public enum eSoc
{
Soc_None = -1, ///< This special eSoc ID is used internally to mark an invalid value
Soc_PXA270 = 0x11, ///< Marvell PXA270 or PXA270M SoC
Soc_PXA320 = 0x02, ///< Marvell PXA320 SoC
Soc_PXA300 = 0x08, ///< Marvell PXA300 SoC
Soc_PXA310 = 0x09, ///< Marvell PXA310 SoC
Soc_TEGRA2 = 0x411FC09, ///< Nvidia Tegra 2 (T20) Dual Core SoC
Soc_TEGRA3 = 0x412FC09, ///< Nvidia Tegra 3 (T30) Quad Core SoC
Soc_VF50 = 0x00500000, ///< Freescale Vybrid VF50 SoC
Soc_VF61 = 0x00610000, ///< Freescale Vybrid VF61 SoC
Soc_IMX6S = 0x200, ///< Freescale i.MX6 CPU. @todo The i.MX6 ID needs to be adjusted to match with the iMX6 BSP!
Soc_IMX6DL = 0x201, ///< Freescale i.MX6 CPU. @todo The i.MX6 ID needs to be adjusted to match with the iMX6 BSP!
Soc_IMX6D = 0x202, ///< Freescale i.MX6 CPU. @todo The i.MX6 ID needs to be adjusted to match with the iMX6 BSP!
Soc_IMX6Q = 0x203, ///< Freescale i.MX6 CPU. @todo The i.MX6 ID needs to be adjusted to match with the iMX6 BSP!
}
[DllImport("TdxAllLibrariesDll.dll")]
public static extern eSoc Cop_GetSoc();
After this you can call Cop_GetSoc() like we do it in the library demo in C.
Make sure that the library DLL TdxAllLibrariesDll.dll is in your application folder or in \Flashdisk\System\
If you need more native C functions, you can use similar code to make them accessible from C#.