2010-06-09 09:46:42     Problem with FAT filesystem

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-06-09 09:46:42     Problem with FAT filesystem

Markus Rankl (GERMANY)

Message: 90225   

 

Hi,

 

we have a problem with FAT filesystem on BF548-EZKIT. The uClinux image is compiled with x86_64 toolchain. When I create new files on a USB-Stick the files are corrupted. See the following log.

 

 

## Booting kernel from Legacy Image at 01000000 ...                                                                                                                                         

   Image Name:   Linux-2.6.28.10-ADI-2009R1                                                                                                                                                 

   Created:      2010-06-09  12:53:07 UTC                                                                                                                                                   

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)                                                                                                                              

   Data Size:    5600518 Bytes =  5.3 MB                                                                                                                                                    

   Load Address: 00001000                                                                                                                                                                   

   Entry Point:  0027fb3c                                                                                                                                                                   

   Verifying Checksum ... OK                                                                                                                                                                

   Uncompressing Kernel Image ... OK                                                                                                                                                        

Starting Kernel at = 0027fb3c                                                                                                                                                               

Linux version 2.6.28.10-ADI-2009R1 (MESUTRONICmrankl@ap14-linux) (gcc version 4.1.2 (ADI svn)) #2 Wed Jun 9 14:52:59 CEST 2010                                                              

bootconsole [early_shadow0] enabled                                                                                                                                                         

bootconsole [early_BFuart0] enabled                                                                                                                                                         

early printk enabled on early_BFuart0                                                                                                                                                       

Board Memory: 64MB                                                                                                                                                                          

Kernel Managed Memory: 64MB                                                                                                                                                                 

Memory map:                                                                                                                                                                                 

  fixedcode = 0x00000400-0x00000490                                                                                                                                                         

  text      = 0x00001000-0x001a6420                                                                                                                                                         

  rodata    = 0x001a6420-0x00234830                                                                                                                                                         

  bss       = 0x00235000-0x0024ca84                                                                                                                                                         

  data      = 0x0024ca84-0x0026a000                                                                                                                                                         

    stack   = 0x00268000-0x0026a000                                                                                                                                                         

  init      = 0x0026a000-0x00a73000                                                                                                                                                         

  available = 0x00a73000-0x03dff000                                                                                                                                                         

  DMA Zone  = 0x03e00000-0x04000000                                                                                                                                                         

Hardware Trace Active and Enabled                                                                                                                                                           

Boot Mode: 1                                                                                                                                                                                

Blackfin support (C) 2004-2009 Analog Devices, Inc.                                                                                                                                         

Compiled for ADSP-BF548 Rev 0.2                                                                                                                                                             

Blackfin Linux support by   blackfin.uclinux.org/                                                                                                                                      

Processor Speed: 525 MHz core clock and 131 MHz System Clock                                                                                                                                

NOMPU: setting up cplb tables                                                                                                                                                               

Instruction Cache Enabled for CPU0                                                                                                                                                          

Data Cache Enabled for CPU0 (write-back)                                                                                                                                                    

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 15747                                                                                                                 

Kernel command line: root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial,uart1,57600 console=tty0 console=ttyBF0,57600 ip=192.168.7.3:192.168.7.254:192.168.7.254:255.255.255.0:bf54f

Configuring Blackfin Priority Driven Interrupts                                                                                                                                             

PID hash table entries: 256 (order: 8, 1024 bytes)                                                                                                                                          

Console: colour dummy device 80x25                                                                                                                                                          

Linux version 2.6.28.10-ADI-2009R1 (MESUTRONICmrankl@ap14-linux) (gcc version 4.1.2 (ADI svn)) #2 Wed Jun 9 14:52:59 CEST 2010                                                              

bootconsole [early_shadow0] enabled                                                                                                                                                         

bootconsole [early_BFuart0] enabled                                                                                                                                                         

early printk enabled on early_BFuart0                                                                                                                                                       

Board Memory: 64MB                                                                                                                                                                          

Kernel Managed Memory: 64MB                                                                                                                                                                 

