기존 이솝 임베디드 포럼의 지식인 서비스가 게시판 형태로 변경되었습니다.

* 현재 yaffs2가 마운트는 되는데 파일 쓰기 중 에러납니다.
아래 설정 및 실행결과를 올립니다.
어떻게 해결해야 되는지 아시면 좀 알려주시면 감사하겠습니다.
 
* 환경은 다음과 같습니다.
- CPU : PXA320
- Kernel Ver : 2.6.21
- NAND : K9F1G08U0B
 
 
 
* <Kernel Root>/drivers/mtd/nand/pxa3xx_nand.c : 커널 파티션 설정
--------------------------------------------------------------------------------------
 
/*
 * BootRom and XDB will use last 127 block, and they will keep all the status
 * of the bootloader and image, so skip the first 2M size and last 2M size
 */
static struct mtd_partition partition_info[] = {
        {
                name:           "Bootloader",
                offset:         0,
                mask_flags:     MTD_WRITEABLE  /* force read-only */
        },{
                name:           "Kernel",
                size:           0x00200000,
                mask_flags:     MTD_WRITEABLE  /* force read-only */
        },{
                name:           "Filesystem",
                size:           0x03000000,     /* only mount 48M fs */
                offset:         0x00240000,
        }, {
                name:           "MassStorage",
                size:           0x0, /* It will be set at probe function */
                offset:         MTDPART_OFS_APPEND /* Append after fs section */
        }, {
                name:           "BBT",
                size:           0x0, /* It will be set at probe function */
                offset:         MTDPART_OFS_APPEND,/* Append after fs section */
                mask_flags:     MTD_WRITEABLE  /* force read-only */
        }
};
 
 
 
* 실행 결과
--------------------------------------------------------------------------------------
[root@MV320 /proc]#cat filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   sockfs
nodev   pipefs
nodev   futexfs
nodev   tmpfs
nodev   inotifyfs
nodev   eventpollfs
nodev   devpts
        ext2
nodev   ramfs
        msdos
        vfat
nodev   nfs
nodev   nfs4
nodev   jffs2
        yaffs
        yaffs2
nodev   rpc_pipefs
 
[root@MV320 /root]#cat /proc/partitions
major minor  #blocks  name
 
  31     0        256 mtdblock0
  31     1       2048 mtdblock1
  31     2      49152 mtdblock2
  31     3      62848 mtdblock3
  31     4        512 mtdblock4
 
[root@MV320 /root]#cat /proc/mtd       
dev:    size   erasesize  name
mtd0: 00040000 00020000 "Bootloader"
mtd1: 00200000 00020000 "Kernel"
mtd2: 03000000 00020000 "Filesystem"
mtd3: 03d60000 00020000 "MassStorage"
mtd4: 00080000 00020000 "BBT"
 
[root@MV320 /root]#ls /dev/         
0            dspW0        hda6         mixer        mtdblock3    tty2
123          dspW1        hda7         mixer0       mtdblock4    tty3
GPIO         dspW2        hda8         mixer1       mtdblock5    tty4
GPS          dspW3        hdb          mixer2       null         tty5
audio        dspdefault   hdb1         mixer3       psaux        tty6
audio0       f3d2k        hdb2         mmca         ptmx         tty7
audio1       fb           hdb3         mmca1        pts          tty8
audio2       fb0          hdb4         mmca2        ram0         ttyACM0
audio3       fb1          hdb5         mmca3        ram1         ttyP0
audioctl     fb2          hdb6         mmca4        ram2         ttyP1
c            fb3          hdb7         mmca5        ram3         ttyP2
console      fb4          hdb8         mmca6        random       ttyP3
cusa0        fb5          initctl      mmca7        root         ttyS0
cusa1        fb6          input        mmcb         rtc0         ttyS1
cusa2        fb7          ipmc         mmcb1        sda          ttyS2
dmb          flh0         ixs_oscr     mmcb2        sda1         ttySA0
dmfm         flh1         kmem         mmcb3        sda5         ttySA1
dmfm0        flh2         loop0        mmcb4        sequencer    ttySA2
dpmc         flh3         loop1        mmcb5        snd          urandom
dsp          hda          mem          mmcb6        sndstat      video
dsp0         hda1         midi         mmcb7        tact         video0
dsp1         hda2         midi00       mmcblk0p1    touchscreen  zero
dsp2         hda3         midi01       mtdblock0    tty
dsp3         hda4         midi02       mtdblock1    tty0
dspW         hda5         midi03       mtdblock2    tty1
 
