Jump to content
43oh

LaunchPad OSX USB drivers (CDC /VCP)


Recommended Posts

  • Replies 88
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hi All,   Soucre code is hosted on Google code. http://code.google.com/p/msp430lpcdc/   Here is the latest link to the Driver. - Version 1.0.3b http://code.google.com/p/msp430lpcdc/do ... g&

Finally mashed together a complete set of code to use as base, using mostly apple's code.   Current status.   The KEXT attached nicely to interface, with a BSD TTY port exposed. on the first look

Got a good working commit today, but need to press connect and disconnect a few times to get it to work. Next is clean up, since we know what device we are dealing with, I will remove all unnecessary

Posted Images

Got a good working commit today, but need to press connect and disconnect a few times to get it to work.

Next is clean up, since we know what device we are dealing with, I will remove all unnecessary code etc.

 

A shot of the Terminal with real time data from my Energy Harvesting kit.

6190953075_fea80bf137_b.jpg

 

Attached nicely to the USB interface

 

6191412482_d6bf53d241_o.jpg

 

as a BSD port

 

6191412534_9f14a09957_o.jpg

Looking through your old posts trying to figure out why serial driver isn't working (with Mavericks). What Terminal program is this a screenshot of? Looks good. 

Link to post
Share on other sites
  • 4 weeks later...

Hello. Does this driver work with the MSP430F5529 LaunchPad? 

 

I programmed the LaunchPad with Energia on a PC, and it currently works when connected via USB to a Mac running Mavericks, apparently with the built-in USB/serial driver. My software (XTension Home Automation package) recognizes it as an Arduino and receives data OK. 

 

The problem is I have to unplug and replug the USB cable after a system restart to get it to be recognized. 

Link to post
Share on other sites

Hello. Does this driver work with the MSP430F5529 LaunchPad? 

 

I programmed the LaunchPad with Energia on a PC, and it currently works when connected via USB to a Mac running Mavericks, apparently with the built-in USB/serial driver. My software (XTension Home Automation package) recognizes it as an Arduino and receives data OK. 

 

The problem is I have to unplug and replug the USB cable after a system restart to get it to be recognized. 

I have done a ton of work on TI MSP430 USB myself, there are indeed some bugs in the TI USB firmware stack.  I've fixed the bugs myself, but you can try this workaround (code below) for their buggy stack.  Put it right where usb_init() is called in the TI C code.  In particular, the TI USB stack does not notify the host that it is restarting, which is why you need to unplug and re-plug the cable.

usb_init();
usb_disconnect();        //disconnect USB first: you can remove this with fixed driver

//See if we're already attached physically to USB, and if so, connect to it.
//Normally applications don't invoke the event handlers, but this is an exception.
if (USBPWRCTL & USBBGVBV){
    usbevt_vbuson();
}

Disclaimer: function nomenclature might be slightly different than that in TI source.  But, it should make sense.

Link to post
Share on other sites

I have done a ton of work on TI MSP430 USB myself, there are indeed some bugs in the TI USB firmware stack.  I've fixed the bugs myself, but you can try this workaround (code below) for their buggy stack.  Put it right where usb_init() is called in the TI C code.  In particular, the TI USB stack does not notify the host that it is restarting, which is why you need to unplug and re-plug the cable.

usb_init();
usb_disconnect();        //disconnect USB first: you can remove this with fixed driver

//See if we're already attached physically to USB, and if so, connect to it.
//Normally applications don't invoke the event handlers, but this is an exception.
if (USBPWRCTL & USBBGVBV){
    usbevt_vbuson();
}

Disclaimer: function nomenclature might be slightly different than that in TI source.  But, it should make sense.

Thanks very much. But as I'm new and fairly ignorant, I don't see how to apply your advice. Here is my entire setup routine: 

 

void setup() {
  Serial.begin(9600);  // Initialize serial port
  pinMode(PUSH2, INPUT_PULLUP);     // Hold button 2 to quit
  
  pinMode(GREEN_LED, OUTPUT);  // added by GRL
  pinMode(RED_LED, OUTPUT);    // added by GRL
  
  Wire.begin();      // initialize I2C that connects to sensor
 
  mySensor.begin();  // Initialize AM2302 (DHT22) humidity sensor
  PSensor.begin();   // Initalize BMP085 pressure sensor (GRL inserted)
  
  Serial.println("AM2302 & BMP085 sensors initialized");  // GRL modified
  Serial.println("Press & hold LaunchPad user button 2 to end");  // GRL modified
}
 
