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.

MSP430Flasher abort

Other Parts Discussed in Thread: MSP430FR4133, UNIFLASH

I'm running on Linux Mint 17.2, 64-bit. When I try to run the MSP430Flasher program using -e ERASE_SEGMENT, I get this:

% LD_LIBRARY_PATH=MSP430Flasher_1.3.6 MSP430Flasher_1.3.6/MSP430Flasher -w test.txt -e ERASE_SEGMENT
* -----/|-------------------------------------------------------------------- *
* / |__ *
* /_ / MSP430 Flasher v1.3.6 *
* | / *
* -----|/-------------------------------------------------------------------- *
*
* Evaluating triggers...done
* Checking for available FET debuggers:
* Found USB FET @ ttyACM0 <- Selected
* Initializing interface @ ttyACM0...done
* Checking firmware compatibility:
* FET firmware is up to date.
* Reading FW version...done
* Setting VCC to 3000 mV...done
* Accessing device...done
terminate called after throwing an instance of 'std::regex_error'
what(): regex_error
* Reading device information...Aborted

Searches don't indicate that anyone has seen this problem, unless I just missed them. Any idea what's wrong? It works without -e, but I really need the ERASE_SEGMENT functionality.

Thanks,
Aric.

  • Did you read and verified all the requirements under “Segment Erase”?

  • Thanks for replying, Leo. Which document are you referring to?
  • I see you are referring to the MSP430 Flasher Manual, which I didn't notice before. My test.txt file contains data that is less than a segment in size, so I don't think this is causing the problem.

    Nevertheless, we have used version 1.3.1 of MSP430Flasher in Windows to erase just the segments (plural) that are being written, and that's the functionality I am looking for. The Flasher Manual indicates that should not work, but it definitely has for us before. We need to be able to do what Code Composer Studio does when you select "Replace written memory locations, retain unwritten memory locations" from the command line.

  • This I’m using; “C:\TI\MSP430Flasher_1.3.4\MSP430Flasher.exe -n MSP430FR4133 -w "Release.txt" -v -g -z [VCC] -e ERASE_SEGMENT”.
    And works perfect until today. Difference is I have an older version and not using Linux, supply the MCU name and some options more.
  • If you do Internet searches for that std::regex_error message, you will find that it crops up in other places as well. It seems to be a problem with the GNU std::regex libraries and/or gcc.

    The MSP430Flasher code is using regular expressions to parse the input file (TI-TXT in my case) to determine the start address and length in bytes. I tried compiling MSP430Flasher with boost's regex library, but it did not determine the length of the data correctly, so I threw in some code I already had to determine the length in bytes of the data in TI-TXT files so it won't use regular expressions at all.

    I think there are much more efficient ways to determine length and start address than regular expressions. I ripped out all the regex code from MSP430Flasher, and the executable was less than half its usual size. Faster too.

    Anyway, the real fix for this needs to be in the std::regex code, not MSP430Flasher's code, as long as MSP430Flasher uses regular expressions.
  • You have deeply dug in.

    I do not know TI's strategy, there is now also a version of UniFlash for MSP, if it will replace MSP430Flasher I do not know. The current version of UniFlash is not free of problems and not very user friendly.

    It is a bad thing that MSP430Flasher is based on a failing library. But you now have a working version?
  • Yes, I have a working version. I've been using it for months with no problems. I'm surprised others have not run into this.
  • Leo passed away on November the 15th, 2015.

**Attention** This is a public forum