Author Topic: swiss army knife for serial connections  (Read 15276 times)

gogol

  • Sr. Member
  • ****
  • Posts: 398
swiss army knife for serial connections
« on: October 11, 2013, 08:08:09 am »
Recently I detected a very interesting device from FTDI: 

The UM232H-B-WE uses an FT232H chip on a small board, similar to the digispark, which plugs directly to the USB-port and has in the WE-Edition 18 cables, allowing to access different protocols via USB: UART, 245 FIFO, FT1248, I2C, SPI and GPIO.

As UART it gives a full 9-pin TTL-serial, which gives for example DTD (which is needed for some NANO-clones without USB-plug). Most USB to Serial-TTL deliver only TX and RX.

I used it already as well to read out SPI-flash-chips from some small routers with flashrom .  For that you need a recent version of flashrom and "flashrom -p ft2232_spi:type=232H,port=A" will do the job! Connection to the flash-chip follows that from openbiosprog-spi. (D0->SPI_SK, D1->SPI_DO, D2->SPI_DI, D3->SPI_CS, D4->SPI_WP, D5->SPI_HOLD)

Next thing I will try, is to use it for  I2C communication between PC and digispark.

You can get this cable for less than $15, it might be a perfect addition to toolbox.

regards

  gogol


gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: swiss army knife for serial connections
« Reply #1 on: January 17, 2014, 01:59:01 am »
See, how you can use that as an ON-Chip-Debugging Adapter to debug the digispark!
http://digistump.com/board/index.php/topic,1275.0.html

gogol

  • Sr. Member
  • ****
  • Posts: 398
Voltage questions
« Reply #2 on: January 27, 2014, 11:51:40 pm »
As in other threads the voltage question arised, here the most important sentence from the document:

All signals on these modules operate at +3.3V voltage levels, however all I/Os are 5V tolerant!

The mentioned 5V in the document are those on the red cable (5V-pin), which comes directly from USB and is therefore 5V.

As all Pins are 5V tolerant, you can connect the cable to 3.3 and 5V devices without problems. However don't power 3.3 Volt devices from the 5V cable without voltage regulator.

For flashing SPI chips with openwrt i just used an Arduino as 3.3 Volt source for powering the chip and connected the cable only with ground.


FTDI sells for higher prices 4 variants of that cable:
http://www.ftdichip.com/Products/Cables/USBMPSSE.htm

C232HM-EDHSL-0: has only the 8 MPSSE HIGH-speed pins broken out as well GND and +5V
C232HM-DDHSL-0: has only the 8 MPSSE HIGH-speed pins broken out and GND and an additional voltage regulator, so red has +3.3V

C232HD-EDHSP-0: has only the 8 low speed serial ports broken out as well GND and +5V
C232HD-DDHSP-0: has only the 8 low speed serial ports broken out as well GND and an additional voltage regulator, so red has +3.3V

They have a nice USB Plug instead the bare PCB, but each of the offers just half of the UM232H-B-WE

The only hint from those 4 cables is, that the MPSSE versions have only 50cm cable, instead 1.8m of the serial variant. That tells, that you should try to keep high-speed cables even shorter ;-)


greekhero

  • Newbie
  • *
  • Posts: 4
Re: swiss army knife for serial connections
« Reply #3 on: February 03, 2014, 09:45:39 am »
Hello Gogol, thanks for all the pointers. Here is what I have:

1. The UM232H-B-WE (one you have)

2. Macronics 25L3205D Flash (which is supported by flashrom), which also supports the FTDI device #1 above.

