10 Feb 2009 @ 6:22 AM 

The BIOS Repair Wizard™ is a tiny, disposable circuit that allows you to quickly and easily repair the BIOS on a badly flashed computer system. This device is no longer being manufactured.



Needing to recover from a failed BIOS upgrade was an unfortunate turn of events in the HTPC case modification project. I had seriously considered returning the ASUS P5B motherboard for RMA but shipping costs, repair costs, and delay convinced me to look for a different solution. Luckily I stumbled across a couple of Web pages published by Martin Rehak. He wrote a fantastic utility called SPIPGM that can be used to program Serial Peripheral Interface (SPI) EEPROM devices using a parallel port cable. His program is based on designs from the AVRDUDE project by Brian S. Dean.

Summary

1. The first step in recovering from a botched flash is to build the EEPROM programming hardware.
2. Fetch a copy of SPIPGM2 from here and CWSDPMI from here.
3. Run SPIPGM2.EXE in a DOS environment.

To flash the bios I use the following parameters:
– CWSDPMI
– SPIPGM2 /i to make sure that the program can read my chipset and the cable is ok.
– SPIPGM2 /u to unlock the bios.
– SPIPGM2 /e to erase the bios.
– SPIPGM2 /s p5b.rom to flash the new bios (spipgm2 /p for most other motherboards).

The first step in recovering a botched flash is to build the EEPROM programming hardware.

I chose a simple design based on parts I had available. It was really tempting to rush through the assembly because the circuit is so simple. Even so, I can’t believe how many times I wired the wrong signals to the ribbon cable.

LPT   SPI
18 (GND) - 2 (GND/VSS)
7 (Data bit 5) -> 3 (CE/)
8 (Data bit 6) -> 4 (SCK)
9 (Data bit 7) -> 6 (SI)
10 (Acknowledge) <- 5 (SO)
~3.3V - 1 (VDD)


Using a continuity meter to verify each signal path, thrice, resulted in a circuit that matched the schematic.

SPI Project Board

External power is supplied by an HP Pavilion A6207C using its 4-Pin Molex hard drive connector which provides 5.2 volts (red wire) with no load. The SST25VF080B is able to write, program and erase, with a single supply of 2.7 – 3.6V. Microchip has a handy guide for performing the needed 5V to 2.7 – 3.6V conversion. The simplest approach is to drop the voltage across a series of diodes. Three 1N4148 high-speed diodes in series with a 4.7K load measured 3.3V. As expected each diode dropped the voltage by approximately 0.65V. Adding a fourth diode dropped the voltage to 2.8V. Three or four series diodes drop the source 5.2V enough to meet the requirements for this device.

A 1000uF capacitor levels the 3.3V power rail in the event of a heavy current draw from the SST25VF080B. The 22pF capacitor shunts high frequency noise in the power rail to ground. Finally, a bunch of 470 ohm resistors buffer the printer port against any short circuits caused by improper installation of the ribbon header.

Some have reported better success with 220 ohm resistors instead of 470 ohm. The value of these resistors is not critical. Their purpose is to protect the host controller hub from improper wiring. A short circuit will permanently damage the Southbridge so extreme care is needed. Not much to the circuit since all of the smarts are in the EEPROM programming software.

Next step is to run SPIPGM in a DOS environment.

The easiest way to launch DOS is to use a Bootable USB Key. The SPI flash program, DOS Protected Mode Interface (DPMI), UnZip, ASUS P5B BIOS, and binary compare CMP are all copied onto the USB Key. These applications and the original archive files take no more than 2.5MB.

Booting the USB flash-drive reveals the Windows Millennium OS!!! Ahhhhhhhh! I just had a horrible flashback where DOS 4 and and Windows 3.1 were the best Microsoft could offer. Extracting  UnZip, SPI, and DPMI then running SPIPGM results in partial success. SPIPGM recognizes the  SST25VF080B! Yay! Unfortunately, it fails to program the EEPROM :-(

A more detailed analysis reveals that SPIPGM reads the JEDEC ID, and the status register. It can also unlock the Block-Protection bits in the status register. Finally, it can erase the device once the block protection bits are cleared (by default they are set upon power-up). The first byte of memory is programmed and other bytes here and there but not consistently. Changing the SPIPGM clock duty cycle using the /d option makes no difference. More research is needed.

Enhanced SPIPGM is required to support SST25VF080B (the following code is already included in SPIPGM2.EXE).

Perusing the SST site for application notes uncovered a driver document. The SPIPGM source was located at CoreBoot! Comparing the source code identifies a significant difference. Operation code 0×02 is used by SPIPGM to program a page. The SST25VF080B driver code uses the same operation to program one data byte at a time. Adding a new function to program the EEPROM one byte at a time was fairly easy given the very modular code already in SPIPGM.C

int spi_slow_program( char *filename ) {
  DWord address = 0L;
  FILE *fr=fopen(filename,"rb");         // otevri soubor pro cteni
 
  if( fr == NULL ) {                     // pokud chyba, tak skonci
    printf( "ERROR: cannot open file %s\n", filename );
    return( -1 );
  }
  printf( "Programming with %s\n", filename );
  while ( fread( spi_do_buffer, 1, 1, fr ) == 1 ) {
    if( ( address % 32768 ) == 0 )
      printf("\n%08lx ", address );
    if( ( address % 1024 ) == 0 )
      printf( "." );
    spi_rw_byte(SPI_FLASH_WREN);
    SPI_CLR_CS;
    spi_rw_byte_no_cs(SPI_FLASH_PAGEPGM);
    spi_rw_byte_no_cs(((address &amp; 0xffffff) &gt;&gt; 16));
    spi_rw_byte_no_cs(((address &amp; 0xffff) &gt;&gt; 8));
    spi_rw_byte_no_cs(address &amp; 0xff);
    spi_rw_byte_no_cs((Byte) *spi_do_buffer);
    SPI_SET_CS;
    spi_rw_byte(SPI_FLASH_WRDIS);
    udelay(1000);
    address++;
  }
  printf( "\n" );
  fclose(fr);                            // zavri soubor
  return(0);
}

Compiling the code is straightforward using DJGPP. Fullly modified source can be found here.


Copyright (c) 2009 by R. Burke

Share
Posted By: Rick
Last Edit: 26 Aug 2011 @ 08:06 PM

EmailPermalinkComments (7)
Tags
 06 Feb 2009 @ 11:08 PM 

The BIOS Repair Wizard™ is a tiny, disposable circuit that allows you to quickly and easily repair the BIOS on a badly flashed computer system. This device is no longer being manufactured.



I had attempted to update my home theater computer with a BIOS file from the Taiwanese manufacturer. The file is loaded into chip A (SST 25VF080B), and tells chip B (Winbond W83627DHG) how to get the processor, chip C (Intel Wolfdale E8400), to load the operating system from the hard disk. Unfortunately something went horribly, horribly wrong … darn ASUS! When things go wrong with this file your computer becomes a very beautiful paperweight.

BIOS Chip Sequence

Fortunately I noticed a maintenance port next to the failed chip. Hmmmm … gears start to turn as I ruminate . And when you look up ruminate in the dictionary – no I was not chewing anything, especially not cud. Apparently the maintenance port can be used to fix the computer but the Taiwanese manufacturer keeps all the details secret. Oh well, time to put my electronics background to good use (after 20+ years counting) and reverse engineer the circuitry.

Serial Peripheral Interface Bus

SOI_J1

By hacking up a program from some Czechoslovakian dude I managed to transfer a new brain into the system. I had to use an on-line Czech to English translator. It came up with helpful gems like “Due to tomu, that to with SMD material spare ten within unauthorized reprint, altogether sink under expenses within making plus manaže?i nowmají several $ within superiors motorcars plus whore ;) .” I like how on-line computer translators decode the swear words.

