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.

CCS/msp430F5638: msp430 bsl usb can not swith from CDC to HID

Part Number: MSP430F5638
Other Parts Discussed in Thread: MSP430F5638

Tool/software: Code Composer Studio

Hi supporter,

I try to use BSL USB firmware update package on my device.

MSP430F5638 setup a CDC with com port, it works good with PC host.

MSP430F5638 setup as HID and python interface show ready.....  but if firmware switch from CDC to HID, the python does not show ready.....  it tells 0x2047 and 0x0200 not found/ 

how could firmware switch MSP430F 5638 from CDC to HID? so that the python works.  Do you have MSP430F5638 in CDC mode make python works?  or python work in CDC PI USB.   send me the complete project on MSP430 and on host PC.  only need PC for now.  tested recommitted invoke, it  does not work.  feel like need setup in HID mode foe the USB.  the python works. start USB with anyother mode, it does not work. like example point out CDC, MISE.  

call me at 860-977-7965 if I confuse you.

Louis  

  • by the way, I use IAR work bench, not the CCS tool
  • How exactly is your code trying to switch to the BSL?
  • Switch use follwing code: in usb.c file

    uint8_t usbGetDeviceDescriptor (void)
    {
    usbClearOEP0ByteCount();
    wBytesRemainingOnIEP0 = SIZEOF_DEVICE_DESCRIPTOR;
    #ifdef NON_COMPOSITE_MULTIPLE_INTERFACES
    usbSendDataPacketOnEP0((uint8_t*)usbDeviceDescriptors[activeInterfaceIndex]);
    #else
    if(u8UpdateFimware != 1)
    {
    //u8UpdateFimware = 0;
    usbSendDataPacketOnEP0((uint8_t*)&abromDeviceDescriptor);
    __no_operation();
    }
    else
    {
    //u8UpdateFimware = 0;
    usbSendDataPacketOnEP0((uint8_t*)&abromDeviceDescriptorFw);
    __no_operation();
    }
    // usbSendDataPacketOnEP0((uint8_t*)&abromDeviceDescriptor);
    #endif
    return (FALSE);
    }

    add following in descriptor.c
    USB_PID = 0x0010
    USB_FW_PID = 0x0200

    //uint8_t const abromDeviceDescriptor[SIZEOF_DEVICE_DESCRIPTOR] = {
    uint8_t const abromDeviceDescriptor[SIZEOF_DEVICE_DESCRIPTOR] = {
    SIZEOF_DEVICE_DESCRIPTOR, // Length of this descriptor
    DESC_TYPE_DEVICE, // Type code of this descriptor
    0x00, 0x02, // Release of USB spec
    0x02, // Device's base class code
    0x00, // Device's sub class code
    0x00, // Device's protocol type code
    EP0_PACKET_SIZE, // End point 0's packet size
    USB_VID&0xFF, USB_VID>>8, // Vendor ID for device, TI=0x0451
    // You can order your own VID at www.usb.org"
    USB_PID&0xFF, USB_PID>>8, // Product ID for device,
    // this ID is to only with this example
    VER_FW_L, VER_FW_H, // Revision level of device
    1, // Index of manufacturer name string desc
    2, // Index of product name string desc
    USB_STR_INDEX_SERNUM, // Index of serial number string desc
    1 // Number of configurations supported
    };
    uint8_t const abromDeviceDescriptorFw[SIZEOF_DEVICE_DESCRIPTOR] = {
    SIZEOF_DEVICE_DESCRIPTOR, // Length of this descriptor
    DESC_TYPE_DEVICE, // Type code of this descriptor
    0x00, 0x02, // Release of USB spec
    0x02, // Device's base class code
    0x00, // Device's sub class code
    0x00, // Device's protocol type code
    EP0_PACKET_SIZE, // End point 0's packet size
    USB_VID&0xFF, USB_VID>>8, // Vendor ID for device, TI=0x0451
    // You can order your own VID at www.usb.org"
    USB_FW_PID&0xFF, USB_FW_PID>>8, // Product ID for device,
    // this ID is to only with this example
    VER_FW_L, VER_FW_H, // Revision level of device
    1, // Index of manufacturer name string desc
    2, // Index of product name string desc
    USB_STR_INDEX_SERNUM, // Index of serial number string desc
    1 // Number of configurations supported
    };


    global variable add uint8_t u8UpdateFimware;

    when variable is 0 or 1, debug load image on the msp430F5638, connect to USB, works good. CDC works with GUI, HID work for python, but can not switch from 1 to 0 or 0 to 1 at run time, the switch is controlled by CDC GUI. because python not show ready..... it shows 0x2047 0x0200 not found............. or device manage of control panel,it does not show the CDC comm port.

    hope this helps.

    invoke BSL use instruction in the manual 450 or 317 or 2017

    void updateMainMspFIrmware(void)
    {
    u8Layer2TaskScheduler &= ~UPDATE_MAIN_FIRMWARE;
    u8UpdateFimware = 0;
    __disable_interrupt();
    USBKEYPID = 0x9628; // Unlock USB configuration registers
    #if 0
    USB_connect();
    USB_enable();
    #else
    USB_disconnect(); //PUR high, disable VBUS interrupt
    USB_disable(); //Disable USB module, disable PLL
    #endif
    // USBCNF &= ~PUR_EN; // Set PUR pin to hi-Z, logically disconnect from host
    // USBPWRCTL &= ~VBOFFIE; // Disable VUSBoff interrupt
    USBKEYPID = 0x9600; // Lock USB configuration register
    __delay_cycles(500000);

    //((void (*)())0x1000)(); // Call BSL
    }

    Louis
  • What's with all that commented-out code? Especially the "Call BSL" line?
  • Do you have the USB HID PC driver links? one of my PC does not have driver of HID. or it has yellow mark next to HID sample. and do you have PC CDC driver links? I should get all of the drivers first.

**Attention** This is a public forum