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.

bsl scripter loading intel hex file error

Other Parts Discussed in Thread: ENERGIA, CSD

I am using BSL Scripter 3.2.0 with a script to load a firmware image that is in Intel Hex format, which is apparently a new feature in the new version..   The firmware image is an Energia project built in CCS v6.1.3.

I was previously successful using BSL Scripter v3.1.0 to load a TI TXT format image.

Here's my script:

//
// This script loads the Intel-hex format image simulator_scalar_R1_BSL.hex
// which was built by importing the Energia project into CCS
//
//Device : MSP430FR5969
//
// Download application through
// UART BSL in FRAM device
//
LOG
MODE FRxx UART 9600 COM5 PARITY
VERBOSE
TX_BSL_VERSION
//gives wrong password to do mass erase
RX_PASSWORD pass32_wrong.txt
//
//add delay after giving wrong password
//because the device does not give
//any response after wrong password applied
//
DELAY 2000
RX_PASSWORD pass32_default.txt
RX_DATA_BLOCK simulator_scalar_R1_BSL.hex

The BSL Scripter begins to load the FR5969 from the Intel Hex file, but after a minute or so I get an error message:

[ERROR_MESSAGE]Record type is not valid for the Scripter!

Here's the last part of the log file:

        ...
	[00] [00] [00] [00] [00] [18] [08] [08] [00] [00] [22] [20] [22] [44] [22] [42] 
	[00] [00] [00] [00] [80] [00] [00] [00] [00] [00] [00] [01] [00] [1c] [00] [00] 
	[04] [40] [20] [08] [10] [04] [10] [63] [25] 
	<80> <02> <00> <3b> <00> <60> <c4> 
	[80] [d0] [00] [10] [00] [a8] [00] [20] [40] [08] [10] [20] [80] [40] [00] [00] 
	[01] [04] [00] [01] [02] [01] [02] [40] [01] [20] [02] [01] [02] [04] [08] [00] 
	[00] [04] [02] [02] [04] [02] [02] [03] [03] [03] [01] [01] [01] [01] [01] [00] 
	[00] [03] [01] [00] [02] [02] [04] [04] [04] [01] [04] [01] [05] [05] [05] [05] 
	[00] [00] [00] [0c] [02] [0d] [02] [2c] [02] [2d] [02] [2c] [03] [00] [00] [0a] 
	[02] [0b] [02] [2a] [02] [2b] [02] [2a] [03] [00] [00] [06] [02] [07] [02] [26] 
	[02] [27] [02] [26] [03] [00] [00] [04] [02] [05] [02] [24] [02] [25] [02] [24] 
	[03] [00] [00] [02] [02] [03] [02] [22] [02] [23] [02] [22] [03] [00] [00] [00] 
	[00] [36] [71] [d2] [73] [c8] [70] [f8] [70] [da] [70] [24] [71] [54] [68] [69] 
	[73] [20] [69] [73] [20] [61] [20] [73] [65] [6e] [73] [6f] [72] [20] [64] [65] 
	[73] [63] [72] [69] [70] [74] [69] [6f] [6e] [2e] [00] [51] [75] [53] [70] [69] 
	[6e] [30] [30] [30] [30] [00] [00] [01] [00] [03] [00] [32] [00] [30] [f2] [fc] 
	[ff] [fc] [ff] [20] [a1] [07] [00] [d8] [2f] [07] [00] [30] [fe] [1b] [10] [01] 
	[00] [00] [00] [f5] [0c] 
	<80> <02> <00> <3b> <00> <60> <c4> 
	[ERROR_MESSAGE]Record type is not valid for the Scripter!

