Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

about flash filesystems

Altera_Forum
Honored Contributor II
969 Views

Hi, 

 

I am starting to use the uClinux (on the altera cyclone dev board for the moment, and following the Quick Start Guide), and I had some questions : 

 

- How does the Nios IDE know where to place the fs in flash ? Does it automatically reserve the beginning for the kernel ? How does my Filesystem Project know that I made a Kernel project that I put in the same flash ? 

 

- Is it possible to have a rw access to a part of the flash even if I made a filesystem on it ? I followed the Quick Start Guide, and I apparently cannot write on the fs created (except on the ramfs created). Is the fs completely ro ? If yes, does flash rw file systems exist ? 

 

Thanks, 

 

cetic
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
277 Views

Hi cetic, 

 

> How does the Nios IDE know where to place the fs in flash ? 

 

It's in the stf file: the offset parameter in the location_on_target tag. 

E.g.: <location_on_target offset=&#39;0x00200000&#39;> 

 

> How does my Filesystem Project know that I made a Kernel 

> project that I put in the same flash ? 

 

It doesn&#39;t. 

 

> Is it possible to have a rw access to a part of the flash even if I 

> made a filesystem on it ? 

 

Yes. The presence of a file system is irrelevant. The block (or even 

char) device driver is what matters. Typically, mtd is used to access 

flash or other memory (like SRAM or reserved SDRAM) as it provides 

the appropriate device driver(s). 

 

If you want to &#39;partition&#39; your flash into several regions ... some 

read/write, others read-only ... you can enable MTD partition support. 

You can then customize the partitions (e.g. location, size, read/write 

attributes) for your board by writing your own &#39;mapping&#39; driver 

(see drivers/mtd/maps for some examples). 

 

> Is the fs completely ro ? If yes, does flash rw file systems exist ? 

 

That depends on the filesystem. Some, like cramfs, are read only. 

Others are read/write. The most popular r/w flash filesystem 

is jffs2. Cramfs is my favorite for read-only. 

 

If you don&#39;t need non-volatile r/w file access for your 

application, you can for example just use cramfs (for the root 

filesystem) and tmpfs to provide volatile r/w file support (i.e. 

for temporary files and the like). 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
277 Views

Thanks a lot,  

 

that helps a lot. 

 

Regards, 

 

cetic
0 Kudos
Reply