[root@MV320 /root]#mount
/dev/mtdblock2 on / type jffs2 (rw)
none on /tmp type ramfs (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /tmpfs type tmpfs (rw)
 
[root@MV320 /proc]#df      
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock2           49152     46320      2832  94% /
tmpfs                    24576         0     24576   0% /tmpfs
 
[root@MV320 /proc]#mount -t yaffs2 /dev/mtdblock3 /mnt2
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
yaffs_read_super: isCheckpointed 0
 
[root@MV320 bin]#ls -al 1.wav
-rw-r--r--    1 root     root      3354178 Jan  1  1970 1.wav
 
[root@MV320 bin]#cp 1.wav /mnt2
yaffs tragedy: no more erased blocks
!!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!
yaffs tragedy: no more erased blocks
!!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!
...
한참 나옴
 
[root@MV320 bin]#ls -al /mnt2
drw-rw-rw-    1 root     root         2048 Aug  2 09:17 .
drwxr-xr-x   19 root     root            0 Jan  1  1970 ..
-rw-r--r--    1 root     root       126976 Aug  2 09:17 1.wav
drw-rw-rw-    1 root     root         2048 Aug  2 09:15 lost+found
 
[root@MV320 bin]#df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock2           49152     46320      2832  94% /
tmpfs                    24576         0     24576   0% /tmpfs
/dev/mtdblock3           62848      1280     61568   2% /mnt2
 

[root@MV320 bin]#cat /proc/yaffs
YAFFS built:Aug  2 2009 09:08:20
$Id: yaffs_fs.c,v 1.81 2009/05/26 01:22:44 charles Exp $
$Id: yaffs_guts.c,v 1.87 2009/07/29 04:30:24 charles Exp $
 
Device 0 "MassStorage"
startBlock......... 0
endBlock........... 490
totalBytesPerChunk. 2048
nDataBytesPerChunk. 2048
chunkGroupBits..... 0
chunkGroupSize..... 1
nErasedBlocks...... 0
nReservedBlocks.... 5
blocksInCheckpoint. 0
nTnodesCreated..... 100
nFreeTnodes........ 95
nObjectsCreated.... 200
nFreeObjects....... 95
nFreeChunks........ 31360
nPageWrites........ 0
nPageReads......... 0
nBlockErasures..... 1
nGCCopies.......... 0
garbageCollections. 0
passiveGCs......... 0
nRetriedWrites..... 0
nShortOpCaches..... 10
nRetireBlocks...... 0
eccFixed........... 0
eccUnfixed......... 0
tagsEccFixed....... 0
tagsEccUnfixed..... 0
cacheHits.......... 0
nDeletedFiles...... 0
nUnlinkedFiles..... 0
nBackgroudDeletions 0
useNANDECC......... 1
isYaffs2........... 1
inbandTags......... 0
 
[root@MV320 /root]#umount /mnt2
save exit: isCheckpointed 0
save exit: isCheckpointed 0
 
[root@MV320 /root]#cat /proc/yaffs
YAFFS built:Aug  2 2009 09:08:20
$Id: yaffs_fs.c,v 1.81 2009/05/26 01:22:44 charles Exp $
$Id: yaffs_guts.c,v 1.87 2009/07/29 04:30:24 charles Exp $
 
[root@MV320 /root]#./flash_eraseall /dev/mtd3
./flash_eraseall: /dev/mtd3: No such file or directory
 
[root@MV320 /root]#./flash_eraseall /dev/mtdblock3
./flash_eraseall: /dev/mtdblock3: unable to get MTD device info

공정표

2009.08.03 09:28:15
*.144.61.178

자답이네요.

해결됐습니다.

1. 노드를 생성안했군요.
#mknod /dev/mtd3 c 90 6(mtd 3번, rw 타입)
*아직 마운트를 안한 상태에서 블럭 디바이스로 접근하기 전이라서 캐릭터 디바이스로 다루어야 하기 때문일 것이라고 합니다)

