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.

CC2531 USB HID examples problem

Other Parts Discussed in Thread: CC2531, CC-DEBUGGER, CC2540, CC2511, REMOTI, CC2543, CC2544, SIMPLICITI

Hello,

 

I purchased CC2531 usb dongle and CC-Debugger.. And I couldnt send an ASCII string to PC or get it from PC.

To learn a USB HID example, we have 2 ways:

 

1- CC2531 examples (keyboard and mouse example)

It's ok. ı spent too much time to figure it out how a keyboard example works. At least, I could send "bcdef" to PC. It acted as a keyboard. When I run notepad, it always printed "bcdef" and also my compilers screen ! I erased "bcdef"s in my CC2531 program.

BUT, I converted my descriptor to send "bcdef" characters instead of acting as a keyboard. But it continued acting as a keyboard. 

So, it failed, lets dont waste time anymore and try MSP430 DevPack

 

2- MSP430 DevPack examples

There are lots of useful examples in folders (for HID). But when I want to open them with IAR Embedded it fails. I read html page and saw that there is a version difference. 

I downloaded suitable version of IAR but failure continued.

On the ohter hand, I tried to make a new software using both MSP430 DevPack examples and CC2531 examples. But I couldnt make it. 

 

So, I dont have other eval devices to plug in my CC2531. I want to communicate with my PC using HID interface (not CDC). I want to send simple characters.

Do you have any suggestions? 

Thank you,

 

Onur

  • Hi Onur,

     

    The USB framework on which the HID example is built is a generic framework to support the USB 2.0 Full Speed IP on the CC2531 (and CC2511, and CC2540) dongle(s).

    How the USB host (in this case a PC) will communicate is defined during the enumeration process. During enumeration the USB host will ask for

    Device Descriptor
       -> Configuration Descriptor
          -> Interface Descriptor
             -> Endpoint Descriptor(s) (IN and/or OUT)
             -> HID Descriptor (in the case of HID)
                -> HID Report Descriptor

    In the case of HID, the data sent over USB in operation is defined in the HID Report Descriptors. If you use the HidDongle example in RemoTI 1.2.1 (), the Keyboard Report is defined in
    typedef struct {
        uint8 modifiers;
        uint8 reserved;
        uint8 pKeyCodes[6];
    } KEYBOARD_IN_REPORT

    the key codes to be put in pKeyCodes are found in HUT1_11. These are not ASCHII, but Usage IDs. E.g. 'u' = 24 (or 0x18).

    HID is only one case, CDC is another. The device and the framework is not limited to these overlaying protocols. You can choose this when you build the descriptor, for the example in RemoTI 1.2.1 the descriptors are found written in assembly in C:\Texas Instruments\RemoTI-CC253xDK-1.2.1\Projects\RemoTI\HidDongle\Application\usbclass_hid\usb_hid_descriptor.s51.

     

    Hope this helps,

     

    Torbjorn

  • Hello, 

    I had a source code USB HID for cc2531 but I want to modify code for cc2543. What files I must focus on this and modify?

    Thank

  • Hi Nguyen,

    CC2543 does not support USB. Are you referring to CC2544? In that case the same USB framework is supported by CC2544. The only difference is that CC2544 comes with internal pull up for D+. This means that there is no GPIO to toggle to enable an external pull up on D+.

    So, you must replace the macro HAL_USB_PULLUP_ENABLE() with:

    HAL_USB_PULLUP_ENABLE()         (USBCTRL |= 0x04)

    Please see section 21.2 of www.ti.com/lit/swru283 for more details.

  • Thank you for your guide. In addition, if I also want to use MRFI for cc2543/cc2544, how could I modify BSP and MRFI, I mean that I would like to know information about cc2543/cc2544 such as radio family on SimpliciTI to set up the SmartRF05 board with cc2543.

    Thank

  • Hello Minh Tri,

    The CC2543/44/45 will not be supported for SimpliciTI. One of the main reasons for this is the limited RAM size (1/2 kB). The best way to learn about these devices is to look at the CC254x Proprietary Mode Packet Error Rate Test. The new version (revision B) is completed and is just pending some review before release. I expect it to be available within this or next week.

    BR. Eirik

  • Hello,

    I'm trying to combine Per_test and USB_framwork. I added USB library into per_test program and I encountered the problem. I do not pass the instruction usbHidInit(); and when I debug step by step, the program paused at  return pConfigurationDesc; in file usb_descriptor_parser.c and the error is

    The stack pointer for stack 'IdataStack' (currently IData:0x00) is outside the stack range (IData:0xC0 to IData:0x100)

    Please, help me. I think this is not enough memory on cc2544 to use USB library

**Attention** This is a public forum