Can anyone help with this error?

  • Hi John,

    I am bringing in a BSL Scripter expert to help address your issue. Can you please provide the Intel Hex file you are attempting to load, as I understand it you used CCS v6.1.3 to generate the binary image but can you also tell us what compiler was used? And this exact same image worked on v3.1.0 with the TI TXT format?

    Regards,
    Ryan
  • Hello Ryan,

    Thank you for the help on this.

    Compiler used in CCS 6.1.3  to generate the firmware image was GNU v4.6.3.   Image was built from an Energia project imported into CCS.   

    I should have been clearer--the image that was loaded successfully with earlier version Scripter 3.1.0 was not the same image because I could not output the image I needed to load in TI TXT format using GNU toolset.  So I used another CCS project to generate the TI TXT to load.  

    I followed the instructions here:

    e2e.ti.com/.../148.4-5-attaching-a-file

    to attach the Intel HEX file, but I could not see the rich text option selection that the post referred to.  I dragged-and-dropped the file anyway, but it looks like it may have been inserted, not attached--sorry.  Got this error message:

    "Only known URLs and the following file extensions are allowed: 123, 7z, aac, ai, aiff, art, asf, asx, avi, bmp, config, csd, css, db, db, dmg, doc, docx, drw, eml, flac, flv, gif, gz, htm, html, ics, jpeg, jpg, log, m4a, m4p, m4v, mdb, mdbx, mid, midi, mmv, mov, mp3, mp4, mpg, mpp, msg, ogg, pdf, png, pps, ppt, pptx, ps, psd, qt, ram, rar, rm, rtf, sit, sitx, sql, swf, tif, tiff, txt, vcf, vcs, wav, wma, wmv, wpd, wps, xls, xlsx, xml, zip, tsc, tsm, ibs, diff, tar, tar.gz, gel, ccs, cpp, asm, sa, c, cc, sch, ini, cfg, cxx, s, asm, pjt, vsd, sch, pcb, lib, cir, mcd, xmcdz, xmct, jmp, jsl, dat, brd, vsm, h, usb. Please select a valid file or enter a valid URL."

  • I found the "Use rich formatting"  option, clicked it, and tried to attach the hex file, but got the error message again.  Here is the Intel HEX file zipped.simulator_scalar_R1_BSL.hex.zip

  • Hi John,

    thanks for attaching the file. I try this file on my side, and will back to you as soon as I found the rootcause.

  • Hi John,

    I just tested the output and found something. Apparently, when we compile and generate the firmware file from Energia is different with the other IDEs (CCS, KEIL), it generates the last second line:

    :0400000300004400B5

    this line means we are writing the PC register with 4400 as a reset vector. That makes sense, since in Energia, we download the program and it executes application directly by this line after the programming is finished. When we are using the IDE such as IAR or CCS, we do not have this line generated. Once we download the program, we run the debug manually. As a workaround, erase this line, and after downloading, you can use the SET_PC 0x4400 in the script file. 

    This record type is now not supported for BSL Scripter v3.2.0, I already addressed this internally as an enhancement request, to count the Energia generated Intel Hex File in the requirement.

  • Thank you for checking into this. I applied your suggested edit to the Intel HEX file, and it loaded without error using BSL scripter, and also booted up normally.

    John Wygonski
  • Hi John,

    I am glad it works! :)
  • I just wanted to make sure I understood the implications of your post.   If I understood you correctly, BSL Scripter does not support the "Start Segment Address" record of the Intel HEX format indicated by the '03' in the line line:

    :0400000300004400B5

    in my .hex file.   I think I understood you to say that firmware loaders (e.g. Energia) would use this line to set the PC and begin execution.     My question is, does this record, and the workaround you suggested, also set the contents of the RESET vector?  Otherwise the firmware could not start after reset, is my understanding correct?

  • I continuing with trying to load an Intel Hex format firmware image using BSL Scripter 3.2.0, and have encountered another issue.

    Energia for MSP430 also creates an Intel Hex format file from the .elf file it produces.  I removed the "Start Segment Address" record from this file.   However, when I try to load this file using BSL Scripter, the load fails with error message (from the log file):

    	[72] [69] [70] [74] [69] [6f] [6e] [2e] [00] [51] [75] [53] [70] [69] [6e] [30] 
    	[30] [30] [30] [00] [00] [01] [00] [03] [00] [32] [00] [30] [f2] [fc] [ff] [fc] 
    	[ff] [20] [a1] [07] [00] [d8] [2f] [07] [00] [30] [fe] [1b] [10] [01] [00] [00] 
    	[00] [b7] [c7] 
    	<80> 
    	[ACK_ERROR_MESSAGE]Packet Size exceeds maximum buffer size!
    	Time elapsed of writing 25889 bytes : 41.29 seconds
    	Speed of writing data :0.6123(kB/s)
    SET_PC 0x4400
    	[80] [04] [00] [17] [00] [44] [00] [42] [0f] 
    

    Energia loads this file with no error.  It looks to me that the Intel Hex file produced with Energia tools has one very large Extended Segment Address record that is too large for BSL Scripter.

    Could you please look into this?  

    Here is the file that fails to load (with the Start Segment Address record removed).

    (Sorry, still struggling to attach this file..will follow with the file when I can configure my post for rich text format...

  • Here's the zipped hex file generated by Energia that BSL Scripter fails to load.
    Thanks!

    simulator_scalar_R1_BSL.cpp.zip

  • Hi John,
    please try to upload the Intel Hex File that you are using, and I will look into that.
    Thank you!
  • I uploaded it in my last post as simulator_scalar_R1_BSL.cpp.zip

    Forum blocks .hex files.

    Thanks,  John Wygonski

  • Hi John,

    John Wygonski said:
    My question is, does this record, and the workaround you suggested, also set the contents of the RESET vector?  Otherwise the firmware could not start after reset, is my understanding correct?

    The reset vector is always included in the firmware image that is generated, either from Energia or other IDE. The reset vector location is on 0xFFFE. When you reset the device, the address includes on this reset vector, will be executed. So, the workaround using SET_PC 0x4400 should work. if you see the firmware image that you have, you got the reset vector of 0044 (it's flipped because the endianness of 16 bit representation.)

    :10FFF0004E6EC66F7644764476447644764400442A

  • Hi John,

    I will take a look on it and go back to you soon.
  • Hi John,

    I am sorry it took awhile to investigate this. I try some hex file from Energia, and I found Energia has different form of intel hex file compare to the IDE  (CCS) that I referred as the example during BSL Scripter development. We need to do an update to cover Energia example, including the PC register set that you bring earlier.

  • Thanksj for looking into this.   Could you estimate when a new release is coming out for BSL Scripter?

  • I believe the earliest scheduled update would be late January, but this is not yet finalized.

    Regards,
    Ryan
  • Hi John,

    the newest Scripter just been uploaded to the Web:

    http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPBSL_Scripter/3_02_01_00/index_FDS.html

    Please kindly try it on your side and let me know your feedback :)

  • Thanks for the notice!  I see that the new release has Intel HEX support.   I will try it out with Energia- generated files when I get back to that project.   And the release came out just when you said it would!

  • Hi John,

    but please notice the record type 03 is still not supported on this version. Just erase the second last line from generated-file and use SET_PC to 0x4400. Please let me know the result. :)
  • I tested the 3.2.1 release on my Energia-generated .hex file with success--thanks.

**Attention** This is a public forum