0
\$\begingroup\$

I'm new with FT4232H. I just make for myself a FT4232H device with 4 channels UART. (Custom board for learning and researching)

And I want change channel A and B to JTAG for debugging STM32 using JTAG line.

My first question: Is FT4232H will automatically detect when I use JTAG? If not, how can I config it? If yes, is there anything I should do before it for it? (I have EEPROM in my FT4232H board)

My second question: How can I debug STM32 with JTAG using FT4232H? (I use STMCubeIDE).

\$\endgroup\$
6
  • \$\begingroup\$ You need a program which can provide a debug server to CubeIde side and can talk JTAG through FT4232 to target. Do you have such a program? Can OpenOCD do that? \$\endgroup\$
    – Justme
    Mar 31 at 13:51
  • \$\begingroup\$ @Justme I'm new to JTAG and don't use anything related to JTAG so I just do it by myself with it, l used SWD for a long time. The last time I read somewhere in ethernet it said it can do that. In CubeIDE it has the option for JTAG but it doesn't seem to work with FT4232H. \$\endgroup\$
    – Nhat Micls
    Mar 31 at 14:59
  • 1
    \$\begingroup\$ You need a piece of software between CubeIde and FT4323. CubeIde can use several pieces of debug servers and these debug servers may use any hardware they want or support to access the MCU. \$\endgroup\$
    – Justme
    Mar 31 at 16:02
  • \$\begingroup\$ @Justme I will try to find out it, thanks for info. \$\endgroup\$
    – Nhat Micls
    Apr 1 at 11:18
  • \$\begingroup\$ do you have the answer you need? Or are still open questions? \$\endgroup\$ Apr 4 at 21:32

2 Answers 2

0
\$\begingroup\$

The FT4232H datasheet contains the following in section 4.4 MPSSE Interface Mode Description:

MPSSE Mode is designed to allow the FT4232H to interface efficiently with synchronous serial protocols such as JTAG, I2C and SPI Bus. It can also be used to program SRAM based FPGA’s over USB. The MPSSE interface is designed to be flexible so that it can be configured to allow any synchronous serial protocol (industry standard or proprietary) to be implemented using the FT4232H. MPSSE is only available on channel A and channel B.

MPSSE is fully configurable, and is programmed by sending commands down the data stream. These can be sent individually or more efficiently in packets. MPSSE is capable of a maximum sustained data rate of 30 Mbits/s.

The datasheet contains links to:

  1. Application Note AN_108 Command Processor for MPSSE and MCU Host Bus Emulation Modes, which describes the MPSSE commands which can be used for JTAG.
  2. Application Note AN_110 Programmers Guide for High Speed FTCJTAG DLL which has the following in the introduction:

    The FTCJTAG DLL has been created to allow application developers to use the FT2232D, FT2232H and FT4232H devices to create a USB to Joint Test Action Group(JTAG) protocol interface without any knowledge of the MPSSE command set. All of the functions in FTCJTAG.DLL can be replicated using calls to FTD2XX.DLL and sending the appropriate commands to the MPSSE.

Where the above two should provide enough information to allow JTAG to be used, either by calling the FTDI FTCJTAG.DLL or at a lower level to send the raw MPSSE commands over USB.

As for configuration of the FT4232H EEPROM, Application Note AN_124 User Guide for FTDI FT_PROG Utility doesn't list a specific configuration option to select JTAG, but in section 5.9 FT4232H Hardware_Specific does contain:

Each channel can also be individually configured in synchronous or asynchronous bit-bang mode. See the FT4232H device datasheet (available from the Datasheets page of the FTDI website) for more information on these modes.

I don't have a FT4232H to hand, so can't run FT_PROG to confirm what options there are related to the MPSSE mode in the EEPROM settings.

\$\endgroup\$
1
  • \$\begingroup\$ Hi, I already read about this, but it seems not clear to me. I will try downloading FTCJTAGDLL and read careful about this. \$\endgroup\$
    – Nhat Micls
    Apr 1 at 11:20
0
\$\begingroup\$

Each channel of the FT4232H will default to UART mode and be visible as a virtual COM port but all channels can be addressed by the D2XX interface (FTD2XX.DLL). Part of this interface is the FT_SetBitMode which allows you to change the mode from channel A and B to MPSSE - which is basically a "give me the pattern to do the bit banging and I will take care of it" state machine. So if you want "speak" JTAG you can either use the MPSSE to build the interaction yourself (basically give instructions how to bit bang) or use the higher level FTCJTAG.DLL - which pass the instructions to the FTD2XX.DLL. So the FT4232H does not know what you are planning to talk but gives you the option to go into the fancy-bit-bang mode by a command. If you use FTCJTAG.DLL to open the device handle, it will take care of this step. The EEPROM allows you to make the channels only visible for D2XX by changing the driver from VCP to D2XX. This only helps to avoid other devices to accidentally trying to address e.g. CH A as a UART via the VCP but does not change the general usage for your application.

The second part about how to integrate it is mostlike more suited for the partner side stackoverflow I guess.

EDIT1: I found https://electronics.stackexchange.com/q/626602 which might answer the second part.

\$\endgroup\$
2
  • \$\begingroup\$ As I understand, if I want to use JTAG in channel A/B so I should send a command via terminal that I want to use JTAG in channel A/B so it will change channel A/B to JTAG? And about FTCJTAG.DLL is used with other apps or is it used for sending commands to FT4232H? I still don't understand about this. \$\endgroup\$
    – Nhat Micls
    Apr 11 at 15:08
  • \$\begingroup\$ The D2XX.dll is used to interact with an FT device via the D2XX driver. Calling FT_SetBitmode from D2XX.dll with the correct parameters will change the mode of the device. Here it would be 0x2 for MPSSE. If the MPSSE is active one can send bitbang sequences to it. FTCJTAG.DLL is built ontop D2XX and takes care to generate the bit sequences required to mimic jtag. TL;DR: MPSSE is entered by a specific DLL call, MPSSE = fancy bitbanging, FTCJTAG=generator for jtag bitbanging patterns. \$\endgroup\$ Apr 18 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.