This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BTool problem - crashes on startup?

Other Parts Discussed in Thread: CC2540

Not sure if this is the right forum - but I can't get Btool to run so I can test out the basics of my CC2540 Mini DevKit - BTool crashes immediately with a complaint about comparing arrays - from the dump below I suspect it's trying to build/sort some COM port list?

************** Exception Text **************
System.InvalidOperationException: Failed to compare two elements in the array. ---> System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at BTool.CommSelectForm.<SortComPorts>b__0(String strA, String strB)
   at System.Array.FunctorComparer`1.Compare(T x, T y)
   at System.Collections.Generic.ArraySortHelper`1.SwapIfGreaterWithItems(T[] keys, IComparer`1 comparer, Int32 a, Int32 b)
   at System.Collections.Generic.ArraySortHelper`1.QuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer)
   at System.Collections.Generic.GenericArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
   --- End of inner exception stack trace ---
   at System.Collections.Generic.GenericArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
   at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer`1 comparer)
   at System.Array.Sort[T](T[] array, IComparer`1 comparer)
   at System.Array.Sort[T](T[] array, Comparison`1 comparison)
   at BTool.CommSelectForm.SortComPorts(String[] rgstrPorts)
   at BTool.CommSelectForm.commSelect_FormLoad(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()

(Note: if I hit "Continue" I do get a COM port dialog box which is empty (unpopulated)).  Is there a newer version of BTool?

I'm using MS Vista Ultimate 32-bit - fully loaded machine with all the other TI software (Flash programmer, USB drivers etc) working fine.  All .NET frameworks installed etc.

The BTLE USB dongle is on COM19 and opens fine with other terminal software.

 

 

  • Wow.

    I would think it should be something related to .NET versions but as you say, all versions are installed. Perhaps you are trying to open BTool while the USB dongle port is already opened by another terminal software (from TI or not).

    This tool from Microsoft can help you determine this just "fuser" does in a Linux environment (lists which process is using a serial port or file).

    http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

    Please let me know your progress, your question seems interesting :)

  • There is a problem with BTool and the internal Windows Bluetooth stack.There is a bug when the Bluetooth stack generates Bluetooth COM Ports and saves them in the registry - I've seen this bug from XP SP2, right through to even the latest Win7 stack. You'll notice the problem in some applications when you have random characters at the end of the COM Port name. The actual bug is really stupid - the Bluetooth stack doesn't end the COM Port names with a null terminator \0.

    The way I fix it to get BTool working (temporarily, until the Bluetooth stack has been restarted), is either disable my internal Bluetooth (using the hardware button on my laptop - which unfortunately disables the internal WiFi too) or alternatively fix the problem in the registry.

    To fix the problem in the registry:

      - Load up regedit and go to HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM

     - If you right click on any of the bluetooth com ports (they are named as '\Device\BthModem') and go to Modify Binary Data, you'll see the bug:

      - To fix the easy way, I double click on each Bluetooth COM Port to edit it in text mode, and then click OK to save. Regedit will then re-save the values with the proper Null terminator. Or even quicker, click on the first Bluetooth COM Port, hit enter twice, push down key, hit enter twice, etc.

    TI, take note, if we had access to the BTool source, its something that could really easily be fixed (so it handles them properly and not crash) with a couple lines of code!

    Hope this helps.

    Regards,
    Simon.

     

  • Hello,

    I filed a ticket with our tools team to look into this issue. Thank you for bringing this to our attention.

    BR,

    -Greg

  • I am running XP SP3 (Japanese version) and am basically getting the same problem, BUT I CAN'T GET AROUND IT.

    i.e. : Get an exception at startup ...  hit "Continue" I do get a COM port dialog box which is empty (unpopulated).

    I have checked the registry settings but in my case all the ports have correct NULL NULL terminations.

    The virtual comport for the CC2540 COM45 can be used with the HeathDemo (http://processors.wiki.ti.com/index.php/Category:HealthDemo) which points to some enumeration quirk in the BTOOL code.

    Just for reference, here is the exception dump from my computer.

    Karel

    Just-In-Time (JIT) デバッグを呼び出すための詳細については、
    ダイアログ ボックスではなく、このメッセージの最後を参照してください。

    ************** 例外テキスト **************
    System.InvalidOperationException: 配列にある 2 つの要素を比較できませんでした。 ---> System.FormatException: 入力文字列の形式が正しくありません。
       場所 System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
       場所 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
       場所 BTool.CommSelectForm.<SortComPorts>b__0(String strA, String strB)
       場所 System.Array.FunctorComparer`1.Compare(T x, T y)
       場所 System.Collections.Generic.ArraySortHelper`1.SwapIfGreaterWithItems(T[] keys, IComparer`1 comparer, Int32 a, Int32 b)
       場所 System.Collections.Generic.ArraySortHelper`1.QuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer)
       場所 System.Collections.Generic.GenericArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
       --- 内部例外スタック トレースの終わり ---
       場所 System.Collections.Generic.GenericArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
       場所 System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer`1 comparer)
       場所 System.Array.Sort[T](T[] array, IComparer`1 comparer)
       場所 System.Array.Sort[T](T[] array, Comparison`1 comparison)
       場所 BTool.CommSelectForm.SortComPorts(String[] rgstrPorts)
       場所 BTool.CommSelectForm.commSelect_FormLoad(Object sender, EventArgs e)
       場所 System.Windows.Forms.Form.OnLoad(EventArgs e)
       場所 System.Windows.Forms.Form.OnCreateControl()
       場所 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       場所 System.Windows.Forms.Control.CreateControl()
       場所 System.Windows.Forms.Control.WmShowWindow(Message& m)
       場所 System.Windows.Forms.Control.WndProc(Message& m)
       場所 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       場所 System.Windows.Forms.ContainerControl.WndProc(Message& m)
       場所 System.Windows.Forms.Form.WmShowWindow(Message& m)
       場所 System.Windows.Forms.Form.WndProc(Message& m)
       場所 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       場所 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       場所 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** 読み込まれたアセンブリ **************
    mscorlib
        アセンブリ バージョン: 2.0.0.0
        Win32 バージョン: 2.0.50727.3625 (GDR.050727-3600)
        コードベース: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    BTool
        アセンブリ バージョン: 1.0.0.0
        Win32 バージョン: 1.0.0.0
        コードベース: file:///C:/Texas%20Instruments/BLE-CC2540-1.1a/Projects/BTool/BTool.exe
    ----------------------------------------
    System.Windows.Forms
        アセンブリ バージョン: 2.0.0.0
        Win32 バージョン: 2.0.50727.3623 (GDR.050727-3600)
        コードベース: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
        アセンブリ バージョン: 2.0.0.0
        Win32 バージョン: 2.0.50727.3624 (GDR.050727-3600)
        コードベース: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
        アセンブリ バージョン: 2.0.0.0
        Win32 バージョン: 2.0.50727.3053 (netfxsp.050727-3000)
        コードベース: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Windows.Forms.resources
        アセンブリ バージョン: 2.0.0.0
        Win32 バージョン: 2.0.50727.3053 (netfxsp.050727-3000)
        コードベース: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_ja_b77a5c561934e089/System.Windows.Forms.resources.dll
    ----------------------------------------
    mscorlib.resources
        アセンブリ バージョン: 2.0.0.0
        Win32 バージョン: 2.0.50727.3625 (GDR.050727-3600)
        コードベース: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------

    ************** JIT デバッグ **************
    Just-In-Time (JIT) デバッグを有効にするには、このアプリケーション、
    またはコンピュータ (machine.config) の構成ファイルの jitDebugging
    値を system.windows.forms セクションで設定しなければなりません。
    アプリケーションはまた、デバッグを有効にしてコンパイルされなければ
    なりません。

    例:

    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>

    JIT デバッグが有効なときは、このダイアログ ボックスで処理するよりも、
    ハンドルされていない例外はすべてコンピュータに登録された
    JIT デバッガに設定されなければなりません。