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.

CC2540 USB dongle Windows7 64 driver

Other Parts Discussed in Thread: CC2540

Hi,

I'm having some trouble getting the CC2540 USB dongle to work with BTool. I'm following the instructions in this document http://www.ti.com/lit/ug/swru301a/swru301a.pdf, but the driver shows up not as a serial port, but in the "Cebal controlled devices" section, with no Port indicated.

I have tried manually updating the drivers to the ones provided in C:\Program Files (x86)\Texas Instruments\BLE-CC2540-1.1a\Accessories\Drivers, however I get an error message reading: "The folder you specified doesn't contain a compatible software driver for your device. If the folder contains a driver, make sure it is designed to work with Windows for x64-based systems".

When launching BTool I am greeted with the following error before the UI finishes initializing:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** 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.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5448 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
BTool
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/Texas%20Instruments/BLE-CC2540-1.1a/Projects/BTool/BTool.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5446 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5447 (Win7SP1GDR.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

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

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

If I am using the incorrect driver, where can I get a correct one for Windows 7?
If the driver is correct, how do I go about resolving the BTool exception on startup? 

Thanks and best regards,

Jan

  • A screenshot of the device manager entry for the dongle.

  • You will have to reprogram the dongle with different firmware. The dongle you have is programmed with the packet sniffer firmware (will work as a BLE packet capture device together with SmartRF Packet Sniffer). To use the dongle with BTool, it needs a completely different firmware image.

    The firmware image you need is cc2540_ble1.1_USBdongle_HostTestRelease_Master.hex located in C:\Texas Instruments\BLE-CC2540-1.1a\Accessories\Hex_Files. The file can be programmed on the dongle using the PC tool SmartRF Flash Programmer. Connect the dongle to a CC Debugger or a SmartRF05EB via the debug header and remember to power the dongel separately (can be powered by plugging it in a USB port). in the flash programmer, program the CC2540 as described in the CC2540DK User's Guide, www.ti.com/lit/swru301 , chapter 5.

  • Following the steps outlined in the document, I still don't seem to be able to get a different driver associated with the dongle. I've written up the steps I'm following below; could you please advise as to where I'm going wrong?

    • Connect CC2540 USB dongle to PC via USB connection, to SmartRF05EB via debug header
    • Launch SmartRF Flash programmer. At this point, I have one device listed: "CC2540 SmartRF05EB"
    • Flash with cc2540_ble1.1_USBdongle_HostTestRelease_Master.hex
    • The operation completes successfully, but I end up with both devices still listed in the "Cebal controlled devices" section as "CC2540 USB dongle" and "SmartRF05EB" respectively. (This is after powering both devices off and back on again)

    I feel like there is most likely a fundamental misunderstanding on my side, but I can't seem to figure out from the docs where I'm going wrong. 

  • Hi Jan,

    Can you un-install the driver and then try once more? Maybe try with an CC Debugger this time, if you have one.

    Br

  • Sounds correct. I have made a small document describing the procedure in more detail. Please take a look at the attached document and follow the instructions.

    4505.Reprogramming_CC2540_USB_dongle.pdf

    Hope this helps.

  • Thanks very much for the detailed document and prompt assistance.

    I had used the 'USB debug' port of the EB via the adapter that comes with the dongle; hadn't realised that the adapter was not intended to be used in this case.

  • EDIT: disabling the other serial over bluetooth devices resolves the BTool exception issue. Please let me know if you require further information than is provided here to debug the issue.

    Original post:
    Seems I spoke too soon. With the correct driver now installed, BTool still causes the same exception on startup as detailed in the first post.

    Below is some more context that may help debug it. Please let me know if you'd prefer for me to start a different thread for this issue.

    Serial devices:

    The 'Connect' dialog after acknowledging the exception:

  • So you're saying it is working if you disable both of the other serial devices? That is unexpected.

    I recommend that you start a new thread for this issue.

  • I'm a late-comer to this discussion, but have some of the same issues: My fundamental aim is, with the help of BTool, to use the CC2540 USB Dongle as a slave, hopefully just advertising Generic Access, in the hope that some master (best case, my iPhone 4S) can see it. Chasing this, I'm in for $100 so far, half for the Dongle, and then the other half for the CC Debugger. I managed to connect the Debugger with the Dongle, and start the SmartRF Flash Programmer.

    At this point, out-of-spec things began: (1) There was a warning that "One of the connected Evaluation Boards is running an old version of the firmware", which I'm hoping can be ignored. (2) There was no hex file named "cc2540_ble1.1_USBdongle_HostTestRelease_Master" in the "hexfiles" folder. Instead, the only file with a half-way promising name was "cc2540_usbdongle_hosttestrelease_all.hex". Seeming to have no option, I chose it and the Flash Programmer reported success. If it is the case that "cc2540_usbdongle_hosttestrelease_all.hex" is unacceptable, then what is? If it is acceptable, then the following should be relevant.

    What I'm left with (in an old Dell Latitude, running Windows XP) is a "USB Device" under "Other devices" which can't find a driver. The "Hardware Ids" in its properties are precisely what is in the document "4505.Reprogramming_CC2540_USB_dongle.pdf" (if one ignores case - Vid, Pid & 16aa). I'm no PC expert and so when I read "or update the driver manually", I find myself out of my depth.  How do I do that?

  • Michael Powell said:
    At this point, out-of-spec things began: (1) There was a warning that "One of the connected Evaluation Boards is running an old version of the firmware", which I'm hoping can be ignored. (2) There was no hex file named "cc2540_ble1.1_USBdongle_HostTestRelease_Master" in the "hexfiles" folder. Instead, the only file with a half-way promising name was "cc2540_usbdongle_hosttestrelease_all.hex". Seeming to have no option, I chose it and the Flash Programmer reported success. If it is the case that "cc2540_usbdongle_hosttestrelease_all.hex" is unacceptable, then what is? If it is acceptable, then the following should be relevant.

    (1): This simply means that there is a newer version of the CC Debugger firmware available. I would recommend you to update to the latest version.

    (2): There is a "drivers" folder in the BLE stack installation (same level as the HexFiles folder). Try update driver manually, specify this location to the wizard.

    Br,
    ABO 

  • ABO:

    Thanks. The driver installed fine and BTool sees the Dongle.

    My problem now is to figure out how to tell the Dongle to be a slave (and I'm hoping that the "all" in the hex file name means that's possible), and then to figure out how to get it to advertise a service (Generic Access would be great).

    Any further help would be greatly appreciated.

  • Michael Powell said:
    My problem now is to figure out how to tell the Dongle to be a slave ...

    I've been away on vacation. If you still have this problem, please create a new thread on the forum. This will help keep the E2E forum cleaner and easier to search.

    Br,
    ABO