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.

Sample code for MSP430F5659

Other Parts Discussed in Thread: MSP430F5659, MSP-FET, MSP-EXP430F5529LP, MSP430USBDEVPACK, MSP430F5529

Hi

I have installed the CCS v6 latest version. I want to start with some sample project for the MSP430F5659, I have the TI's board and FET tool to start with, but not finding the any sample project in CCS setup folder. Please help me in finding the sample project.

One more thing i have the node license how to update that for CCS?

Nitesh

  • Hi Nitesh!

    Sample programs can be downloaded here.

    Nitesh Padiyar52 said:
    One more thing i have the node license how to update that for CCS?

    Which update do you mean? General updates for CCS? No problem with a node locked license. If CCS does not ask you to update it, you can start checking for updates under HELP -> CHECK FOR UPDATES.

    Dennis

  • I have the node license but on installation i did not any license update window, so i asked whether i need to do the license update or not. Compiler window shows "free license" on the bottom left corner.
    One more thing while doing first compilation using latest CCS v6.1.1 it was taking compiler version Ti v4.4.5 in in project->build setting , whether i need to change that latest compiler version? If so where i can find the path?

    Nitesh
  • If you have a license file, select HELP -> CODE COMPOSER STUDIO LICENSING INFORMATION -> UPGRADE and follow the steps it leads you through. My compiler setting is TI v4.4.6
  • Thanks for the sharing info.

    I would like to know where i can find the compiler version change path? first time i am configuring compiling the code using CCS 6.1.1.

    Nitesh

  • I am using new MSP-TS430PZ100USB target board with internal power. I am able to compile using CCS 6.1.1 and but not able to connect to target using MSP-FET tool, getting error as given below.

    MSP430: Error connecting to the target: Unknown device

    Please let me know how to resolve this.
  • Nitesh Padiyar52 said:
    I would like to know where i can find the compiler version change path?

    It can be changed under PROJECT -> PROPERTIES

  • Thanks for the support. I am able to up my board and it running. Now i am looking for the serial debugging message for my application. Any idea for printing debugging message on PC using any application using USB port of the target board.
  • If you're using the MSP-EXP430F5529LP, you will have a virtual COM port in your device manager which is the application UART of the LaunchPad. You can use that to communicate with the PC.

    Dennis

  • I am using MSP-TS430PZ100USB board.
  • Ah OK, just saw you wrote that already. Your CPU has USB functionality, so you could establish a connection to the PC by adding some external components to your MCU and configure the MSP to act as a CDC device (COM-port). Here is a helpful document.

    Or you can use one of those UART<->USB converters, like the UM232 or a similar cable/adapter.

  • You mean for CDC support we need extra components. It wont work on USB directly on either end?
  • Wait...you're using the new black MSP-FET? It has a built-in backchannel UART for communication between PC and MSP.

  • Read this document, chapter 5.6 - but I have never used it myself so far.

    The following picture shows the used pins of the 14-pin JTAG connector:

    For UART, use pin 12 and 14.

  • YES using new Black FET Tool.
  • Then use one USCIs from your MSP and configure it as UART (example programs are available on the product website for the controller) and connect those pins to pin 12 and 14 of the FET. The device manager shows the COM port that was assigned to the backchannel (application) UART.

  • Good one, but we planned to use USB direct between PC and Our target board ( similar to MSP target board- USB in built) . How we can achieve this, which device class i need to use to establish the communication?
    As per your suggestion we don't need USB on our device side. I am confused since i trying USB first time.
  • This depends on your application. Have a look into the document I linked in. It shows the standard components for USB on a MSP430 and it also describes different device classes. Furthermore it lists helpful additional software provided by TI to not start from zero.

    To exchange data between the MSP and the PC, CDC might be your device class.

  • knows much about it, I guess. I'm not that experienced in the built-in USB of the MSPs and I do not want to tell you wrong things.

  • ok thanks, If you come across any thing, just let me know. By the way i have generated the descriptor files for CDC, Do you know how to use them with the application? Please guide me.
  • No, sorry. At this point I'm out. I think I saw answering USB driver related things as well. Maybe she can also help you.

    Edit: Just saw you already noticed that yourself :)

    Dennis

  • Hi Nitesh,

    It sounds like you want to use the USB port on the MSP-TS430PZ100USB board to do some USB CDC communication with your computer. There are a number of USB examples already included in the MSP430 USB Developer's package (MSP430USBDEVPACK), including how to use CDC. There are also several documents included with this on how to develop USB applications. But I would recommend at first trying one of the basic CDC examples - see for example C0_SimpleSend or C3_EchoToHost. By the way, if you allowed MSPware to install when you installed CCS, you should already have all of these examples built into your CCS install - using View > Resource Explorer and then in MSPware going down to Libraries, you can see the MSP430 USB Developer's package, including all documentation and code examples. I hope that this helps get you up and running.

    Regards,
    Katie
  • Thanks Katie,

    Since it is first USB assignment, i found the things are well explained, but as you told in MSPware i am not able to locate USB projects, on clicking Example project it shows TI window of USB Developer Package window. I have already downloaded this package but not seeing that in CCS ->view->Resource Viewer->MSPware.

     

    Please guide me how to get this.

    Nitesh

  • Hi Nitesh,

    I see what you mean about the navigation issues if you are using the main pane for your navigation - I'll provide this feedback to the team. For now, please use the left hand pane which has a tree/folder structure that you can expand to find your examples. Alternately, try using the Cloud version of Resource Explorer found here: dev.ti.com.

    In Resource Explorer MSPware, try looking under:

    MSPWare > Libraries > USB Developer's Package > Example Projects. Here on the left tree you should select one of the types of USB example projects, e.g. CDC (Virrual COM Port) Examples, then select one of the examples, e.g. Echo Back to Host. All of this navigation is being done on the tree structure on the left pane. Here is an image:

    Hope this helps. Here also is a link to the same place in the Cloud version of TI Resource Explorer: http://dev.ti.com/tirex/#/?link=MSPWare%2FLibraries%2FUSB%20Developers%20Package%2FExamples%2FCDC%20(Virtual%20COM%20Port)%20Examples%2FEcho%20Back%20to%20Host

    Regards,

    Katie

  • Thanks Katie,

    It's working now.

    I have some more questions

    - Suppose i want to do firmware upgrade using software invoking the BSL then we need to do the changes in Application right? Please give your suggestion and link  

       to follow.

    - How to load the USB BSL if we do some changes?

    -  Can we write the USB BSL Host application as per our requirement? where i can find the host commands for writing the firmware?

    - I want to do firmware upgrade by sending some command during run time, can i invoke USB BSL directly or i need any specific step since i am planning to use CDC class for my application where as USB BSL has the HID class. Please need your input.

     

    Thanks

    Nitesh

  • Hi Nitesh,

    For MSP430 USB BSL there is a good application note that talks about considerations for doing a software invocation of the BSL in a USB application: www.ti.com/lit/pdf/slaa452

    If the part is currently blank, USB BSL will automatically be called after a BOR reset.

    For doing a software entry (instead of the normal hardware method), you can find examples of this throughout the app note, based on what kind of application model you have in your system (e.g., if you use USB in your system you may see section 4.2 and 4.3, but if you don't use USB for anything else, you could see section 4.1.)

    Nitesh Padiyar52 said:
    - Suppose i want to do firmware upgrade using software invoking the BSL then we need to do the changes in Application right? Please give your suggestion and link  

    You would need to add the jump to BSL in your main application code, but you would not have to change anything in the BSL code that's already in the part.  

    Nitesh Padiyar52 said:
    - How to load the USB BSL if we do some changes?

    As said above, you shouldn't have to make any changes to your USB BSL if you want to do the software entry - you can just add this jump to BSL in your main application code. If you need to change the BSL for some other reason (can you share what reason? ) then the source code is provided with www.ti.com/lit/pdf/slaa450 and you would need to load it the first time via JTAG/SBW (you shouldn't try to reprogram the BSL area using the BSL, because in the event of a failed load the BSL will be gone and you won't be able to get back in)

    Nitesh Padiyar52 said:
     Can we write the USB BSL Host application as per our requirement? where i can find the host commands for writing the firmware?

    .

    USB BSL commands are described in www.ti.com/lit/pdf/slau319 - there you can find the packet structure, command bytes, etc - all the information you should need. We have a few different host example programs, including source code, as well - there is the BSL Scripter software found in www.ti.com/lit/zip/slau319, and there is also the Python USB BSL host software found here: http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430_USB_Developers_Package/latest/exports/Python_Firmware_Upgrader-5_00_01.zip both include source code so you could see how they work.

    Nitesh Padiyar52 said:
    - I want to do firmware upgrade by sending some command during run time, can i invoke USB BSL directly or i need any specific step since i am planning to use CDC class for my application where as USB BSL has the HID class. Please need your input.

    The app note mentioned above www.ti.com/lit/pdf/slaa452 discusses this - are you having the CDC be communicating with a host PC normally, taking commands, and want to receive a command from your host and enter BSL based on this? In this type of application, I would probably look at section 4.3 Host Control, if you want for example to have your host send you a command over CDC and then invoke the BSL based on that. You could define that command to be anything you like. Your main application code would have to recognize this command, call the USB disconnect function, disable interrupts (clear GIE bit) and then jump to 0x1000. At that point the USB BSL will start and take over and will automatically re-enumerate the device as HID for the BSL without you needing to do anything special. Your host would need to be able to handle seeing the HID device and passing data to it. I've tested the software invocation like this before by using one of the CDC example programs, sending a command from a terminal program on the PC, then seeing the device de-enumerate and re-enumerate in the Device Manager as the HID device with the VID + PID that indicate the USB BSL. Then you can use something like the python host software I linked above, and run this to try using the BSL upgrade. That would show you if it is all working.

    Hope this helps get you started.

    Regards,

    Katie

  • Thanks Katie,

    Very well explained.

    Only doubt i had whether we can change the BSL code for some additional handling while firmware upgrade/downgrade? i.e. i have some configurations bytes in flash for v1 f/w and extra bytes added for v2 f/w, for upgrade and downgrade to maintain my configuration bytes as per versions, for this i need to change the BSL.

    If you have any other method to handle please share your input/thought.

    One more question - i have around 20-25 parameters to be read and 15-20 parameters to be written, can i use HID for my application? then which type of example project is good to use? For enumeration how i can intimate the host regarding my parameters. Or i can simply use command based HID application to read/write parameters. Please guide me.  

     

    Nitesh

  • Hi Nitesh,

    Nitesh Padiyar52 said:
    Only doubt i had whether we can change the BSL code for some additional handling while firmware upgrade/downgrade? i.e. i have some configurations bytes in flash for v1 f/w and extra bytes added for v2 f/w, for upgrade and downgrade to maintain my configuration bytes as per versions, for this i need to change the BSL.

    I'm not sure if I fully understand your need, so you may have to explain more. It sounds like you have two firmware versions, and they have some bytes in flash that are different. However, I don't see why that would mean you need to change the BSL - you can have your BSL host simply read or program more bytes or a different image without having to change the BSL code that is in the MSP. E.g. if you are wanting to do handling like - read bytes at x address, determine if it is v1 or v2 , and then based on this to write some different data or a different image - you could do all of that on the host side using the existing BSL code in the MSP.

    Nitesh Padiyar52 said:
    One more question - i have around 20-25 parameters to be read and 15-20 parameters to be written, can i use HID for my application? then which type of example project is good to use? For enumeration how i can intimate the host regarding my parameters. Or i can simply use command based HID application to read/write parameters. Please guide me.  

    For your main application, I thought you were wanting to use CDC? If you want to use HID instead however, you could use HID Datapipe I think. There are a few examples of this in the MSP430USBDEVPACK http://dev.ti.com/tirex/#/?link=MSPWare%2FLibraries%2FUSB%20Developers%20Package%2FExamples%2FHID%20(Human%20Interface%20Devices)%20Examples%2FSimple%20sending%20of%20data

    The Examples guide lays out what the different examples do: http://dev.ti.com/tirex/#/?link=MSPWare%2FLibraries%2FUSB%20Developers%20Package%2FExamples%20Guide

    There is also a host-side GUI that goes with the MSP430USBDEVPACK that shows host side for HID datapipe and can be used with those examples: http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430_USB_Developers_Package/latest/exports/Java_HID_Demo-5_00_01.zip

    Regards,

    Katie

  • Katie Thanks again for the support.

    On my first concern i have few thoughts, See when my configurations are stored in some flash area i need it when i load the new firmware. But when BSL load the new firmware it erases whole flash i.e. all my previous configuration data is lost while writing the new application. Please let me know how i can get my old configurations when i am load with new firmware? Can i use secured flash area to store the my configurations?

    On first release its ok, but when we do some bug fixes and we do field upgrade on upgrade we will loose the configurations. Even v1 has x bytes and new v2 y bytes (y>x) on upgrade i have lost previous data's please correct me if i am wrong.   if  downgrade is done where my current version v2 has y bytes and  v1 has x bytes (x<y) here also i will loose the data. How to handle this situation?

    Regarding ADS1292EVM

    Yesterday  i was working on ADS1292EVM board, i tried to compile firmware which is available in zip file of the software installation using CSS V6.1.1 its not compiling i got many errors. Even its not possible to debug the ADS1292EVM board right?

    Then as per my board settings i.e. MSP430PZ100USB board with MSP430F5659 controller, i tried to compile by changing linked file i got some other linker error, as shown below, Please let me know how to resolve this.

    "warning: could not resolve index library "libmath.a" to a compatible library

    undefined                      first referenced      

      symbol                            in file           

    ---------                      ----------------      

    abIEP0Buffer                   ./USB_Common/usb.obj  

    abOEP0Buffer                   ./USB_Common/usb.obj  

    tEndPoint0DescriptorBlock      ./USB_Common/UsbIsr.obj

    tInputEndPointDescriptorBlock  ./USB_Common/usb.obj  

    tOutputEndPointDescriptorBlock ./USB_Common/usb.obj  

    tSetupPacket                   ./USB_Common/UsbIsr.obj

    error: unresolved symbols remain

    error: errors encountered during linking; "ADS1x9x_ECG_Recorder_FW.out" not built

     

    Thanks,

    Nitesh

  • Nitesh Padiyar52 said:

    Katie Thanks again for the support.

    On my first concern i have few thoughts, See when my configurations are stored in some flash area i need it when i load the new firmware. But when BSL load the new firmware it erases whole flash i.e. all my previous configuration data is lost while writing the new application. Please let me know how i can get my old configurations when i am load with new firmware? Can i use secured flash area to store the my configurations?

    On first release its ok, but when we do some bug fixes and we do field upgrade on upgrade we will loose the configurations. Even v1 has x bytes and new v2 y bytes (y>x) on upgrade i have lost previous data's please correct me if i am wrong.   if  downgrade is done where my current version v2 has y bytes and  v1 has x bytes (x<y) here also i will loose the data. How to handle this situation?

    Hi Nitesh,

    If you see the BSL user's guide www.ti.com/lit/pdf/slau319 section 3.5.2 Command Descriptions, you'll see that the description for the Mass Erase command says that it will not erase the Information Memory. Furthermore, you can provide the correct BSL password to get into the part without erasing it and do your read before doing the mass erase - now, on an incorrect BSL password, a mass erase will be performed - in this case however you can also see in the description for the RX Password command that the mass erase for an incorrect password also will not erase Information Memory. Therefore, I think you should store your version information in the Information Memory - that way you could keep it from being erased, and would have to explicitly use an Erase Block command to erase and then update the version number in Info memory if you ever needed to. I think this should address your concerns.

    For placing your version number in INFO memory - you can do it like this in your application code:

    #pragma DATA_SECTION(version, ".infoB")
    const unsigned char version[4] = {0x12, 0x34, 0xAB, 0xCD};

    You can then see if you generate your TI-txt binary image or by looking in your .map file, that the version information has been placed in this case at address 0x1900 which is in INFOB memory (see Memory Organization section of the datasheet www.ti.com/lit/gpn/msp430f5659 ). You could also use INFOA memory that has an additional lock bit if you further want to protect it from accidental erase. I hope that this helps give you some option for your version information to preserve it through the BSL mass erase.

    Nitesh Padiyar52 said:
    Regarding ADS1292EVM

    For this EVM (do you mean the ADC1292ECG-FE board?), I don't really know anything about it or its code - I think you'll get better help for those questions in the Data converters forum where you're more likely to be in touch with the team that worked on this EVM. It is really an EVM for some ADCs it just happens to have an MSP430 on it as the microcontroller to work with them. So that ADC team will more likely be who knows about this code. I hope that this helps.

    Regards,

    Katie

  • Thanks a lot, i think this will help me. I have gone through INFO A memory which has 2Kb, which i think is sufficient for my config data. We can declare this similar to INFO B as you shown right? I can declare the structure within this memory as shown below ?

    #pragma DATA_SECTION(config, ".infoA")
    struct config
    {
     int size;
    long CRC;
     int a;
    int b,
    long ab;
    ...
    ...
    ...
    };

    This structure will be updated by in application whenever required, and size of the structure is updated for new version of the firmware.

    Please let me know is it possible.

    Nitesh
  • Hi,

    I was just going through the CDC Example c5, where host send the packet to device. i found data is sent in ASCII format.  I have a question whether all the data transfer happens using ASCII format in USB Protocol?

    If i want to send FF how i have to send/receive ? To test packet of 10 bytes (0x02,0x03,0x04,0x44,............) which serial monitoring is good? Any example available to read/write multiple bytes?

    Also let me know good free USB analyzer?

    Nitesh

     

  • Hi Nitesh,

    Your use of INFOA looks ok to me, but note that INFO A is only 128 bytes (not 2kB that you said) - see www.ti.com/.../msp430f5659 table 6. Memory Organization - INFO each INFO segment A, B, C, D is 128 bytes, so INFO memory as a whole (A + B + C + D) is 512 bytes. How much config data do you have?

    Regards,
    Katie

  • Hi Nitesh,

    Nitesh Padiyar52 said:
    I was just going through the CDC Example c5, where host send the packet to device. i found data is sent in ASCII format.  I have a question whether all the data transfer happens using ASCII format in USB Protocol?

    Many of the examples may use ASCII simply because this is easy to display on a COM port terminal program on  your PC. But no, USB data does not have to use ASCII format.

    Nitesh Padiyar52 said:
    If i want to send FF how i have to send/receive ? To test packet of 10 bytes (0x02,0x03,0x04,0x44,............) which serial monitoring is good? Any example available to read/write multiple bytes?

    Please see the MSP430 USB API Programmers Guide and MSP430 USB Examples Guide included with the USB developer's package. These documents provide a lot of valuable information. In addition, see the many USB Examples included - they have descriptive names, like "Packet protocol": CDC examples http://dev.ti.com/tirex/#/?link=MSPWare%2FLibraries%2FUSB%20Developers%20Package%2FExamples%2FCDC%20(Virtual%20COM%20Port)%20Examples HID examples: http://dev.ti.com/tirex/#/?link=MSPWare%2FLibraries%2FUSB%20Developers%20Package%2FExamples%2FHID%20(Human%20Interface%20Devices)%20Examples

    I hope this helps you to find what you need.

    Nitesh Padiyar52 said:
    Also let me know good free USB analyzer?

    I don't have any recommendation for a free USB analyzer.

    -Katie

  • Thanks Katie,

    Ok, i will check for the size, my config data won't be more than 256 bytes. So i can use any two INFO memories right?

    - Nitesh

     

  • Katie,

    I have one question, Can i run all these example application using HUB as my main interface to Host.
    i.e. Host connects to HUB upstream and HUB downstream connects to my MSP430PZ100USB board?

    -Nitesh
  • Yes you can use two info memories to store your config data - you may just need to break up your structure into two parts so that you can place them both (one in each of two info memory segments).
    -Katie
  • Hi Nitesh,

    Are you talking about a USB hub? I don't think that should be a problem - in fact the MSP-EXP430F5529LP actually has a USB hub built into it (because it has to handle USB to the MSP430F5529 USB module as well as USB to the emulator on the eZ-FET side of the board.)

    Regards,
    Katie
  • Thanks Katie,

    I will check and let you know.

    -Nitesh

**Attention** This is a public forum