Altera_Forum
Honored Contributor
19 years agojffs2 init
I have included and compiled JFFS2 but I am having a problem opening files.
Processor:NIOSII, CYCLONE II Version : Quartus/eCos 5.1 I have used mkfs.jffs2 and created my image then I used nios2-flash-programmer to create a srec. I used bin2flash to program the flash part with the jffs2 image. I have placed it at 0xD0000 with a length=0x20000. The following is test code I have been using: iRtn = mount("/dev/flash1", "/", "jffs2"); //return value is 0 - good iRtn = chdir("/"); //return value is 0 - good fp = fopen("inPort.cfg","w"); //return value = -1 errno 28 The fopen() fails ..... output ================================================= Try to open inPort.cfg - write mode! jffs2_lookup() <7>jffs2_create() <7>jffs2_new_inode(): dir_i 1, mode 0x16f0008 <7>Allocated inocache at 0x0413ba00 <7>jffs2_do_new_inode(): Assigned ino# 2 <7>jffs2_reserve_space(): Requested 0x44 bytes <7>jffs2_reserve_space(): alloc sem got <7>dirty size 0x00000000 + unchecked_size 0x00000000 < nospc_dirty_size 0x00010000, returning -enospc <7>jffs2_do_create(): reserved 0x0 bytes <7>jffs2_clear_inode(): ino# 2 mode %o File Open FAILED in WRITE mode ! ================================================= It looks like the flash device/ jffs partition is not initialized - but I can not find out how to initialize it! Does anyone know how the system knows the base address of the jffs patition and the length of the partition? Do you call a jffs init function or a flash init function? Do you add a table entry? Thanks