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.

MSP430F5528: BSL Scriptor using Command Line

Part Number: MSP430F5528


Hello,

Can you please help address the below question?

If I use the BSL example script provided for the F5529 it works perfectly on the F5528 and I can load firmware into my chip.  What I don’t like is that the firmware filename is buried in the script file (e.g. “RX_DATA_BLOCK .\firmware_1_00.txt”).  I really want to specify the firmware file on the command line but I don’t see a way to do that.  I could have a script file and a firmware file for each firmware version, but that’s a bit cumbersome and error prone.

Starting with the 3.2.0 version of BSL-Scripter you can execute individual BSL commands from the command line, so I wrote a batch file that mimics the example F5529 script file:

@echo off

BSL-Scripter.exe -g -i [USB] -n 5xx -b pass32_wrong.txt

BSL-Scripter.exe -g -i [USB] -n 5xx -b pass32_default.txt

BSL-Scripter.exe -g -i [USB] -n 5xx -w RAM_BSL_USB.txt

BSL-Scripter.exe -g -i [USB] -n 5xx -z [SET_PC, 0x2504]

timeout /t 3 /nobreak

BSL-Scripter.exe -g -i [USB] -n 5xx -b pass32_default.txt

BSL-Scripter.exe -g -i [USB] -n 5xx -w %1

BSL-Scripter.exe -g -i [USB] -n 5xx -z [SET_PC, 0x4400]

The %1 on the next to last line takes the firmware filename from the command line.

The batch file works just like the script until it gets to the command “-z [SET_PC, 0x2504]”.  At that point I get a pop-up that says “BSL-Scripter.exe has stopped working”.   This command is right out of section 3.1.17 of the BSL-Scripter manual.  It seems like it should work.


Thank You,

Keith N.
AFA OH/wPA

  • Hello Keith,

    Our BSL-Scripter expert is reviewing this issue and will return with a response soon.

    Regards,
    Ryan
  • Hi Keith,


    I did copy the batch file that you are using. there are two points that you could fix there:

    1. assume every line (from BSL-Scripter.exe until -z) is one script. so what we need to do:
      1. define the device -n 5xx done
      2. define communication -i [USB] done
      3. unlock the BSL by -b <filename.txt/filename.hex/default>. this has to be done in every line.
      4. at the end execute -z to disconnect the communication. this make sure when we execute the new line, the initialization is started from no connection.
    2. very small and hardly to seen mistake on the -z argument. there is a space between the SET_PC and the 0x2504. Erasing the space, you should be able to execute the line.

    this is the modified batch file, and i think it should work on your side as well. please let me know the result :) thanks!

    BSL-Scripter.exe -d -i [USB] -n 5xx -b pass32_wrong.txt -z
    BSL-Scripter.exe -d -i [USB] -n 5xx -b pass32_default.txt -z
    BSL-Scripter.exe -d -i [USB] -n 5xx -b -w RAM_USB_BSL.txt -z [SET_PC,0x2504]

    REM give the timeout here
    BSL-Scripter.exe -d -i [USB] -n 5xx -b pass32_default.txt
    BSL-Scripter.exe -d -i [USB] -n 5xx -w blinkLED_F5528.txt -z [SET_PC, 0x4400]

  • Hello Fatmawati,

    The customer was able to get this to work.  Please consider including an example like this in the next release.

    There were a couple typos in the example given, but it was close enough that I was able to figure it out.  Here is the final version. 

     

    Contents of fwupdate.bat:

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

    @echo off

    BSL-Scripter.exe -g -i [USB] -n 5xx -b pass32_wrong.txt -z

    BSL-Scripter.exe -g -i [USB] -n 5xx -b pass32_default.txt -z

    BSL-Scripter.exe -g -i [USB] -n 5xx -b -w RAM_BSL_USB.txt -z [SET_PC,0x2504]

    timeout /t 2 /nobreak

    BSL-Scripter.exe -g -i [USB] -n 5xx -b pass32_default.txt -z

    BSL-Scripter.exe -g -i [USB] -n 5xx -w %1 -z [SET_PC,0x4400]

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

     

    I had to make a change on the third line: RAM_ BSL USB_ instead of RAM _USB_BSL.

    The last line had a space after the comma which caused it to blow up.

    I put a –z on the next to last line for consistency although none of the –z ‘s with no argument seem to matter

    I changed the –d argument to –g to minimize output and avoid  generating a ton of log files.

     

    Example use:

    fwupdate fimware_1_00.txt

    Thank You!
    Keith N.

  • Hi Keith,

    regarding the naming of the files, i will put this as the enhancement for future release. thanks a lot for the input and the feedback!

**Attention** This is a public forum