Skip to contentSkip to conversation

firmware problem

DISCUSSION Rodrigo Moya 3 participants 3 messages Jul 4, 2000 – Jul 5, 2000 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi all!

I am trying to put the firmware in the DOC, using the following command:

dformat /win:d000 /s:doc123.exb

and I get the following error message:

Format failed, Medium not large enough

Any idea on what's happening?

Thanks

To unsubscribe, send "unsubscribe mtd" to [email protected]

#1 lore raw

Rodrigo Moya writes ("firmware problem"):

Quoted 2 lines

dformat /win:d000 /s:doc123.exb
Format failed, Medium not large enough

You probably played around with MTD and either formatted the flash using the MTD nftlformat utility, or did some other thing which is equivalent to that. This somehow confuses M-Systems' utilities.

I am not aware of a good solution to this (once you could do "docpmap /e", which would have erased everything on the flash, including the Bad Block Table, which you are not supposed to erase, however it did enable you to reformat the flash. However since the 1.23 release, you can't do that anymore)

Signature · 7 lines
Dvir Oren               <[email protected]>
Lucid VON Ltd.     <http://www.lucidvon.com>
9 Saloniki St.,        Tel-Aviv       Israel
Tel:  +972 3 644 3038  Fax:  +972 3 644 3039


To unsubscribe, send "unsubscribe mtd" to [email protected]
#2 lore raw
In reply to Rodrigo Moya

This is pretty much a big pain in the neck that I also ran into a while ago (can't remember the cause, though). Anyway, the only way I found to recover the flash was to erase the entire thing. The bad block table (made when the flash is manufactured) could probably be saved somewhere, but I never coded it up because I don't know the location or format. Anyway, you can use the attached utility (a modified version of util/erase.c which erases all the flash, not just a single block). We should definitely look into adding support for saving the bad block table, though.

-Patrick

Quoted 11 lines · Rodrigo Moya

Hi all!

I am trying to put the firmware in the DOC, using the following command:

dformat /win:d000 /s:doc123.exb

and I get the following error message:

Format failed, Medium not large enough

Quoted 8 lines

Any idea on what's happening?

Thanks

To unsubscribe, send "unsubscribe mtd" to [email protected]

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <time.h>
#include <sys/ioctl.h>
#include <sys/mount.h>

#include <linux/mtd/mtd.h>

int main(int argc,char *argv[])
{
mtd_info_t meminfo;
int Fd;
unsigned long Length;

  if (1 >= argc)
    {
      fprintf(stderr,"You must specify a device\n");
      return 16;
    }
  
  // Open and size the device
  if ((Fd = open(argv[1],O_RDWR)) < 0)
    {
      fprintf(stderr,"File open error\n");
      return 8;
    }
   if (ioctl(Fd,MEMGETINFO,&meminfo) == 0)
     {
       erase_info_t erase;
       printf("Device information:\n");
       printf("Name: %s\n", meminfo.name);
       printf("Type: %d\n", meminfo.type);
       printf("Flags: %d\n", meminfo.flags);
       printf("Size: %d\n", meminfo.size);
       printf("Erase size: %d\n", meminfo.erasesize);
       printf("OOB block: %d\n", meminfo.oobblock);
       printf("OOB size: %d\n", meminfo.oobsize);
       printf("ECC type: %d\n", meminfo.ecctype);
       printf("ECC size: %d\n", meminfo.eccsize);
       
       erase.length = meminfo.erasesize;
       erase.start = 0;
       
       printf("Erasing...", erase.start);
       while (erase.start < meminfo.size)
	 {
	   fflush(stdout);
	   
	   if (ioctl(Fd,MEMERASE,&erase) != 0)
	     {
	       perror("\nMTD Erase failure");
	       close(Fd);
	       return 8;
	     }
	   erase.start += erase.length;
	 }
       printf("done\n");
     }

return 0;
}