Memory map:                                                                                                                                                                                 

  fixedcode = 0x00000400-0x00000490                                                                                                                                                         

  text      = 0x00001000-0x001a6420                                                                                                                                                         

  rodata    = 0x001a6420-0x00234830                                                                                                                                                         

  bss       = 0x00235000-0x0024ca84                                                                                                                                                         

  data      = 0x0024ca84-0x0026a000                                                                                                                                                         

    stack   = 0x00268000-0x0026a000                                                                                                                                                         

  init      = 0x0026a000-0x00a73000                                                                                                                                                         

  available = 0x00a73000-0x03dff000                                                                                                                                                         

  DMA Zone  = 0x03e00000-0x04000000                                                                                                                                                         

Hardware Trace Active and Enabled                                                                                                                                                           

Boot Mode: 1                                                                                                                                                                                

Blackfin support (C) 2004-2009 Analog Devices, Inc.                                                                                                                                         

Compiled for ADSP-BF548 Rev 0.2                                                                                                                                                             

Blackfin Linux support by   blackfin.uclinux.org/                                                                                                                                      

Processor Speed: 525 MHz core clock and 131 MHz System Clock                                                                                                                                

NOMPU: setting up cplb tables                                                                                                                                                               

Instruction Cache Enabled for CPU0                                                                                                                                                          

Data Cache Enabled for CPU0 (write-back)                                                                                                                                                    

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 15747                                                                                                                 

Kernel command line: root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial,uart1,57600 console=tty0 console=ttyBF0,57600 ip=192.168.7.3:192.168.7.254:192.168.7.254:255.255.255.0:bf54f

Configuring Blackfin Priority Driven Interrupts                                                                                                                                             

PID hash table entries: 256 (order: 8, 1024 bytes)                                                                                                                                          

Console: colour dummy device 80x25                                                                                                                                                          

console [tty0] enabled                                                                                                                                                                      

console [ttyBF0] enabled, bootconsole disabled                                                                                                                                              

console [ttyBF0] enabled, bootconsole disabled                                                                                                                                              

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)                                                                                                                               

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)                                                                                                                                

Memory available: 52212k/65536k RAM, (8228k init code, 1685k kernel code, 783k data, 2048k dma, 576k reserved)                                                                              

Calibrating delay loop... 1046.52 BogoMIPS (lpj=2093056)                                                                                                                                    

Security Framework initialized                                                                                                                                                              

Mount-cache hash table entries: 512                                                                                                                                                         

Blackfin Scratchpad data SRAM: 4 KB                                                                                                                                                         

Blackfin L1 Data A SRAM: 16 KB (15 KB free)                                                                                                                                                 

Blackfin L1 Data B SRAM: 16 KB (16 KB free)                                                                                                                                                 

Blackfin L1 Instruction SRAM: 48 KB (42 KB free)                                                                                                                                            

Blackfin L2 SRAM: 128 KB (128 KB free)                                                                                                                                                      

net_namespace: 288 bytes                                                                                                                                                                    

NET: Registered protocol family 16                                                                                                                                                          

Blackfin DMA Controller                                                                                                                                                                     

ezkit_init(): registering device resources                                                                                                                                                  

SCSI subsystem initialized                                                                                                                                                                  

usbcore: registered new interface driver usbfs                                                                                                                                              

usbcore: registered new interface driver hub                                                                                                                                                

usbcore: registered new device driver usb                                                                                                                                                   

musb_hdrc: version 6.0, musb-dma, host, debug=0                                                                                                                                             

musb_hdrc: USB Host mode controller at ffc03c00 using DMA, IRQ 82                                                                                                                           

musb_hdrc musb_hdrc.0: MUSB HDRC host driver                                                                                                                                                

musb_hdrc musb_hdrc.0: new USB bus registered, assigned bus number 1                                                                                                                        

usb usb1: configuration #1 chosen from 1 choice                                                                                                                                             

hub 1-0:1.0: USB hub found                                                                                                                                                                  

dma_alloc_init: dma_page @ 0x03dd4000 - 512 pages at 0x03e00000                                                                                                                             

hub 1-0:1.0: 1 port detected                                                                                                                                                                

NET: Registered protocol family 2                                                                                                                                                           

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)                                                                                                                              