Can you tell me what I need to do? This code works on the F5529 LaunchPad, with built-in USB hub and 2 virtual serial ports. As you can see, I have no call to usb_init(). 
Link to post
Share on other sites

You would need to recompile the C library.  Energia is built on C libraries.  Before your setup() function ever runs, there are library functions that ran.

OK, I'm sort of flailing around here. I found the functions USB_init() and USB_disconnect() in the usb.c file in Energia's \hardware\msp430\libraries\USBSerial\ folder. Am I on the right track? 

 

Assuming I am, i guess now I have to find the initialization code that calls these functions so I can make your patch and try to recompile. Any pointers appreciated. 

Link to post
Share on other sites

I have done a ton of work on TI MSP430 USB myself, there are indeed some bugs in the TI USB firmware stack.  I've fixed the bugs myself, but you can try this workaround (code below) for their buggy stack.  Put it right where usb_init() is called in the TI C code.  In particular, the TI USB stack does not notify the host that it is restarting, which is why you need to unplug and re-plug the cable.

usb_init();
usb_disconnect();        //disconnect USB first: you can remove this with fixed driver

//See if we're already attached physically to USB, and if so, connect to it.
//Normally applications don't invoke the event handlers, but this is an exception.
if (USBPWRCTL & USBBGVBV){
    usbevt_vbuson();
}

Disclaimer: function nomenclature might be slightly different than that in TI source.  But, it should make sense.

OK, in the "different nomenclature" department, is it possible that what you're calling "usbevt_vbuson" is the function "USB_handleVbusOnEvent()" that I found in \hardware\msp430\libraries\USBSerial\usbEventHandling.c? 

 

Still haven't found the initialization routine that's calling these handlers. 

Link to post
Share on other sites

Ok, I finally found what seems to be the relevant section of initialization code, in the USBSerial.cpp file. Here it is: 

 

//
// Public methods
//


void USBSerial::begin()
{
    __disable_interrupt();                           //Enable interrupts globally
    //Initialization of clock module
    if (USB_PLL_XT == 2){
#if defined (__MSP430F552x) || defined (__MSP430F550x)
P5SEL |= 0x0C;                                      //enable XT2 pins for F5529
#elif defined (__MSP430F563x_F663x)
P7SEL |= 0x0C;
#endif


        XT2_Start(XT2DRIVE_0);                                          //Start the "USB crystal"
    } 
else {
#if defined (__MSP430F552x) || defined (__MSP430F550x)
P5SEL |= 0x10;                                      //enable XT1 pins
#endif


        XT1_Start(XT1DRIVE_0);                                          //Start the "USB crystal"
    }


    USB_init();                 //Init USB


    //Enable various USB event handling routines
    USB_setEnabledEvents(kUSB_allUsbEvents);




    // See if we're already attached physically to USB, and if so, connect to it
    // Normally applications don't invoke the event handlers, but this is an exception.
    if (USB_connectionInfo() & kUSB_vbusPresent)
      USB_handleVbusOnEvent();
    __enable_interrupt();                           //Enable interrupts globally
}

Could you possibly explain exactly how to insert your patch in here (assuming this is the right section of code)? 

(Just as a reminder, it's the MSP430F5529 LaunchPad I'm using.) 

 

Thanks for any assistance. 

Link to post
Share on other sites
  • 3 weeks later...

Perhaps you could answer one question for me. I can't be sure, but maybe your patch (above) consists simply of inserting

usb_disconnect() immediately after usb_init(). 

 

Assuming that's so, please note that the code I quote above has the following as its next line, coming before the section about "See if we're already attached physically to USB": 

 

    //Enable various USB event handling routines
    USB_setEnabledEvents(kUSB_allUsbEvents);

 
That being the case, is it likely that your workaround will still work? 
Link to post
Share on other sites
  • 11 months later...

Hi,

 

I have been using the MSP430LPCDC 1.0.3b for some time but now it has stopped working for me. It was working on 10.10.1 but now is not recognizing either my Launchpad or my Connected Launchpad - no device files are created. Reinstalling it didn't help.

 

It seemed to stop working when I updated my Prolific PL2303 and FTDI device drivers.

 

I don't know how to debug this problem. There is very little documentation on this driver or even how the VCP connections work.

 

Any suggestions?

Bob Rice

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...