Info on BSL flashing for TI MSP430G Value Line processors  - Page 1
Forum section: electronics / general

author: Peabody
author_rank: Super Contributor
timestamp: December 23, 2017, 05:08:21 pm
content: I don't know if there's much interest here in TI's MSP430G Value Line processors (still available in DIP), but in case it might be useful to some, I've put some information about flashing firmware updates to these chips using BSL into a Github repository:https://github.com/gbhug5a/MSP430-BSLA detailed description of what's involved is in the long-winded PDF file. This project was prompted by the idea of embedding a CP2102 USB-to-Serial adapter in a project's circuit rather than hooking one up through a pin header, or using the Launchpad for JTAG flashing. So all you would need to flash new firmware is a USB cable. The PDF deals with the much-despised BSL password in the G2553 ROM-based BSL, and offers a couple ways around it, including special boot code that fits entirely in the INFOA segment along with the existing calibration data, and lets you run BSL with INFOA protected from erasure, which means you can flash new firmware without knowing the password, and without erasing the calibration data.There's also a complete custom BSL system for the lowly G2231, which has no built-in BSL. Included are installers for the chip and the PC software to drive the process. And there's a discussion of circuit design for using embedded adapters or modules containing them, and some of that might be useful for other MCU brands.The installers for the chips use the Naken assembler, and the PC software uses the LCC compiler. But the repo includes both the source code and the executables for everything, so assembler-phobes like Dave can just install the hex files.There are two small bonuses - a VBScript for Windows that converts an IntelHex file to TI-TXT format, and as part of the BSL installation for the G2231, the calibration values for 8, 12 and 16 MHz are derived from the existing 1 MHz calibration value, with no crystal required, and saved in the usual places in INFOA (based on original work by Steve Gibson).I did the original work on this for a project, and decided I might as well write it up in case it might be useful to others at some point. The Value Line processors are kinda old school now, but are still available in DIP, and are still pretty popular. And the circuit design portion may be more generally useful.Of course I'd like to know about any bugs or errors you may find.Finally, for those who may be interested, I confirmed that it is possible to setup and populate a Gitbub repository online using your browser without installing any version of Git on your computer. Not all the fancy versioning stuff, but for material like this that isn't going to change, that works well enough.

author: westfw
author_rank: Super Contributor
timestamp: December 24, 2017, 08:12:25 am
content: Neat; looks very useful...Apparently there are some new revisions of the CH340 chip that don't require a crystal:CH340C:https://www.aliexpress.com/store/product/1PCS-CH340C-module-USB-to-TTL-serial-Alternative-CH340G-NOT-Need-Crystal-Model-CNT-006/213957_32818641789.htmlCH340E:https://www.aliexpress.com/store/product/1PCS-CH340E-USB-to-TTL-Serial-Converter-5V-3-3V-Universal-Not-need-switching-Model-BTE17/213957_32821571106.html

author: Peabody
author_rank: Super Contributor
timestamp: December 24, 2017, 03:12:12 pm
content: Thanks. That's good info on the CH340 chip. That means all three major brands now have no-crystal versions. I picked the CP2102 for my work, but really any of them should work fine. And I continue to be amazed at how cheap all this stuff is.I just wish they were a bit better behaved when powered down. In my testing all of them sink current on all pins when powered down, which complicates things a bit when you're embedding them if they're sharing MCU pins with other functions. I ended up using a hex buffer that tri-states when powered down, but it would be nice if the adapter chips could do that to begin with, particularly on the regulated 3.3V output, and on DTR which is connected to the MCU's /Reset pin.