TCP established hash table entries: 2048 (order: 2, 16384 bytes)                                                                                                                            

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)                                                                                                                                    

TCP: Hash tables configured (established 2048 bind 2048)                                                                                                                                    

TCP reno registered                                                                                                                                                                         

NET: Registered protocol family 1                                                                                                                                                           

msgmni has been set to 101                                                                                                                                                                  

io scheduler noop registered                                                                                                                                                                

io scheduler anticipatory registered (default)                                                                                                                                              

io scheduler cfq registered                                                                                                                                                                 

bf54x-lq043: FrameBuffer initializing...                                                                                                                                                    

Console: switching to colour frame buffer device 80x24                                                                                                                                      

bfin-otp: initialized                                                                                                                                                                       

Serial: Blackfin serial driver                                                                                                                                                              

bfin-uart.1: ttyBF0 at MMIO 0xffc02000 (irq = 48) is a BFIN-UART                                                                                                                            

brd: module loaded                                                                                                                                                                          

smsc911x: Driver version 2007-07-13.                                                                                                                                                        

eth0: SMSC911x MAC Address: 00:e0:22:fe:b9:4d                                                                                                                                               

Driver 'sd' needs updating - please use bus_type methods                                                                                                                                    

register bfin atapi driver                                                                                                                                                                  

scsi0 : pata-bf54x                                                                                                                                                                          

ata1: PATA max UDMA/66 irq 68                                                                                                                                                               

ata1.00: ATA-6: TOSHIBA MK4032GAX, AD101A, max UDMA/100                                                                                                                                     

ata1.00: 78140160 sectors, multi 16: LBA48                                                                                                                                                  

ata1.00: configured for UDMA/66                                                                                                                                                             

blk_queue_max_hw_segments: set to minimum 1                                                                                                                                                 

scsi 0:0:0:0: Direct-Access     ATA      TOSHIBA MK4032GA AD10 PQ: 0 ANSI: 5                                                                                                                

sd 0:0:0:0: [sda] 78140160 512-byte hardware sectors: (40.0 GB/37.2 GiB)                                                                                                                    

sd 0:0:0:0: [sda] Write Protect is off                                                                                                                                                      

sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA                                                                                                     

sd 0:0:0:0: [sda] 78140160 512-byte hardware sectors: (40.0 GB/37.2 GiB)                                                                                                                    

sd 0:0:0:0: [sda] Write Protect is off                                                                                                                                                      

sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA                                                                                                     

sda: sda1                                                                                                                                                                                  

sd 0:0:0:0: [sda] Attached SCSI disk                                                                                                                                                        

physmap platform flash device: 02000000 at 20000000                                                                                                                                         

physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank                                                                                                                                  

Intel/Sharp Extended Query Table at 0x010A                                                                                                                                                 

Intel/Sharp Extended Query Table at 0x010A                                                                                                                                                 

Intel/Sharp Extended Query Table at 0x010A                                                                                                                                                 

Intel/Sharp Extended Query Table at 0x010A                                                                                                                                                 

Intel/Sharp Extended Query Table at 0x010A                                                                                                                                                 

Using buffer write method                                                                                                                                                                   

Using auto-unlock on power-up/resume                                                                                                                                                        

cfi_cmdset_0001: Erase suspend on write enabled                                                                                                                                             

RedBoot partition parsing not available                                                                                                                                                     

Using physmap partition information                                                                                                                                                         

Creating 3 MTD partitions on "physmap-flash.0":                                                                                                                                             

0x00000000-0x00040000 : "bootloader(nor)"                                                                                                                                                   

0x00040000-0x00440000 : "linux kernel(nor)"                                                                                                                                                 

0x00440000-0x01000000 : "file system(nor)"                                                                                                                                                  

BF5xx on-chip NAND FLash Controller Driver, Version 1.2 (c) 2007 Analog Devices, Inc.                                                                                                       

bf5xx-nand bf5xx-nand.0: page_size=256, data_width=8, wr_dly=3, rd_dly=3                                                                                                                    

NAND device: Manufacturer ID: 0x20, Chip ID: 0xda (ST Micro NAND 256MiB 3,3V 8-bit)                                                                                                         

