JTAG Interfacing With The ST40
JTAG Interfacing With The ST40
The new low cost ST Micro Connect Lite interface (STMC Lite is an ST Microelectronics trade name) (still a
ghost on the market) (see pdf in the last ST Micro Connection package 1.6.0) uses the FTDI FT4232H mini
USB module.
That module is rather cheap (about 50 USD) and easy to buy.
The FT4232H is a USB to 4 ports module handling the basic jtag lines on ports A and B
and virtual COM port on ports C and D.
ST uses the standard drivers with that module.
You can also use the 2 ports version, the FT2232H/L module, as the two FT4232H extra ports are not really
necessary.
http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf
http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_FT2232H_Mini_Module.pdf
1.2 Wiring the module
First thing to do is to solder that module on a breadboard and connect the power lines as mentioned in the
FTDI documentation. This module is sold fully assembled as shown on the picture above.
That module can of course be USB powered and the internal voltage regulator delivers 3.3V for the external
IC's.
USB Bus-powered:
1) Connect VBUS to VCC (CN3, pin 1 to CN3, pin 3). This connection takes the power from the
USB bus (VBUS) and connects it to the voltage regulator input on the FT4232H Mini Module. The
voltage regulator, in turn, provides V3V3, VPLL and VUSB power inputs to the FT4232H chip.
2) Connect V3V3 to VIO (CN2, pins 1, 3 & 5 to CN2, pins 11 & 21 and CN3, pins 12 & 22).
This connection provides the correct 3.3VDC operating voltage for VCCIO on the FT4232H chip.
Once the module is correctly wired, it can be connected to a PC and normally it would install the drivers
without any problem.
There are two side plugs (2 X 26 pin) that allows the user to connect whatever he want depending upon the
application. If you do not want to etch a PCB, you have to use a breadboard (copper around each hole) easy
to find in an electronic shop.
As you can see on the second picture, the only thing to do is to solder 2 female 26 pin connectors in order to
plug in the module and one connector for your jtag connection.
(Depends upon your STB configuration, 14 pin, 20 pin ...)
(If you want you may even solder the 2X 26 pin plugs if it's too
difficult to find the female connectors.)
The rest of the job is to wire the connections between the
module and the jtag connector.
Not very difficult: there are 16 wires to solder on my
experimental board. (keep them short)
It can be done even with a plumber soldering iron!
Here is the final JTAG wiring for the ST40/STB71xx and the
picture of that very simple interface. (A breadboard, 2 sockets, a JTAG connector and that’s it.)
1.3 The “CLONE” schematic and port A to JTAG wiring
The JTAG signals shown here above have to be wired to a 20 pin JTAG connector as shown below.
(20 pin connector on the left side of the picture)
Please note that the pull down and pull up shown are usually located on the box board.
You should verify if these resistors are existing on your board.
If not, add them on the jtag board. It’s also a good idea to add a LED with a 470R resistor in series
between 5Vcc and GND to show that the board is active.
Please note that PORT B can also be wired as port A but using a 14 pin JTAG connector (see STMC lite pdf
in the Targetpack package or STLinux 2.4 package.)
Port C and D can be used as RS232 virtual com ports via MAX3232 logic level interfaces.
debugging via rs232 terminal).
Here is a picture of the wiring side. (I’ve used a little 4 pins connectors (green and black‐gray wires) near
the module to make experiments with the nRST and nTRST wiring, but this option is not necessary.)
It’s a good idea to add a 10uF 10V tantalium capacitor between the USB 5V cc power pins on the
interface side. (noise reduction)
In order to convert that module into an ST Micro Connect Lite interface, you need to change the SUB
descriptors in the module EEPROM. This allows the module to automatically load the ST driver and
descriptors when the USB module is connected to a PC.
This can be easily done by using the MPROG utility from FTDI.
You can download that utility from the FTDI website :
http://www.ftdichip.com/Support/Utilities/MProg3.5.zip
To use that utility, you have first to connect the module to your PC and load the original FT drivers,
especially the FTD2XX driver.
Once the drivers are fully installed, you may launch the MPROG utility and change the descriptors and
options (right side) as shown below.
You could personalize your Fixed Serial Number by changing the four digits serial number to whatever you
want.
The STMCLTxxxx name will be used to address the interface when using the STLinux package or the ToolSet.
I’ve added the MPROG template in ANNEX 1 that can be used to change the options (click on File, load, and
load the template..
Paste the template into a text file and save it with the .ept suffix.
Once the template loaded, click on Device and Program to burn that template into the eeprom.
Once the drivers are installed, connect your module and the drivers should automatically be installed.
You may verify this using the Windows device manager under Windows :
Under Linux (it’s better to use Fedora 14 + updates for compatibility reasons), install STLinux 2.4
( www.stlinux.com )and fully update the package with stmyum after installation, otherwise the new STMC
Lite drivers will not be installed.
4‐ The STburner utility
If you don’t use U‐BOOT (see STLinux), you may use the STBurner utility (download from the forum or PUDN)
Decompress that utility in the TS examples directory and make the following modifications to the files
mentioned hereafter:
build.mkf
Remove the + sign before = in build.mkf lines 23 and 24 (generates a macro error during compilation)
flasher.c
warning line 783 ‐ string too long ‐ OK need not be modified
flashutil.c
warning line 2162 Spanion not used ‐ OK need not be modified
Added:
poketable.h into the stburner directory (needed with mb442)
memory_mb442xxxx.x files into the stburner directory (needed with mb442)
These files can be found in the examples/os21/romxxxx examples.
flasher.h
added MW39W320DT device in the device list (see other similar flash descriptions in the same file)
(flash in the Homecast HS5001 CI)
flashutil.c
added device ID 0x22ca and blockinfo for M29W320DT flash chip
(see other similar flash descriptions in the same file)
Connect your interface to your target and switch the target board ON.
Run the following command to test your installation with no risk for your flash :
The sh4xrun –a option is to be used when you need to add arguments to the executable.
The –c sh4tp tells sh4xrun to use the targetpack manager.
This will dump the flash rom content to a file named romdump.bin saved in the stburner directory.
If you want to see the stburner options, just type the following command which will show you the burner
usage options.
Screen output :
flasher:
Usage: flasher [‐t <target board>]
[‐p <binary or hex image>[@<binary_base_address>]] |
[‐r <binary image>] |
[[‐v <bootvector image> [‐v...]]
[‐s <bootstrap image> [‐s...]]
[‐fs <fail‐safe image>]
[‐i <application image>[@<slot>] [‐i...]]
[‐d <slot> [‐d ...]]
[‐b <slot>]
[‐bootsep]]
[‐f <option file>]
[‐e]
Remark :
To verify if your interface is OK, you could compile the “Hello World” simple example in the
examples/bare/getstart directory:
make clean
make TARGET=mb411stb7100
#######
ANNEX 1 : The .ept template for MPROG. (Paste it into a text file saved with the .ept suffix)
[Basic Details]
Device Type=10
VID PID Type=2
USB VID=0483
USB PID=3747
[USB Power Options]
Bus Powered=1
Self Powered=0
Max Bus Power=200
[USB Serial Number Control]
Prefix=FT
Use Fixed Serial Number=1
Fixed Serial Number=STMCLT1000
[USB Remote WakeUp]
Enable Remote WakeUp=1
[Windows Plug and Play]
Enable Plug and Play=0
[USB String Descriptors]
Manufacturer=ST
Product=ST Micro Connect Lite
[Programming Options]
Only Program Blank Devices=0
[BM Device Specific Options]
USB Version Number=0
Disable Serial Number=0
IO Pin Pull Down in Suspend=0
[Dual Device Specific Options A]
RS 232 mode=1
245 FIFO mode=0
245 CPU FIFO mode=0
OPTO Isolate mode=0
High Current Drive=0
[Dual Device Specific Options B]
RS 232 mode=1
245 FIFO mode=0
245 CPU FIFO mode=0
OPTO Isolate mode=0
High Current Drive=0
[Dual Device Driver Options A]
Virtual Com Port Driver=1
D2XX Driver=0
[Dual Device Driver Options B]
Virtual Com Port Driver=1
D2XX Driver=0
[R Device Specific Options]
Invert TXD=0
Invert RXD=0
Invert RTS#=0
Invert CTS#=0
Invert DTR#=0
Invert DSR#=0
Invert DCD#=0
Invert RI#=0
C0 Signal=‐1
C1 Signal=‐1
C2 Signal=‐1
C3 Signal=‐1
C4 Signal=‐1
Enable Ext Osc=0
High Current I/O=0
Load D2XX Driver=0
In EndPoint Size=0
[DualHS Device Specific Options]
IFAIsFifo7=0
IFAIsFifoTar7=0
IFAIsFastSer7=0
AIsVCP7=1
IFBIsFifo7=0
IFBIsFifoTar7=0
IFBIsFastSer7=0
BIsVCP7=1
IOPinDriveDual=0
UTMIDrive=0
UTMIVendor=0
SuspendOnD7Low=0
[QuadHS Device Specific Options]
AIsVCP8=0
BIsVCP8=0
CIsVCP8=1
DIsVCP8=1
ARIisTXDEN=0
BRIisTXDEN=0
CRIisTXDEN=0
DRIisTXDEN=0
IOPinDriveQuad=13107