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.

MSP430FR5994: MSP430FR Main Mem Boot loader

Part Number: MSP430FR5994
Other Parts Discussed in Thread: MSP430FR6989, MSP-EXP430FR5969

Dear Sirs:

     I'm trying to run the perl code converter 430txt2c_20bit from the utilities\430txtconverter\ directory but the code executes so fast that I can't read what it is doing.

Is there a way to slow this down to see what's going on?

Also am I running it from the correct directory?

Thanks

John Moore

  • Hello John,

    Could you please elaborate what exact directory, in relation to your file system, you are using? Have you tried running this converter from the terminal window so that you can see what happened after it is finished executing?

    Best regards,

    Matt
  • Thanks, Matt:

          In my c: directory I have:

    c:\ti rf\interrupts\Bootloader(BSL)\MSP430FRboot_1_01_00_00\Utilities\430txt_converter\430txt2C_20bit.pl

    By terminal window I suppose you mean a dos window?

    John

  • I tried the dos window and the terminal window (shortcut win 10) and both are still to fast to see what's going on.

    John
  • Matt:

    Finally got the perl to run the 430txt2C.pl by moving the dos window to the 430txt_converter directory. But now it wants the :
    src (txt file)
    dest (.h file)
    and struct c struct.

    I'm not sure what to put in here and where to put the dest and the struct.
    Could you please illuminate me?

    John
  • John,

    Yes you need to navigate to the directory where the Perl script is before calling it in the terminal. Those files you are seeing it ask for are the inputs and outputs to the script. You can see what the script is actually doing if you open it up in a text editor.

    Here is the description I found inside of the file:

    #Perl script used to convert MSP430 .txt to C array in .h file
    # format:
    # perl 430txt2c.pl src dest struct
    # src: Source file in MSP430 .txt format
    # dest: Destination file in .h format
    # struct: Name of output array
    #

    You need to copy the .txt source file into the same directory as the script file. Then you run the script by providing it the source, destination file where the output will be written to, and the name you'd like the output array to be. Here is an example of how to call the script:

    C:\ti\msp\MSP430FRBoot_1_01_00_00\Utilities\430txt_converter>perl 430txt2C_20bit.pl example_code.txt output_file.h output_struct

    More information on the MSP430FRBoot Main Memory Bootloader can be found in the following Application Report: www.ti.com/.../slaa721b.pdf


    Best regards,

    Matt
  • Thanks, Matt:

         It looks like the example_code.txt would be for instance \FR5994_Uart\App1_MSPBoot\BSLBased_20bit\

    App1_MSPboot_FR5994_UART.txt.

       So I should copy this over to the 430txt_converter directory and name it:  example_code.txt?

    John

         

  • Matt:

    Also when the output file.h pops out don't I have to rename it and put it somewhere?

    Also when the output_struct pops out don't I have to rename it and put it somewhere the compiler can find it?

    Thanks,

    John
  • John,

    When you run the script, all you need to make sure is that your project's .txt file is copied into the same directory as the script. It doesn't have to be named example_code, it can be named anything you want. The .txt file will be generated by CCS once your project is compiled and built. When you write the terminal command to run the script, you have the freedom to name the .h file that gets generated. You don't have to name it output_file, you can name it whatever you want. The file will get generated by the script and be placed in the same directory you ran the script from. The same naming convention applies to the output structure, it can be named whatever you want it to be. The .h output file generated is the C array representation of the .txt project file.

    -Matt
  • Thanks, Matt:

    Have a nice Thanksgiving.

    John

  • Dear Sirs:
    I'm using MSP430FR5994 and FR59941 eval boards to try out the custom boot loader. So
    I select the FR5994 variant for App1.
    But in testing I noticed that the compiler thinks the variant is MSP430FR6989. If I change this in
    properties..general to FR5994 and then compile it comes up with 104 errors!
    Any advice?

    John
  • John,

    What specific example are you referencing that is resulting in these errors?

    -Matt
  • Matt:
    it is App1_MSPBoot_FR5994_UART

    John
  • Thanks, Matt

    John

  • John,

    I am able to replicate your findings. Please give me a day to work with the owners of the MSP430FRBoot code examples to determine a possible workaround.

    -Matt
  • Hi John,

    When the FR5994 is added, CCS automatically adds a new linker file (lnk_msp430fr5994.cmd). This new linker file is conflicting with the existing one (inside Config_App folder) and it's missing several definitions used by MSPBoot.

    Please remove the new linker file and try to rebuild the project.

    Regards,

    Luis R

  • Matt:

        I'm still working with the main memory bootloader but thought to share with you where I am now.

    Was able to download the supplied software and images for the FR5994UartBSLBased20bit App1.

         First added pullups to the serial uart serial lines.  Then the host would send at 57kbaud but the target wouldn't respond.  

         Then changed the baud rate on the MSPBootHost's Uart.c to 9600 baud.  

          Also had to change the baud rate:  define CONFIG_CI_PHYDL_UART_BAUDRATE to 9600  in MSPBoot FR5994 uart (in MSPBoot)  in file TI_MSPBoot_Config.h   at the bottom under #elif defined(MSPBoot_BSL) .

    Believe this is necessary since when the target is blank it can only use its rom bootloader which is set to 9600 baud.  It wouldn't  download without these changes.

    John

  • Thanks, Matt and Louis:

    Believe the BSLBased_20bit version works.

    On page 21 of SLAA721B is states:
    "The software package includes a Windows .bat file that is used to generate the linker files for all
    predefined projects and targets configurations. This file can also be used as a base for any further
    customizations."
    I haven’t seen this .bat file. The version I have is MSP430FRBoot_1_01_00_00. Maybe I’m missing this batch file. It probably puts the generated image and linker files where they are needed.
    I generated two .bat files to do the image processing.

    John

  • Hi John,

    Your comment about the ROM bootloader (aka BSL) is correct. BSL has a default baudrate of 9600bps and it's available even if the device is blank.
    If you just need to program the devices without having the additional features of MSPFRBoot (i.e. CRC check, dual image, customization), then using the BSL is the right way to go. It's simpler and you don't really have to modify the application.

    MSPFRBoot is a Main memory bootloader, so it needs to be pre-programmed to the device either by BSL or by JTAG/SBW. Once MSPFRBoot is programmed, it can be used without having to go through BSL, and it can have whatever default baudrate you want.

    So, if you decide to use MSPFRBoot, the procedure to use a blank device would be:
    * Program MSPFRBoot image with BSL/JTAG/SBW (BSL should start at 9,600bps but then it can be changed to a higher baudate if needed by using the "Change BaudRate" command ).
    * [Optionally] the same MSPFRBoot image can be combined with the application and downloaded via BSL/SBW/JTAG during the first download.
    * Use MSPFRBoot for subsequent updates of the application.

    Regards,
    Luis R
  • Thanks much, Louis:

    Afraid I'll have to use the fr main memory bootloader since our serial port has an RS485 chip in the middle. But for now I'm using two eval boards fr5994. (Although our system uses fr5992.)
    Couldn't get the dual image system to work so backed up to the simplest version which is the bsl based 20 bit version.

    John
  • Hi John,

    It seems like this is a mistake in the document. These files are no longer included in the software package.

    The file is nothing really complicated but it just included a bunch of calls to the perl file to create linker file and to copy the output to the corresponding folder. I.e this is for an older G2553 example:

    echo -----------------------------------------------------------------------------
    
    echo Linker file for G2553_UART using 1KB
    
    perl MSPBootLinkerGen.pl -file lnk_msp430G2553_UART_1KB -dev MSP430G2553 -params 0xC000 0xFFE0 0xFC00 48 6 0x200 0x3FF 0x50 0x1000 0x10BF
    
    echo -----------------------------------------------------------------------------
    
    copy /Y output\lnk_msp430G2553_UART*_Boot.cmd ..\Target\G2553_UART\CCS\MSPBoot\Config\
    
    copy /Y output\lnk_msp430G2553_UART*_App.cmd ..\Target\G2553_UART\CCS\App1_MSPBoot\Config_App\
    
    copy /Y output\lnk_msp430G2553_UART*_App.cmd ..\Target\G2553_UART\CCS\App2_MSPBoot\Config_App

  • Thanks, Luis:

    This could still be valuable. I wrote .bat files to run the script processing but wasn't sure where to put them after being generated.

    John
  • Hi John,

    I'm glad the simpler version worked but if you need it, we can also check why the dual image is not working.

    I would expect the demo bootloader and application to run out of the box but my recommendation would be to start by debugging the bootloader. If you have access to JTAG/SBW, then it makes it a lot easier because you can check: 1) if you are actually going to bootloader mode, 2) if you are getting the commands properly, 3) if the right memory locations are written.
    Once the application is loaded, then you can also use JTAG/SBW to check if the bootloader is jumping to the application correctly. There might be some problems in the addresses defined by the linker file, the CRC check, etc.


    LR
  • Thanks, Luis:
    Believe we'll need to use the dual boot system in the end because it should be more robust and can be used OTA.

    John
  • Luis:
    Matt found a bug in the dual mode software which he's working on now.
    John
  • Hi John

    I have import the demo code "App1_MSPBoot_FR5994_UART" and you are right the configuration in "Properties" that the Variant is wrong.
    So I changed it to MSP430FR5994 and delete lnk_msp430fr5994.cmd that auto added to the project. Then I installed the latest MSP430 compiler V18.1.4 (You can get it at www.ti.com/.../MSP-CGT-17 )
    Then I build it without errors.
    I have try it with CCS V7.3.0 and V8.2.0.

    Best regards
    Gary
  • Thanks, Gary

    John

  • John,

    The only bug I have looked into and replicated was the building errors described before; but with the help of Luis and Gary we have found the solution to that issue. The next issue you seem to be facing is with the dual mode code example. Could you please give a more detailed explanation of what issues you are experiencing and what debug steps you have taken to determine the root cause of the problem? I see that Luis has given you some preliminary suggestions on what to debug and check for so I'd be interested in learning your findings.

    Best regards,

    Matt
  • Thanks, Gary:

         Tried this with App2_MSPBootFR5994, BSL based 20bit,  but wound up with 18 errors.

    John

  • Thanks, Matt:
    Having same trouble with the App2_MSPBoot even with BSL20bit even though I installed
    the new compiler and deleted the link command files he recommended. No get 18 errors with 7.2.

    John
  • Thanks, Luis:

    I wrote some .bat files to process the script and linker files. In 430txt_converter you can copy over the .txt file from the target then run the following bat file :

    ConvertNoCrc.bat:

    rem First transfer the .txt file from\target\FR5994Variant\App1_MSPBoot\BSLBased20Bit to App.txt in this dir (430txt_converter)
    430txt2C.pl App.txt App.c AppArray

    rem Then copy App.c back:
    copy /Y App.c ..\target\FR5994_UART\App1_MSPBoot\BSLBased_20bit\App1_MSPBoot_FR5994_UART.txt
    pause


    Then in linkerGen I have a bat file to do the link files:
    Link20BitSingle.bat:

    rem this does a bslbased20bit file
    perl MSP430FRBoot_LinkerGen.pl -file lnk_msp430fr5994_UART_2KB_Single -lnk_file lnk_msp430fr5994.cmd -boot_size 0x800
    pause

    Then there is one more bat file to copy the results to where they need to go:
    Locate20BitSingle:

    copy /Y output\lnk_msp430fr5994_UART_2kb_Single_Boot.cmd ..\Target\FR5994_UART\CCS\Config\

    copy /Y output\lnk_msp430fr5994_UART_2kb_Single_App.cmd ..\Target\FR5994_UART\CCS\App1_MSPBoot\Config_App\



    Please look at these to see if they will work:

    Thanks,
    John
  • John,

    I was able to import the App2_MSPBoot_FR5994_UART project, switch the build configuration to BSLBased_20bit, and then build the project with no errors. I did not have to delete any linker command files or anything like that because the default target device is correct in this project.

    -Matt
  • Thanks, Matt:
    I'm still lost as to what the script converter is doing and the linker generator is doing to produce the linker files. I'll have to understand these concepts to process the project.   So I produced some dos .bat files to help do this.
    But it would be great if you could please review them to see if they are correct.  Following are these windows batch files:


    rem First transfer the .txt file from c:\bootqsm\\target\FR5994UART\App1_MSPBoot\BSLBased20Bit to App.txt in this dir (430txt_converter)
    rem Then copy App.c back:
    430txt2C.pl App.txt App.c AppArray
    copy /Y App.c ..c:\bootqsm\target\FR5994_UART\App1_MSPBoot\BSLBased_20bit\App1_MSPBoot_FR5994_UART.txt
    pause



    rem this does bslbased20bit files
    perl MSP430FRBoot_LinkerGen.pl -file lnk_msp430fr5994_UART_2KB_Single -lnk_file lnk_msp430fr5994.cmd -boot_size 0x800
    pause



    copy /Y output\lnk_msp430fr5994_UART_2kb_Single_App.cmd ..c:\bootqsm\Target\FR5994_UART\App1_MSPBoot\Config_App\lnk_msp430fr5994_UART_2KB_Single_App.cmd
    pause




    John

  • Thanks, Matt:
    I'm still lost as to what the script converter is doing and the linker generator is doing to produce the linker files. I'll have to understand these concepts to process the project. So I produced some dos .bat files to help do this.
    But it would be great if you could please review them to see if they are correct. Following are these windows batch files:

    rem First transfer the .txt file from c:\bootqsm\\target\FR5994UART\App1_MSPBoot\BSLBased20Bit to App.txt in this dir (430txt_converter)
    rem Then copy App.c back:
    430txt2C.pl App.txt App.c AppArray
    copy /Y App.c ..c:\bootqsm\target\FR5994_UART\App1_MSPBoot\BSLBased_20bit\App1_MSPBoot_FR5994_UART.txt
    pause



    rem this does bslbased20bit files
    perl MSP430FRBoot_LinkerGen.pl -file lnk_msp430fr5994_UART_2KB_Single -lnk_file lnk_msp430fr5994.cmd -boot_size 0x800
    pause


    copy /Y output\lnk_msp430fr5994_UART_2kb_Single_Boot.cmd ..c:\bootqsm\Target\FR5994_UART\MSPBoot\Config\lnk_msp430fr5994_UART_2KB_Single_Boot.cmd
    copy /Y output\lnk_msp430fr5994_UART_2kb_Single_App.cmd ..c:\bootqsm\Target\FR5994_UART\App1_MSPBoot\Config_App\lnk_msp430fr5994_UART_2KB_Single_App.cmd




    John
  • Hi John

    I can't help you to check the grammar error but I can give you the flow chart

    1. Use CMD window to generate the .cmd files for your boot code and application code first by execute MSP430FRBoot_linkergen.pl.

    Just input the command like below:(You may need to change the path based on where the MSP430FRBoot_linkergen.pl located in your PC, more explain of the parameters of MSP430FRBoot_linkergen.pl you can refer to the document)

    2. Put the .cmd files into your boot code and application code and make the change of the projects based on your application than build them to generate the .txt file

    3. Copy the App's .txt file to the folder  ...\MSP430FRBoot_1_01_00_00\Utilities\430txt_converter(Same with the 430txt2C_20bit.pl)

    4. Build a blank .c file to receive the conversion result at  ...\MSP430FRBoot_1_01_00_00\Utilities\430txt_converter (Same with the 430txt2C_20bit.pl)

    5. Use CMD window to execute 430txt2C_20bit.pl. Just input the command like below:(You may need to change the path based on where the 430txt2C_20bit.pl located in your PC and the array's name based on which App you convert)

    6.Then put your .c file to the Host project in the path ..\MSP430FRBoot_1_01_00_00\Host\MSP-EXP430FR5969\TargetApps

    7. Make sure your .c file's name is same with the name in Host project's main.c like

    If this resolve your problem, please click the "This resolved my issue"to close the thread.Thanks

    Best regards

    Gary

  • Thanks, Gary:
    This helps a lot. I didn’t realize that needed to run the MSPFRBootLinkerGen first or that
    It generates the whole link command file(s). Also wound up with a .bat file to generate the link file:

    rem Generates bslbased20bit linker app and boot cmd files to \output directory
    perl MSP430FRBoot_LinkerGen.pl -file lnk_msp430fr5994_UART_2KB_Single -lnk_file lnk_msp430fr5994.cmd -boot_size 0x800
    rem now need to locate them in the application and boot code
    pause

    Also didn’t know to be so careful about the .txt file naming and array naming.
    Produced a .bat file to do this also:


    rem First transfer the .txt file from c:\bootqsm\\target\FR5994Variant\App1_MSPBoot\BSLBased20Bit to App1_MSPBoot_FR5994_UART.txt in this dir (430txt_converter)
    rem Then copy App.c back:
    430txt2C.pl App1_MSPBoot_FR5994_UART.txt App1_FR5994_UART_BSLBased_20bit_FR5Host.c App1_Array
    rem copy /Y App.c ..c:\bootqsm\target\FR5994_UART\App1_MSPBoot\BSLBased_20bit\App1_MSPBoot_FR5994_UART.txt
    pause

         In the txt converter, I named the array App1_Array.


    John

  • Hi John

    The process sound good. One thing I should remind you that the change of the application code can't be do by .bat script due to it will include lots of coding works there.

    Best regards
    Gary
  • Thanks, Gary:

        So you're saying that I can't change the linker command file to accomodate my project?

    I don't see why the linker generator is needed at all.  Can't I just write the software like any other project?

    John

  • Gary Gao said:
    Hi John

    The process sound good. One thing I should remind you that the change of the application code can't be do by .bat script due to it will include lots of coding works there.

    Best regards
    Gary

**Attention** This is a public forum