Creating 2 MTD partitions on "NAND 256MiB 3,3V 8-bit":                                                                                                                                      

0x00000000-0x00400000 : "linux kernel(nand)"                                                                                                                                                

0x00400000-0x10000000 : "file system(nand)"                                                                                                                                                 

m25p80 spi0.1: m25p16 (2048 Kbytes)                                                                                                                                                         

Creating 2 MTD partitions on "m25p80":                                                                                                                                                      

0x00000000-0x00040000 : "bootloader(spi)"                                                                                                                                                   

0x00040000-0x00200000 : "linux kernel(spi)"                                                                                                                                                 

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@4                                                                                 

bfin-spi bfin-spi.1: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc02300, dma channel@5                                                                                 

Initializing USB Mass Storage driver...                                                                                                                                                     

usbcore: registered new interface driver usb-storage                                                                                                                                        

USB Mass Storage support registered.                                                                                                                                                        

input: bf54x-keys as /devices/platform/bf54x-keys/input/input0                                                                                                                              

bf54x-keys: Blackfin BF54x Keypad registered IRQ 76                                                                                                                                         

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0                                                                                                                                    

i2c /dev entries driver                                                                                                                                                                     

i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base@ffc00700                                                                                                   

i2c-bfin-twi i2c-bfin-twi.1: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base@ffc02200                                                                                                   

bfin-wdt: initialized: timeout=20 sec (nowayout=0)                                                                                                                                          

bfin-sdh bfin-sdh.0: unable to request DMA channel

bfin-sdh: probe of bfin-sdh.0 failed with error -16

usbcore: registered new interface driver usbhid

usbhid: v2.6:USB HID core driver

Advanced Linux Sound Architecture Driver Version 1.0.18rc3.

ASoC version 0.13.2

dma rx:0 tx:1, err irq:10, regs:ffc00800

AD1980 SoC Audio Codec

asoc: AC97 <-> bf5xx-ac97 mapping ok

ALSA device list:

  #0: bf5xx-board (AD1980)

TCP cubic registered

NET: Registered protocol family 17

rtc-bfin rtc-bfin: setting system clock to 1977-10-07 02:15:28 UTC (245038528)

eth0: SMSC911x/921x identified at 0x24000000, IRQ: 175

eth0: link down

IP-Config: Complete:

     device=eth0, addr=192.168.7.3, mask=255.255.255.0, gw=192.168.7.254,

     host=bf548-ezkit, domain=, nis-domain=(none),

     bootserver=192.168.7.254, rootserver=192.168.7.254, rootpath=

Freeing unused kernel memory: 8228k freed

eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

                           _____________________________________

        a8888b.           / Welcome to the uClinux distribution \

       d888888b.         /       _     _                         \

       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |

       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |

       8'    .88       \        | |   | |  _ \| | | | \  /        |

       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |

      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |

     dP   .    Y8b.       \   For embedded processors including   |

    d8:'  "  `::88b        \    the Analog Devices Blackfin      /

   d8"         'Y88b        \___________________________________/

  :8P    '      :888

   8a.   :     _a88P         For further information, check out:

._/"Yaa_:   .| 88P|            -   blackfin.uclinux.org/

\    YP"    `| 8P  `.          -   docs.blackfin.uclinux.org/

/     \.___.d|    .'           -   www.uclinux.org/

`--..__)8888P`._.'  jgs/a:f    -   www.analog.com/blackfin

 

Have a lot of fun...

 

 

BusyBox v1.13.4 (2010-06-09 14:51:33 CEST) built-in shell (msh)

Enter 'help' for a list of built-in commands.

 

root:/> usb 1-1: new high speed USB device using musb_hdrc and address 2

usb 1-1: configuration #1 chosen from 1 choice

scsi1 : SCSI emulation for USB Mass Storage devices

scsi 1:0:0:0: Direct-Access     Hama     FlashPen U3      6.50 PQ: 0 ANSI: 0 CCS

sd 1:0:0:0: [sdb] 3941375 512-byte hardware sectors: (2.01 GB/1.87 GiB)

sd 1:0:0:0: [sdb] Write Protect is off