참고로 mtd의 마이너 번호는 다음과 같네요. read only의 경우 홀수가 되네요.
mtd0
mtd0ro
mtd1
mtd1ro
mtd2
mtd2ro
mtd3(minor number 6)

2. 다음, 아래 문제가 나온 까닭에 해당 플래시 파티션 데이터 삭제해 줬네요.
#cp 1.wav /mnt2
yaffs tragedy: no more erased blocks
!!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!
yaffs tragedy: no more erased blocks
!!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!
...

플래시 파티션 데이터 삭제
#./flash_eraseall /dev/mtd3
Erasing 128 Kibyte @ 3d40000 -- 99 % complete.

/dev/mtd3 노드 파일이 없으면 플래시 삭제 안됩니다.(당연히;;)

3. 마운트 : 아래와 같이 마운트하면 정상이네요.
#mount -t yaffs2 /dev/mtdblock3 /mnt/yaffs2fs/
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
yaffs_read_super: isCheckpointed 0


* 참고로 yaffs2 사용하기 위해 빌드한건
1. yaffs2 소스 : 커널 패치후 make menuconfig로 yaffs2 설정
2. mtd utils 소스(flash_eraseall) : 사용하는 bsp에는 없어서 크로스 컴팔 후 타겟 복사

입니다.
List of Articles
번호 제목 글쓴이 날짜 조회 수sort
6128 aESOP 가지고놀기 라는 PDF 자료중 yaffs 관련 문의 입니다.-&gt... [1] 공경준 2006-08-28 2685
6127 [질문] LX800 보드 부품수급 관련 질문` [2] 박명대 2007-11-03 2675
6126 [질문]RTC 오차 관련해서 질문 드립니다. [3] 백승준 2008-06-10 2674
» YAFFS2 마운트는 되는데 파일쓰기 에러... [1] 공정표 2009-08-03 2673
6124 터치 스크린.. [3] 이재철 2006-09-16 2667
6123 mf2530f의 연산 성능은 s3c2440a에 비해서 어떠한가요? [3] 성진호 2007-10-24 2664
6122 안드로이드 디바이스 드라이버 [1] jacket 2010-01-13 2653
6121 log 출력에 관해서. [3] 권윤택 2009-07-15 2652
6120 cygwin을 사용하여 u-boot 컴파일 가능? [2] 한석준 2009-03-03 2648
6119 안드로이드 overlay 서정민 2009-06-09 2642
6118 NAND 변경시 나온 문제 (OverWrite 문제) [2] cshqq 2013-12-09 2634
6117 XPe용 VGA 비디오 드라이버를 구할곳이 있나요 [3] 정인수 2007-05-30 2634
6116 [질문]LCD 백라이트 하드웨어적으로 ON 시키는 방범좀...(완료) [6] 안문기 2007-05-14 2630
6115 Android Kernel 2.6.29로 업데이트 방법? [1] 김태준 2009-05-15 2628
6114 mkyaffsimage 질문입니다...[완료] [4] 이홍석 2006-05-07 2624
6113 Android kernel 2.6.28 재업 smdk6410 커널용 [2] 최종환 2009-04-09 2622
6112 화면잔상 해결법? [1] 이동술 2007-05-14 2621
6111 Android 동작시 mtd부분에서 uevent관련 하여 죽어 버립니다. [3] 최종환 2009-03-26 2614
6110 U-boot상에서 Ping 테스트 에러(LAN91C111 이더넷 드라이브 사용) [2] 한석준 2009-03-11 2612
6109 tftp 파일 수신 시 timeout 이 발생 [8] blue0sky 2012-08-23 2609

사용자 로그인