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.

MSP430 Flasher: File Data Error when using hex file of MSP-Gang Programmer on LaunchPad to program MSP430F5438A

Other Parts Discussed in Thread: MSP-GANG, MSP430F5438A, MSPDS, MSP430F6779A, MSP-FET, MSP-EXP430F5529LP, MSP-EXP430FR5969

I am a bit of a nubee, but I use LaunchPad and MSP430 Flasher to program MSP430F5438A successfully with 23kB Bootloader hex file via SBW and works fine.  Problem is Flasher reports error 59 File Data Error when I try to program complete MSP memory using 727kB hex file successfuly used by another group with MSP-Gang Programmer.  Is there some limitation of low cost Flasher versus MSP-Gang flash utility or is what I am trying to do totally reasonable?  Or does MSP-Gang use file type-format incompatible with the LaunchPad MSP430 Flasher utility.  I cound not find source code in Flasher download for MSP430_VerifyFile(const char* File) function which might lead me to what Flasher is complaining about.  Suggestions ?

  • Hi Brett,

    I'm assuming that the 727kB is the size of the file in Windows, and not the size of the data being programmed into the part (because that would be too big).

    1. What file extension is the hex file that the other team uses with the MSP-GANG? Is it .txt, .hex, or something different? Can you find out how the other group generated this file (did they use CCS or IAR to generate the hex file? or do something different?)

    2. Which version of MSP430Flasher do you have? I'm seeing in the readme some fixes that might be related (e.g. "- Fixed a bug where upper case file extensions would not be recognized properly". )

    The MSP-GANG typically programs from a standard TI-txt or Intel-hex file format generated by CCS or IAR, just like the MSP430Flasher. However the MSP-GANG also has some modes like "from image" where you can use an MSP-GANG image that includes not just this binary file but also some other programming settings, but these files have types like .mspgangbin or something and look different.

    For MSP430_VerifyFile() I can see that this function is coming from the library MSP430.dll which is why you are not seeing the source in there. However we do release the MSP Debug Stack Developer's Package (MSPDS) with an open source version you could try looking in - that has files that build to create that DLL.

    Regards,

    Katie

  • Katie:
    Thanks for replying -- I received the answers to your questions from the other group, and yes, the size is the Windows size of the file.
    1. The file is .hex extension and they sent me screen shots of the MSP-GANG sw settings as they setup for the memory read (which I do not know how to attach to this forum blog), so here are the settings --> SW is TI/Elprotronic Inc., Setup|JTAG/SBW Interface, SBW|Slow, SBWDATA line|via TDIO, COM PORT speed is 115.2kb/s, MCU set to match our MSP430F5438A, Target 3.3V, SBW (Med), PC COM then they click READ and save as .hex file. They then can load .hex file into MCU with Mode|Interactive, Open Code File|click GO.
    2. I believe I have MSP430Flasher version 1.3.4, but I need to confirm once I get my PC back from IT who is replacing battery which prevents booting when battery too low to maintain BIOS settings
    I did download MSPDS and am looking for the required libs and filename -- thanks, that could help understand the failure cause.

    New 3. Instead of using provided MSP-GANG .hex, how do I download complete MSP430 Memory with MSPFlasher when it requires separate memory locations BSL and MAIN downloads which must be "combined" into a single .hex manually ? Ihaven't tried yet, but I could try using start and end MEMORY hex values in the command line -- do you think this will work for entire memory image in a one shot ?
  • Hi Brett,

    You can attach an image in the forum by clicking on "use rich formatting" when replying, and then in the rich formatting editor you can drag and drop a saved .png/.jpg./.gif etc file into the reply.

    To me it seems odd that they are reading the memory out of the device to get the .hex file - aren't they using something to program this in the first place? If they use CCS or IAR, best practice is to generate a TI-txt or Intel-hex file from there and then use that to program with the MSP-GANG. Usually you aren't reading from one part to go program another - that seems a little odd. I'm just pointing it out because I think it would be easier to work with the source hex file they use to program the part.

    In any case, I took an MSP430F6779A device that I had on hand, used the MSP-GANG to read its memory contents and save them to a .hex file, and then used MSP430Flasher version 1.3.4 to program the device with that file, and I was able to reproduce your issue. I'll look into this further.

    Could they try saving the code they read out as TI-txt from MSP-GANG instead of .hex? (this is an option when you read the part) and you could see if that causes the same problem?

    Regards,
    Katie
  • It is good that my problem is repeatable and I appreciate you looking into it for us. We are having difficulty creating a single .hex from two individual CCS (free version) projects (Boot and FW are maintained separately) which is why we were forced down the odd route we are using. Do you have suggestions on CCS method to generate one single .hex from CCS under these circumstances ?
    I will ask the other group to save in TI format and send to us to try with our LaunchPad.
  • Which LaunchPad are you using to Flash F5438A? It is quite possible that the LaunchPad can only handle the Flash memory in the lower 64 KB.
  • We are using MSP-EXP430G2 Rev 1.5 due to the low cost.
  • Brett,

    Forget the TI-txt test - I believe I have figured out your problem. I realized that when I read out from memory using the MSP-GANG, it was including all MAIN, INFO memory and BSL memory and putting this in the .hex (or .txt file - both had same issue for me). Because of this, if you call "MSP430Flasher.exe -w Target_m.hex" you will have an issue, because the BSL area of memory is locked, but your code image contains BSL addresses. So instead, you need to use the -b switch to unlock BSL memory so that you can program it (see the MSP430Flasher user's guide in the _doc folder of the flasher download). So you would do "MSP430Flasher.exe -b -w Target_m.hex" and then for me it worked without giving me the error. I hope that this helps (along with the advice I gave above about combining files).

    Regards,
    Katie
  • Katie:

    I tried adding -b to my Flasher batch file and still had the same error -- I have attached a screenshot of my Flasher.  What could be different between your .hex and my .hex ?  I also tried adding -u but it did not work either.

  • Hi Brett,

    You mentioned that you are using the MSP-EXP430G2 Launchpad as your debugger. I have found that this is your root cause - this eZ-430 debugger does not officially support MSP430F5xx devices - it was not designed to and is not tested with them. Please see http://www.ti.com/lit/pdf/slau278 table 1-1, and the MSP-EXP430G2 user's guide. I can take my .hex file and load it with the MSP-FET just fine, but if I try the same .hex file with the same MSP430Flasher commands and try to use the MSP-EXP430G2 programmer, then I get error 59 exactly as shown in your window.

    You need to use a hardware programmer that supports your device. You could use MSP-FET, or one of the launchpads that has the newer eZ-FET or eZ-FET lite programmer on it, like the MSP-EXP430F5529LP or the MSP-EXP430FR5969. I tried one of these (MSP-EXP430F5529LP) and it works perfectly to program the part with 430flasher, just like the MSP-FET did. These launchpads do support F5xx devices - please see the MSP-EXP430F5529LP or MSP-EXP430FR5969 user's guides - these new Launchpads do support most MSPs (basically any MSP that has SBW).

    Regards,
    Katie

  • Thank-you for fixing this problem for us -- using MSP-FET430IF (and adding -b flag in command line) which we had here worked like a charm. We had all assumed the not-supported by LaunchPad was due to the pin count and package style of our device. Thanks again for all your efforts.
    Brett

**Attention** This is a public forum