sd 1:0:0:0: [sdb] Assuming drive cache: write through

sd 1:0:0:0: [sdb] 3941375 512-byte hardware sectors: (2.01 GB/1.87 GiB)

sd 1:0:0:0: [sdb] Write Protect is off

sd 1:0:0:0: [sdb] Assuming drive cache: write through

sdb: sdb1

sd 1:0:0:0: [sdb] Attached SCSI removable disk

 

root:/> uname -a

Linux blackfin 2.6.28.10-ADI-2009R1 #2 Wed Jun 9 14:52:59 CEST 2010 blackfin unknown

root:/> mkdosfs -F 32 /dev/sdb1

mkdosfs 3.0.2 (28 Feb 2009)

root:/> mount -t vfat -o sync /dev/sdb1 /mnt

root:/> ls -la /mnt

drwxr-xr-x    2 root     root         4096 Jan  1  1970 .

drwxr-xr-x   14 root     root            0 Jan  1  2007 ..

root:/> dd if=/dev/zero of=/mnt/1MB.bin bs=1M count=1

1+0 records in

1+0 records out

root:/> ls -la /mnt

drwxr-xr-x    2 root     root         4096 Oct  7 02:21 .

drwxr-xr-x   14 root     root            0 Jan  1  2007 ..

-rwxr-xr-x    1 root     root      1048576 Oct  7 02:21 1mb.bin

-rwxr-xr-x    1 root     root      1048576 Oct  7 02:21 a1         <--- ????

root:/> dd if=/dev/zero of=/mnt/2MB.bin bs=1M count=2

2+0 records in

2+0 records out

root:/> ls -la /mnt

drwxr-xr-x    2 root     root         4096 Oct  7 02:22 .

drwxr-xr-x   14 root     root            0 Jan  1  2007 ..

-rwxr-xr-x    1 root     root      2097152 Oct  7 02:22 1mb.bin    <---

-rwxr-xr-x    1 root     root      2097152 Oct  7 02:22 2MB.bin    <---

-rwxr-xr-x    1 root     root      2097152 Oct  7 02:22 a1         <--- same size???

root:/>

 

 

My setup is:

BF548-EZKIT Silicon Rev. 0.2

uClinux-dist-2009R1-RC6.tar.bz2

blackfin-toolchain-elf-gcc-4.1-09r1-10.x86_64.tar.bz2

blackfin-toolchain-09r1-10.x86_64.tar.bz2

blackfin-toolchain-uclibc-full-09r1-10.i386.tar.bz2

Build Host: openSUSE 11.2 x86_64

 

 

The same happens on our custom board which is based on BF548-EZKIT. It also happens with 2009R1.1 uClinux and x86_64 toolchain.

When I use the i386 toolchain to build uClinux everything is OK. Is this a known issue or do we something wrong?

 

Best regards

Markus

TranslateQuoteReplyEditDelete

 

 

2010-06-09 15:40:52     Re: Problem with FAT filesystem

Adam Rosenberg (UNITED STATES)

Message: 90228   

 

Markus,

 

Does the strange "a1" file show itself when when you format the USB-Stick on a known working system like your Build Host or a computer running Windows and then create the test files on your custom board?  You might be able to narrow down the problem to just the mkdosfs command or at least rule it out.

 

After you create the test files using your custom board, if you plug the USB-Stick into your Build Host does the "a1" file still show?

 

I am not up to mounting filesystems on my board yet, but when I get there I hope to not run into the same problem ;-)

 

-Adam

QuoteReplyEditDelete

 

 

2010-06-09 15:57:13     Re: Problem with FAT filesystem

Mike Frysinger (UNITED STATES)

Message: 90229   

 

use the 32bit toolchain

QuoteReplyEditDelete

 

 

2010-06-10 02:35:42     Re: Problem with FAT filesystem

Markus Rankl (GERMANY)

Message: 90238   

 

Hi Adam,

 

the problem is the same even when I format the USB-Stick on my build host. After I create the test files and plug the USB-Stick to my computer the files are still there.

 

As Mike pointed out - if you use 32bit toolchain there aren't those problems.

 

-Markus

Attachments

    Outcomes