3. I have wired the flash (25L3205D) using the pin layout you mentioned:
Mapping         Macronics (25L3205D) pins (http://www.macronix.com/Lists/DataSheet/Attachments/1534/MX25L6405D,%203V,%2064Mb,%20v1.5.pdf page 4)
D0->SPI_SK      6
D1->SPI_DO      2
D2->SPI_DI      5
D3->SPI_CS      1
D4->SPI_WP      3
D5->SPI_HOLD      7

GND      4
VCC      8 (I am using a voltage divider that provides 3.13 volts from FTDI 5V)

4. When I use flashrom with command line: flashrom -p ft2232_spi:type232H, flashrom replies with "Found Generic flash chip "unknown SPI chip (RDID)" (0 kB, SPI) on ft2232_spi.

From what I know flashrom does support it (http://flashrom.org/Supported_hardware) so I am not sure if there are issues with pin match or some other issue.

Thanks,


gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: swiss army knife for serial connections
« Reply #4 on: February 04, 2014, 05:07:57 am »
As flashrom is not complaining about the programmer, I assume that you have a recent version.  I have right now v0.9.7-r1757 running, so all my answers are related to that version.

Right now I have extracted the flash from an HLK-RM04 Wifi Module.

I have enclosed a picture with my PIN-connection.

Entering the command
./flashrom -p ft2232_spi:type=232H,port=A -V
gives me the following output:

Code: [Select]
flashrom v0.9.7-r1757 on Linux 3.2.0-58-generic-pae (i686)
flashrom is free software, get the source code at http://www.flashrom.org

flashrom was built with libpci 3.1.8, GCC 4.6.3, little endian
Command line (3 args): ./flashrom -p ft2232_spi:type=232H,port=A -V
Calibrating delay loop... OS timer resolution is 6 usecs, 1437M loops per second, 10 myus = 12 us, 100 myus = 97 us, 1000 myus = 897 us, 10000 myus = 9907 us, 24 myus = 27 us, OK.
Initializing ft2232_spi programmer
Using device type FTDI FT232H channel A.
FTDI chip type 1 is not high-speed.
Set clock divisor
MPSSE clock: 12.000000 MHz, divisor: 2, SPI clock: 6.000000 MHz
No loopback of TDI/DO TDO/DI
Set data bits
The following protocols are supported: SPI.
Probing for AMIC A25L05PT, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for AMIC A25L05PU, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
[... some lines deleted, as posting is otherwise too long ]
Probing for Macronix MX25L512(E)/MX25V512(C), 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L1005(C)/MX25L1006E, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L2005(C), 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L4005(A/C), 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L8005/MX25V8005, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L1605, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L1605A/MX25L1606E, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L1605D/MX25L1608D, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L1635D, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L1635E, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L3205(A), 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L3205D/MX25L3208D, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L3206E, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L3235D, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L6405(D), 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L6406E/MX25L6436E, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L6445E, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25L12805(D), 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25U1635E, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25U3235E/F, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix MX25U6435E/F, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25P05-A, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25P05, 64 kB: Ignoring RES in favour of RDID.
Probing for Micron/Numonyx/ST M25P10-A, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25P10, 128 kB: Ignoring RES in favour of RDID.
Probing for Micron/Numonyx/ST M25P20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25P20-old, 256 kB: Ignoring RES in favour of RDID.
Probing for Micron/Numonyx/ST M25P40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25P40-old, 512 kB: Ignoring RES in favour of RDID.
Probing for Micron/Numonyx/ST M25P80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25P16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25P32, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25P64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25P128, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25PE10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25PE20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25PE40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25PE80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25PE16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25PX80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25PX16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25PX32, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M25PX64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M45PE10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M45PE20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M45PE40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M45PE80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST M45PE16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST N25Q016, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST N25Q032..1E, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST N25Q032..3E, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST N25Q064..1E, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST N25Q064..3E, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST N25Q128..1E, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Micron/Numonyx/ST N25Q128..3E, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Nantronics N25S10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Nantronics N25S20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Nantronics N25S40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Nantronics N25S80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Nantronics N25S16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for PMC Pm25LD256C, 32 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for PMC Pm25LD512(C), 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for PMC Pm25LD010(C), 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for PMC Pm25LD020(C), 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for PMC Pm25LD040(C), 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for PMC Pm25LV512(A), 64 kB: probe_spi_res3: id1 0x1515, id2 0x15
Probing for PMC Pm25LV010, 128 kB: probe_spi_res3: id1 0x1515, id2 0x15
Probing for PMC Pm25LV010A, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for PMC Pm25LV020, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for PMC Pm25LV040, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for PMC Pm25LV080B, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for PMC Pm25LV016B, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Sanyo LE25FW203A, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Sanyo LE25FW403A, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Sanyo LE25FW418A, 512 kB: probe_spi_res2: id1 0x15, id2 0x15
Probing for Sanyo LE25FW806, 1024 kB: probe_spi_res2: id1 0x15, id2 0x15
Probing for Sanyo LE25FW808, 1024 kB: probe_spi_res2: id1 0x15, id2 0x15
Probing for Spansion S25FL004A, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Spansion S25FL008A, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Spansion S25FL016A, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Spansion S25FL032A/P, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Spansion S25FL064A/P, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Spansion S25FL204K, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Spansion S25FL208K, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Spansion S25FL116K/S25FL216K, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Spansion S25FL128S......0, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for SST SST25LF040A, 512 kB: probe_spi_res2: id1 0x15, id2 0x15
Probing for SST SST25LF080(A), 1024 kB: probe_spi_res2: id1 0x15, id2 0x15
Probing for SST SST25VF010, 128 kB: probe_spi_rems: id1 0xef, id2 0x15
Probing for SST SST25VF016B, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for SST SST25VF032B, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for SST SST25VF064C, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for SST SST25VF040, 512 kB: probe_spi_rems: id1 0xef, id2 0x15
Probing for SST SST25VF040B, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for SST SST25VF040B.REMS, 512 kB: probe_spi_rems: id1 0xef, id2 0x15
Probing for SST SST25VF080B, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for SST SST25WF512, 64 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for SST SST25WF010, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for SST SST25WF020, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for SST SST25WF040, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25Q80.V, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25Q16.V, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25Q32.V, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Found Winbond flash chip "W25Q32.V" (4096 kB, SPI) on ft2232_spi.
Chip status register is 0x00.
Probing for Winbond W25Q64.V, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25Q128.V, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25Q20.W, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25Q40.W, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25Q80.W, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25Q16.W, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25Q32.W, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25Q64.W, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25X10, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25X20, 256 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25X40, 512 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25X80, 1024 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25X16, 2048 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25X32, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond W25X64, 8192 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Unknown SFDP-capable chip, 0 kB: Parsing JEDEC flash parameter table... done.
Probing for AMIC unknown AMIC SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Atmel unknown Atmel SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Eon unknown Eon SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Macronix unknown Macronix SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for PMC unknown PMC SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for SST unknown SST SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for ST unknown ST SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Sanyo unknown Sanyo SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Winbond unknown Winbond (ex Nexcom) SPI chip, 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Generic unknown SPI chip (RDID), 0 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016
Probing for Generic unknown SPI chip (REMS), 0 kB: probe_spi_rems: id1 0xef, id2 0x15
Found Winbond flash chip "W25Q32.V" (4096 kB, SPI).
This chip may contain one-time programmable memory. flashrom cannot read
and may never be able to write it, hence it may not be able to completely
clone the contents of this chip (see man page for details).
No operations were specified.

Your chip should be supported, as it is listed in the output above:
Probing for Macronix MX25L3205D/MX25L3208D, 4096 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4016

So check your connection and retry!


gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: swiss army knife for serial connections
« Reply #5 on: February 04, 2014, 11:36:02 pm »
Now here the attachment with my connections in reduce image size ...

greekhero

  • Newbie
  • *
  • Posts: 4
Re: swiss army knife for serial connections
« Reply #6 on: February 06, 2014, 11:27:29 pm »
gogol,

Thank you very much for such a great guidance. I have been using a voltage divider to get the 3.3v from 5v and I think that may not be working properly. So, I think I would build a 3.3v regulated power and then use the 4.7k pull up resistors as you are using on hold/wp. That should make difference.

Will keep you posted.

Again, many thanks!