Abby Normal

Google searching tells me that other people have had the same problem and some have not found a solution. It would be cool to build a cheap EEPROM programmer to sell on eBay for this situation.


Copyright (c) 2009 by R. Burke

Share
Posted By: Rick
Last Edit: 26 Aug 2011 @ 08:06 PM

EmailPermalinkComments (117)
Tags
 06 Feb 2009 @ 9:03 PM 

The BIOS Repair Wizard™ is a tiny, disposable circuit that allows you to quickly and easily repair the BIOS on a badly flashed computer system. This device is no longer being manufactured.



As part of a computer build process the components are assembled for testing outside the case prior to installation. This can save lots of time if there are any issues to troubleshoot, as it will be much easier to swap out parts than having all system components installed and bolted into a computer case. CPU, power supply, memory stick, video card, keyboard, mouse, and case switches are all connected. At this point the system should be ready to start up. Success is when the computer shows the BIOS screen.

Assembly Bench Test

Normally there is a sense of anticipation just after power is applied and the few seconds before the POST “beep” and then joyful relief when the BIOS shows the results of its hardware enumeration. For this occasion the CPU fan started but nothing else happened. Crap. Luckily this BIOS has a two digit LED POST. It indicated the startup sequence failed when trying to initialize  the CPU. 

XFX BIOS Code 18H

Posting goes as follows:
» post code C1 (Memory Presence / Base memory detect)
» post code C3 (Extend Memory / Turn on extended memory, cache initialization)
and lastly
» post code 18 (InitCPU / CPU ID and Initialize L1/L2 Cache) ** It gets hung here **

Hmmmmmm. This XFX 680i SLI motherboard had previously booted fine with a Conroe E6850. It appears the BIOS can’t handle the newer Wolfdale E8400 CPU.

A fateful choice: I decided to swap the  Wolfdale for a slightly less powerful, and older Conroe from a home office computer. Checking the BIOS version on the office ASUS P5B Deluxe showed that an update was required. No problem. I downloaded the BIOS file and used the ASUS Flash utility … well it failed.

After my computer rebooted, I had fans, and lights, but no POST, video, or BIOS screen. I removed the battery for a bit and reset the CMOS, but that didn’t change anything. Reading many posts on technical forums categorically advocate to “Never flash your BIOS from within windows!!!”. Lesson learned the hard way.

ASUS support reports the following to nosnhoj

More than likely you have blanked the bios chip. There isn’t anything you can do except send us the bios chip, which is removable, and send it to us to have it re-flashed. You can send the chip to:

Attn:Bios Dept
7100 Intermodal Dr, Suite A
Louisville, KY 40258

Please be sure to include a piece of paper with your return address, motherboard model number, which version of bios that you would like flashed, and a check  or money order made payable to ASUS in the amount of $5.00. If this is fine for you, then please send us the chip, we will receive the chip, update it, and send it back to you. From the time we receive the chip, and ship it back, it should take about 2-5 business days. It will shipped out FedEx Ground. If you need the chip faster, then please call us here at the helpdesk, 502-995-0883. Thank you!

Nice. But the P5B Deluxe BIOS is soldered to the motherboard. Sending the board back to the service depot for RMA requires payment for shipping and a lot of time.  Options?


Copyright (c) 2009 by R. Burke

Share
Posted By: Rick
Last Edit: 26 Aug 2011 @ 08:07 PM

EmailPermalinkComments (1)
Tags

 Last 50 Posts
 Back
Change Theme...
  • Users » 1
  • Posts/Pages » 76
  • Comments » 299
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight