Programming LPC/FWH flash SST49LF016C using Raspberry PI

My friend screwed up Panasonic CF-U1 BIOS. The BIOS was locked with password and after a BIOS reflash, the computer was asking for password on startup too. We obtain an original BIOS image from manufacturer, but there was no way to program it.

Hardware part

We took the chip out of computer, glued the chip with tape to thick white paper and marked the pin signals and numbers on borders of paper. Then we solder thin wires (from stranded wire) to pins we need to program the chip and using the tape, we secure them to the labels. It is better to use the tape after soldering every wire, because is difficult to make the soldering good and the joints will tear off after few bends.
SST49LF016C on breakout board
Now we need to connect the chip to Raspberry PI. We use old 40-pin ATA cable for this. It perfectly fits the Raspi GPIO connector. We cut one connector, leaving only one connector and about 30 cm long cable. Separated the wires for example with multiple of 5 (for better counting). Solder the wires to the "breakout board". After soldering each pin we use the tape to secure it on paper.
We use following table of connections:
MnemonicChip
Pin No
Raspi
GPIO Header
Pin
Raspi
GPIO
Logical No
VSS249GND
ID0-ID317,18,19,209GND
GPI0-GPI414,13,12,11,69GND
VDD3017+3.3V
INIT#3217+3.3V
RST#1011GPIO 17
LAD02115GPIO 22
LAD12216GPIO 23
LAD22318GPIO 24
LAD32522GPIO 25
LFRAME3113GPIO 27
LCLK712GPIO 18
WP# + TBL#15,167GPIO 4
Don't forget to put 0.1uF capacitor close to the chip VSS and VDD pins (it is really necessary).
Flat cable connected to breakout board and Raspi
Close up of flat cable connections

Software part

Software for erasing, programming, reading and verifying is written in C. It is compiled using gcc directly on Raspberry PI. Software is using wiringPI library for working with GPIO. Follow direction on wiringPI page for installing.

Project files are stored on my Google Drive: Browse Project Files

Compiling is done in shell with command:
$ gcc flasher.c -l wiringPi -o flasher

Output is binary file with name flasher. We can run it with command and it prints parameters:
$ ./flasher
SST49LF016C flash programmer
Usage: ./flasher parameters
Parameters:
 -w                Write to flash (flash is not erased)
 -e                Erase flash sectors before writing (sector size is 4KB, erases all sectors in writing range)
 -r                Read the flash
 -v                Verify the flash
 -f filename      Specifies file for writng, reading, verifying
 -s hex (32-bit)  Sets start address (hex)
 -o hex (32-bit)  Offset in file - Seeks in input file before operation
 -l hex (32-bit)  Length (how much bytes will be written, read)
 -b hex (8-bit)   Block size (allowed sizes are RW:0x1,0x2,0x4; R:0x10,0x80
 -cW hex (8-bit)   Chip Command for writing (default 0x40)
 -cR hex (8-bit)   Chip Command for reading (default 0xff)

Reading memory:
$ sudo ./flasher -r
Starting address 0x400000
Length 0x4
Block size 0x4
Command for Writing 0x10
Command for Reading 0xff
Preparing pins
Reading
00400000: 4d 45 49 5f MEI_

Writing memory:
$ sudo ./flasher -e -w -v -f R12-0022.U12 -b 0x4 -s 0x400000 -l 0x200000
File specified with -f is binary image. Filename R12-0022.U12 was original filename of BIOS image (in our case).

11 comments:

  1. Hello There! - Did you manage to successfully unlock the Supervisor password by SPI refreshing this chip? - I have done exactly the same!

    I have SPI flashed a dead bios before, but panasonic will not send me the CF-U1 flash file! - I was on v2.01 L14 M21 if this is the same as yours! - Any help would be greatly appreciated!

    JG

    ReplyDelete
  2. Hi, here is Tomas, Bugy's colleague [owner of CF-U1]. Sorry for terrible english.

    Yep, we removed password. After long writing with Panasonic support center, i get an BIOS file. We burned full image to chip, but, by this way, BIOS lost all info [serial number, model, ... ]. This was cause BCD reader, GPS/3G card and others peripherals to be not functional due to model number.

    This was be fixed by reburn the boot block of BIOS by original block downloaded before i screwed up. Password was be removed, model/SN OK, BUT, i screwed up the BIOS password again! My CF-U1 have two GPS, one in Ericsson 3G card, and secondary [Leadtek] card. Leadtek card was not work. I selected 'Load default values' in BIOS, and the BIOS asked for password again. By Panasonic support, there is no default password. Why BIOS is asking for password?? Really nice, my CF-U1 is now unusable, until we again reburn the BIOS.

    Please, contact me on mail xtm1[at]azet.sk for more info about BIOS, procedures, models, ... .

    Tomas

    ReplyDelete

  3. Hi, if not hard, can you send the bin firmware file, could you delete the password?

    ReplyDelete
  4. I'm trying to flash a PMC flash Pm49FL004T bios chip using what you've wrote, and currently it returns 'TAR0 not all ones' on any action, be it reading or trying to write. That chip is also a LPC flash, so I thought that it might be compatible, too, but as it turns out it isn't :(

    Do you know what might be the problem? Is LPC on your chip not the same LPC as on mine, and I'd have to rewrite your program to support it? Or it should be the same, and the problem lies elsewhere?

    ReplyDelete
  5. Ahoj, potreboval bych nafleshovat 49LF004A, bohuzel je FWH a ne jako v tvem pripade LPC. Mohl by jsi modifikovat tvuj flasher aby byl kompatibilni s FWH?

    ReplyDelete
    Replies
    1. Tak jiz netreba. Modifikaci jsem zvladl sam. Kazdopadne dekuji za zverejni zdrojovych kodu, od piky by se mi to nechtelo programovat.

      Delete
    2. Ahoj. Velke sorry, s kolegom sme uplne zabudli na tuto stranku. Sme radi ze pomohlo :)

      Tomas

      Delete
  6. Hi!

    I would like to get access to that Google Drive folder with the source code. I need to flash a Pm49FL004T, which is an LPC/FWH/parallel 3-mode flash chip.
    The link is currently returning that I have no access.

    Alternatively, can you upload the code to GitHub?

    Thanks,
    Gábor

    ReplyDelete
  7. Hi, this should work with a Raspberry Pi B+ and a Winbond W39080 PLCC32 BIOS chip?

    ReplyDelete
    Replies
    1. Hello. I am not sure. This project was created and tested for flash memory SST49LF016C, and whole project is based on SST49LF016C memory specifications from datasheet (pinout, timing, config, ... ). Testing, tuning and debugging was take more than 2/3 of work time. Rest of time was HW build, programming of whole project skeleton, ... . Pinout seems to be same (32L STSOP). You can try to connect it to RPi and try to read data. Maybe you will must fine-tune timing. I'm so sorry that I can't help you more right now :( Please inform me on mail xtm1[at]azet.sk if you need anything else or just if you was success :) Tomas

      Delete