AnsweredAssumed Answered

uClinux-2008R1 and rootfs.jffs2

Question asked by vrp on Sep 9, 2013
Latest reply on Sep 9, 2013 by Aaronwu

I try to configure uClinux-2008R1 with rootfs.jffs2 for serial NOR flash.

 

I configure the system:

 

In file arch/blackfin/mach-bf537/boards/stamp.c:

 

static struct mtd_partition bfin_spi_flash_partitions[] = {

    {

        .name = "bootloader",

        .size = 0x00040000,

        .offset = 0,

        .mask_flags = MTD_CAP_ROM

    }, {

        .name = "kernel",

        .size = 0x100000,

        .offset = 0x40000

    }, {

        .name = "file system",

        .size = 0x6c0000,

        .offset = 0x00140000,

    }

};

 

 

kernel configuration

 

  Device Drivers  --->

    Memory Technology Devices (MTD)  --->

      <*> Memory Technology Device (MTD) support

      [*]   Direct char device access to MTD devices

      [*]   Caching block device access to MTD devices

 

 

    Mapping drivers for chip access  --->

      [*] Support non-linear mappings of flash chips

      < > Generic uClinux RAM/ROM filesystem support (disable this option)

    Self-contained MTD device drivers  --->

      <*> Support most SPI Flash chips (AT26DF, M25P, W25X, ...)

   

    Self-contained MTD device drivers  --->

      <*> Support for M25 SPI Flash

    [*]   Use FAST_READ OPCode allowing SPI CLK <= 50MHz (NEW)

   

 

  File systems  --->

    Miscellaneous filesystems  --->

      <*> Journalling Flash File System v2 (JFFS2) support

 

 

 

In vendor/user configuration menu

 

  Flash Tools  --->

    [*] mtd-utils

    [*]   eraseall

    [*]   mkfs.jff2

 

 

After compiling the kernel I load vmImage and rootfs.jffs2 into BF537

 

tftp 0x1000000 vmImage

eeprom write 0x1000000 0x40000 $(filesize)

 

tftpboot 0x1000000 rootfs.jffs2

eeprom write 0x1000000 0x140000 $(filesize)

 

 

args1=setenv bootargs root=/dev/mtdblock2 rw rootfstype=jffs2

args2=setenv norboot 'eeprom read 0x1000000 0x40000 0x100000;bootm 0x1000000'

 

bootcmd=run args1;run args2;run norboot

 

Executing the command `boot` I see this:

 

 

m25p80 spi0.1: m25p64 (8192 Kbytes)                                                                                                                    
Creating 3 MTD partitions on "m25p80":                                                                                                                 
0x00000000-0x00040000 : "bootloader"                                                                                                                   
0x00040000-0x00140000 : "kernel"                                                                                                                       
0x00140000-0x00800000 : "file system"                                                                                                                  
bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, regs_base@ffc00500, dma channel@7                                       
rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0                                                                                               
TCP cubic registered                                                                                                                                   
NET: Registered protocol family 1                                                                                                                      
NET: Registered protocol family 17                                                                                                                     
rtc-bfin rtc-bfin: setting the system clock to 2009-08-28 13:40:00 (1251466800)                                                                        
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003ad18c: 0xcdfa instead                                                                  
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003ad190: 0xfd4f instead                                                                  
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003ad194: 0xbad6 instead                                                                  
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003ad198: 0x568a instead                                                                  
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003ad19c: 0x9ffa instead                                                                  
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003ad1a0: 0x0297 instead                                                                  
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003ad1a4: 0x2717 instead                                                                  
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003ad1a8: 0x9ec6 instead                                                                  
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003ad1ac: 0xe864 instead                                                                  
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003ad1b0: 0xc99b instead                                                                  
Further such events for this erase block will not be printed                                                                                           
VFS: Mounted root (jffs2 filesystem).                                                                                                                   
Freeing unused kernel memory: 108k freed                                                                                                               
dma_alloc_init: dma_page @ 0x00169000 - 256 pages at 0x01f00000                                                                                         

...

...

Have a lot of fun...

 

BusyBox v1.4.1 (2013-09-09 10:40:38 MSK) Built-in shell (msh)

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

 

root:/> JFFS2 warning: (82) jffs2_do_read_inode_internal: Truncating ino #244 to 244164 bytes failed because it only had 237568 bytes to start with!

JFFS2 warning: (82) jffs2_do_read_inode_internal: Truncating ino #261 to 320552 bytes failed because it only had 233472 bytes to start with!

JFFS2 warning: (82) jffs2_do_read_inode_internal: Truncating ino #320 to 76260 bytes failed because it only had 45056 bytes to start with!

 

root:/>

 

 

Help me please to make right steps.

 

Outcomes