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.

CCSTUDIO-MSP: The method of reading out code from MSP430F1232 and format in hex file in CCS

Part Number: CCSTUDIO-MSP

Hi team,

    My customer have Msp430f1232 chip and  program it with code composer with BSL bootloader. He want to know there is a method to read out code  from MSP430F1232 and format in hex file  in CCS.

   He bought  a MSP430G2 lunch pad for this purpose also but hadn't get  any success ! Could you give me some advice?   Looking forward your response!

   Thank you very much!

Best regards,

Alice Bai

  

  • Hi Miao,

    Refer to the BSL scripter  users guide. You must know the BSL password and send the related command to read the data from your device through BSL

    https://www.ti.com/lit/ug/slau655g/slau655g.pdf?ts=1646373403256&ref_url=https%253A%252F%252Fwww.ti.com%252Ftool%252FMSPBSL

  • Hi Allen,

        Thanks for your advice.  For Msp430f1232,   we may get  BSLDemo2 in  BSL Scripter's deprecated folder.

         I"ll ask my customer to check it .Thank you for your support.

     Best regards,

     Alice Bai

      

  • Looking forward to your feedback

  • Hi Allen,

        Greetings for the Day! 

     


    I'm sorry to bother you again 。
    My customer have read the BSL scripter documents, but he is confused about how to read this code from chip through BSL with Code Composer Studio not BSLDEMO2.

    For example,I write this code with build action in code composer to my chip MSP430F1232 and it is working fine.
    What command need to add to my code to read the hex file from chip to my PC with code composer? Could you please tell me step by step?


    #include <msp430.h>
    int main(void)
    {     WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
          P1DIR |= 0x01; // Set P1.0 to output direction
         for(;;)
        {    volatile unsigned int i; // volatile to prevent optimization
             P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
             i = 10000; // SW Delay
            do i--;
             while(i != 0);
        }
        return 0;
    }
    Hoping your response and thank you very much!

    Best Regards
    Alice Bai

     

  • Hi Miao,

    What is BSLDEMO2? Why your customer need to read the hex form device, if they want hex file, CCS can generate this file when they build the project.

    Follow by below steps: change the setting in properties window. And they can choose the hex file format in the Output Format Opinions.

  • Hi Allen,

        Good day!

       We have checked  the Bootloader (BSL) Scripter you linked and find the tips below in page 3.

        NOTE: The BSL Scripter does not support the BSL of the MSP430 1xx, 2xx, and 4xx device families. To communicate with these devices, use the BSLDEMO2.exe command line tool found in the Deprecated folder.

       For MSP430F1232, only  BSLDEMO2  support BSL command , is it right?

      My customer want to read data from chips with CCS. with hex file format.

      He did things like the  linked content below, could you check it?

      https://m.youtube.com/watch?v=Zg41y4pgCIA

     Maybe we're going in the wrong direction for this application request.

     Please you give us some further advice, thank you very much!

    Best Regards
    Alice Bai

  • Hi Miao,

    BSLDEMO2 is not provided by TI. TI just provide BSL-scripter and BSLDEMO is in it.

    Dose customer must use BSL to program and read device?I suggest use JTAG.  It is more convenient to load and read code. 

    If customer can use JTAG, they can use FETPro 430 to download or read memory from device. Can they try JTAG ?

    If the must use BSL, they can download BSL-scripter form ti.com. In the folder "deprecated" you can find the BSLDOME. It is more similar with BSL-scripter by inputting specific command.

    1. uncompress BSLDOME.zip and copy to EXE folder.

    2. copy this deme_read.bat to the EXE folder. Open with txt and modify some command parameters before executing it.

    demo_read(1).bat
    @echo off
    rem ---- initialize environment variables -----------------------------
    
    setlocal
    set workdir=%CD%
    
    set HANDLER="%workdir%\BSLDEMO.exe"
    set BSL="%workdir%\bsl_150.txt"
    set BSL130="%workdir%\BL_130V.txt"
    set BSL150="%workdir%\BL_150S_14x.txt"
    set TXT="%workdir%\test.txt"
    set PASSWORD="%workdir%\int_vect.txt"
    set ComPort=COM20
    goto test1 
     
    
    :test1
    echo --- test F413 (V1.30), F123 (V1.40), both 1 mass erase cycle ----
    echo.
    %HANDLER% -tRocket -c%ComPort% -p %PASSWORD% -r 0x4000 0x10 read_result.txt   
    goto end
    
    
    :test2
    %HANDLER% -tUSB serial -d -c%ComPort% -m1 +epvw  %TXT%
    %HANDLER% -tUSB serial -c%ComPort% -m1 +epvw  %TXT%
    %HANDLER% -tBootst -c%ComPort% -m1 +epvw  %TXT%
    %HANDLER% -c%ComPort% +pvrw     %TXT%
    %HANDLER% -c%ComPort% -w        %TXT%
    %HANDLER% -c%ComPort% -s2 -w    %TXT%
    %HANDLER% -c%ComPort% -w +vr  -pint_vect.txt %TXT%
    goto end
    
    
    rem ---- clear environment variables ---------------------------------
    :end
    pause
    set HANDLER=
    set BSL=
    set BSL130=
    set BSL150=
    set TXT=
    set ComPort=
    
    
    

    The command you can refer this

    MSP430 Bootstrap Loader Communication Program (Version 2.03 - 2019)
    BSLDEMO [-h][-t{tool}][-c{port}][-s{num}][-p{file}][-w][-1][-m{num}][+ecpvruw] {file}

    Options:
    -h Shows this help screen.
    -t{tool} Choose the connected tool(e.g. -tRocket; e.g. -tUSB serial; e.g. -tBootst)
    -c{port} Specify the communication port to be used (e.g. -cCOM2).
    -a{file} Filename of workaround patch (e.g. -aWAROUND.TXT).
    -b{file} Filename of complete loader to be loaded into RAM (e.g. -bBSL.TXT).
    -e{startnum}
    Erase Segment where address does point to.
    -m{num} Number of mass erase cycles (e.g. -m20).
    -p{file} Specifies a TI-TXT file with the interrupt vectors that are
    used as password (e.g. -pINT_VECT.TXT).
    -r{startnum} {lennum} {file}
    Read memory from startnum till lennum and write to file as TI.TXT.
    (Values in hex format)
    -s{num} Change the baudrate; num=0:9600, 1:19200, 2:38400 (e.g. -s2).
    -w Wait for <ENTER> before closing serial port.
    -x Enable MSP430X Extended Memory support.
    -1 Programming and verification is done in one pass through the file.
    -d Indicate MSP430 with dedicated JTAG Pins.

    Program Flow Specifiers [+aecpvruw]:
    a Restore InfoA after mass erase (only with Mass Erase).
    e Mass Erase.
    c Erase Check by file {file}.
    p Program file {file}.
    v Verify by file {file}.
    r Reset connected MSP430. Start application.
    u User Called - Skip entry Sequence.
    w Wait for <ENTER> before closing serial port.
    Only the specified actions are executed!

    Default Program Flow Specifiers (if not explicitly given): +ecpvr

  • Hi Allen,

        Good day!

         Thank you very much for your patient support. The customer will adopt your suggestions.

    Alice Bai

**Attention** This is a public forum