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.

MSP430F6659: How to customize the TI USB BSL?

Other Parts Discussed in Thread: MSP430F6659, MSP430F5529

About the TI MSP430F6659 MCU, we are customizing the TI USB BSL now.

A) We downloaded the source codes of TI USB BSL from the following WEB site as follows:        
         http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/CustomBSL/latest/index_FDS.html
           File name: SLAA450.zip

  B) In the compressed file (SLAA450.zip), it contains the image of USB BSL for MSP430F665x
       in the sub-folder as follows:
                 \5xx_6xx_Released_BSL_Images\MSP430F663x_665x_Family\USB BSL\

  C) But it does not contain the according source codes of the image of USB BSL
       for MSP430F665x in the sub-folder as follows:
                 5xx_6xx_BSL_Source\

       In the "5xx_6xx_BSL_Source\" sub-folder, we just found the USB BSL for MSP430F552x.
                MSP430F552x_USB\

Question-1) How can we get the source codes of the image of USB BSL for MSP430F6659 MCU?

Question-2) How to port the USB BSL from "MSP430F552x_USB\" sub-folder to MSP430F6659 MCU?

Thank you.

 

  • I guess that USB and USB BSL is the same for all MSP430 USB devices. What you want to do with customization. Default USB BSL will fit to 2KB, and there is no free extra space for something else.

  • We are adding the USB interface of MSP430F6659 into our H/W design.

    In order to let it be able to upgrade user application (F/W) via USB interface of MSP430F6659 from USB port of PC.

    1) In the default TI USB BSL, it supports 24/12/8/4 MHz for the frequency of external XT2 crystal.

       But our H/W design uses 20MHz as the external XT2 crystal.

       In the other question posted in the TI E2E Community as follows, they told us that 20MHz is not supported by USB of MSP430F6659.

      >>>>   http://e2e.ti.com/support/microcontrollers/msp430/f/166/t/384770.aspx

     We need to change the external XT2 crystal to 24MHz.

     And we do not make sure whether any other customizations of default TI USB BSL are necessary for our H/W design.

    2)  So, we request the source codes of the image for MSP430F6659 MCU in the following sub-folder:

       >>>>  \5xx_6xx_Released_BSL_Images\MSP430F663x_665x_Family\USB BSL\

    Could you do us a favor to tell us how to get the source codes of TI USB BSL for MSP430F6659?

    3) Could you do us a favor to tell us how to port the source codes of USB BSL to MSP430F6659?

    Thank you.

  • Yes, 20 MHz will not work with USB, but something close to 20 MHz will work. You can use my USB PLL configurator.

    http://forum.43oh.com/topic/3904-usb-pll-configurator


    Don't have BSL source code for MSP430F6659. You just need to change constants for highest freq (24 MHz) inside BSL_Device_File.h

    //24MHz will be detected
    #define SPEED_1          24000000
    #define SPEED_1_PLL      USBPLL_SETCLK_24_0;

    //12MHz will be detected
    #define SPEED_2          12000000
    #define SPEED_2_PLL      USBPLL_SETCLK_12_0;

    //8MHz will be detected
    #define SPEED_3          8000000
    #define SPEED_3_PLL      USBPLL_SETCLK_8_0;

    //4MHz will be detected
    #define SPEED_4          4000000
    #define SPEED_4_PLL      USBPLL_SETCLK_4_0;

  • Thanks for your information.

    In the source codes of TI BSL (SLAA450.zip), in the "5xx_6xx_BSL_Source\" folder, it only contains the "MSP430F552x_USB\" sub-folder for the USB.

    This sub-folder is for USB of MSP430F552x MCU.

    And we checked the "BSL_Device_File.h" in this sub-folder, we found some issues as follows:

    1)  It includes the header file for  MSP430x552x MCU.

    >>>> #include "msp430x552x.h"

    2)  The pins of XT2 crystal are NOT for MSP430F6659 MCU.

    #define XT2SEL_PORT         P5SEL
    #define XT2SEL_PINS         (BIT2 + BIT3)

    3) In the IAR IDE Workspace (*.eww), the target device is configured to MSP430F5529 MCU.

    4) And etc.

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

    A) Could you do us a favor to tell us how to fix the issues above?

    B) We found the image of USB BSL for MSP430F665x in the sub-folder of source codes of BSL as follows:

           >>>>  5xx_6xx_Released_BSL_Images\MSP430F663x_665x_Family\USB BSL\

    B-1) Is it possible to send us the source codes for the image of USB BSL for MSP430F665x?

     

    Thank you.

     

     

  • We need to customize the TI USB BSL of MSP430F6659 to meet the requirements of the H/W design.

    Could you do us a favor to tell us your comment ASAP?

    Thank you.

     

  • Hi Hank,

    Here's a step by step explaining how to modify SLAA450 for F6659:

    1. Get code from SLAA450
    2. Create copy of MSP430F552x_USB project
    3. Rename folder, .ewd and .ewp . The .dep and .eww are not really needed in these steps and can be deleted.
    4. Open BSLs.eww in IAR
    5. Import project from new renamed folder (Project->Add Existing Project, select your new .ewp)
    6. Change device (right click project->Options->General Options->Target->Device = MSP430F6659)
    7. To build Flash version:
      1. Add BSL430_Low_Level_Init.s43 to your project (right click file->Options->Uncheck “Exclude from Build”
      2. Open BSL_Device_File.h
        1. Change device header file (either to MSP430F6659.h or MSP430.h)
        2. Change XT2 pins (XT2SEL_PORT= P7SEL, XT2SEL_PINS = (BIT2 | BIT3)
      3. Add custom linker file to project (right click project->Options->Linker->Linker configuration file->Override default , set file to $PROJ_DIR$\config\lnk430_BSL_AREA_RAM_2400-33FF.xcl
      4. Linker file should be modified according to the device, but in this case, the one used for F5529 should work OK for F6659
      5. For newer IAR versions, fix compiler error by adding definition of USE_LARGE_CODE_MODEL (Right click project->Assembler->Preprocessor->Defined Symbols, add: USE_LARGE_CODE_MODEL=0
      6. The code is expected to build for the original device (F5529) and IAR version (5.51.5), but a change in code, device, or IAR version can cause problems, especially for USB BSL. Different optimizations can be done, but a common one is just to remove automatic detection of crystal
        1. Open BSL430_USB_PI.h
        2. Comment everything from line 226 to line 257
        3. Before the #endif of line 258, add a line just to force USB PLL to the expected crystal. I.e.:

    //    wUSBPLL = *(&cSPEED_4_PLL);

    //  }

       wUSBPLL = USBPLL_SETCLK_24_0;  // Use 24Mhz crystal

    #endif

                            g. Build code and download

    I'm attaching the modified project

    8030.SLAA450_1_00_06_00_F6659.zip

    Regards,

    Luis R

  • Thanks for your kind support.
    We had downloaded the attachment to check in more details.
    We will update the status later.
  • We opened the "5xx_6xx_BSL_Source\BSLs.eww" with IAR Embedded Workbench 5.51.5.
    But IAR said the Workspace file is created by the newer version of IAR.
    1) Could you do us a favor to tell us what is the version of IAR used in your development environment?
    2) As we know, the mini-USB BSL pre-programmed in flash of MCU will receive
    the RAM-based USB BSL and put it into the RAM of MCU for execution.
    The following TI-TXT file is for mini-USB BSL (pre-programmed in flash of MCU).
    >> 5xx_6xx_BSL_Source\MSP430F6659_USB\Debug\Exe\MSP430F6659_USB.txt
    Could you do us a favor to tell us how to generate the RAM-based USB BSL?
    Thank you.
  • Hi Hank,

    Hank Chu said:
    1) Could you do us a favor to tell us what is the version of IAR used in your development environment?

    I used IAR 6.10.7. Please note that the steps will be the same for older IARs, except for step "7.e" which shouldn't be necessary.

    Hank Chu said:
    Could you do us a favor to tell us how to generate the RAM-based USB BSL?

    - use the linker for RAM:  lnk430F5529_RAM_AREA.xcl

    - BSL430_Low_Level_Init.s43 should be excluded from the project

    - Use the following definitions in BSL_Device_File.h:

        //#define RAM_WRITE_ONLY_BSL 0x80

        #define FULL_FLASH_BSL

        #define RAM_BASED_BSL 1

     

    Regards,

    Luis R

  • Thanks for your kind support.

    We are following your instruction to customize and compile the TI USB BSL.
    We will update the status later.
  • About the USB BSL for MSP430F6659 MCU, we had followed your instructions to customize it (based on "SLAA450.zip" file).

    And we successfully compiled/linked the customized source codes of USB BSL.

    Thank you very much.

**Attention** This is a public forum