dlbeer / mspdebug

Debugging tool for MSP430 MCUs
GNU General Public License v2.0
184 stars 80 forks source link

Add basic support for JTAG over FTDI in bitbang mode #118

Open mon opened 2 years ago

mon commented 2 years ago

This does make some small architectural changes to the pif layer, but I hope it's acceptable.

Assorted notes

Further work will be to look into MPSSE for the FT4232H to increase speed more. The mspdebug backend seems inefficient (though reliable), especially since every state change, even those that can reasonably be batched, needs to written out over USB. I tried batching all writes unless TCK or RST was strobed, but it broke device identification - I suspect there's some early step that requires pin toggles to be synchronous.

Programming in general on the MSP430 architecture seems hugely inefficient. Each word takes over 16 bytes of instructions over the wire. I have yet to verify this, but I suspect the MSP-FET might upload a small bit of assembly to locally program data from RAM, then use the auto-incrementing RAM load feature to program the data in chunks.

mon commented 1 year ago

As an extra note - I have an alternate branch, ftdi-bitbang-dev that implements all of the above optimisations.

With these changes, programming time is on the order of 2 seconds. However, I'm not making a PR for it