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++
12748 Discussions

Generating Filesystem for EP2S60 DSPBoard fails

Altera_Forum
Honored Contributor II
1,443 Views

Hi to all. 

I have a DSP Board (STRATIX II) from Altera. No there is a problem by generating the Filesystem in the NIOS II IDE. 

In the "Target Filesystem Application Selection" the bottom line says: "Total amountof memory available: 0K" 

 

The Kernel Projekt is working. 

How did the Filesystemmaker calculates the available memory? 

 

Hope someone can help me. 

 

Bye 

Marco
0 Kudos
12 Replies
Altera_Forum
Honored Contributor II
742 Views

Can you send me a PM with the system.ptf file that you're trying to build a filesystem for?

0 Kudos
Altera_Forum
Honored Contributor II
742 Views

I saw your PTF file, are you using a custom board? 

 

Here's what I thought I saw: 

 

(1) User Configuration starts at 0x200000 

(2) Factory Configuration starts at 0x500000 

 

The kernel currently uses the first 2 megs of memory (0x0 -> 0x200000). The filesystem normally starts at 0x200000 until the first configuration found. 

 

In your case, that means a 0 length filesystem. 

 

Do you have any free space *after* the user and factory configurations in flash? If you do then I'll need to create a patch for you. It currently assumes that factory configurations are normally at the end of flash.
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

Hi Ken, 

Thanks for your answer. 

Yes, it's a custom board. The Kernel is at 0x0 up to 0x1FFFFF 

The "User-Konfiguration" is from 0x200000 to 0x4FFFFF and the "Factory Configuration" is from 0x500000 to 0x7FFFFF 

 

The Filesystem can then be from 0x800000 up to 0xFFFFFF. But how to tell it the Filesystemmaker? 

 

Bye 

Marco
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

Hi Marco, I'll work on getting you a patch that will let you do what you need. In the meantime, you can create your filesystem from the IDE but you will need to perform the build and the upload from the commandline: 

 

To build your filesystem: 

 

[SOPC Builder]$ cd $ECLIPSE_WORKSPACE/<project> 

[SOPC Builder]$ genromfs -d -V "<project>" -f romfs.bin -v 

[SOPC Builder]$ bin2flash --input=romfs.bin --base=<base address of flash> --output=romfs.flash --location=0x800000 

 

To upload your filesystem: 

 

[SOPC Builder]$ cd $ECLIPSE_WORKSPACE/<project> 

[SOPC Builder]$ nios2-flash-programmer --input=romfs.flash --sof=<flash programming sof> --base=<base address of flash> 

 

In the above steps, the <flash programming sof> file that I&#39;m referencing is: 

 

...altera/kits/nios2/components/StratixII_Marco/system/StratixII_Marco.sof 

 

or something like that. 

 

The <base address of flash> can be found in the PTF file for the above SOF file.
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

Hi Ken, 

 

thanks for your work. 

 

Bye 

marco
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

Hi all, 

 

I&#39;ve encountered the same problem as Mabcom here, regarding the Stratix II DSP Development Board. I left a PM with Ken, but figured I&#39;d post here to cover all my bases. When trying to create the filesystem I encounter the same error:  

"Total amountof memory available: 0K" 

 

Looking into my PTF I encounter some configurations that I am unfamiliar with. I&#39;ll append a snippet of that section at the bottom. I am unsure where the page0-page2 configs are originating. I would like to figure this out, so I may dedicate a section in memory to the filesystem. This would allow me to continue on with Ken&#39;s command line generate and upload suggestion. 

 

On another note, I tried briefly to build the system in the command line, as far as I could go without having to dictate memory space for the filesystem. I encounter the following error regarding the romfs generate command (where filesystem_2s60 is the name of my project): 

 

[SOPC Builder]$ genromfs -d -V "filesystem_2s60" -f romfs.bin -v 

genromfs: you must specify the destination file 

Try `genromfs -h&#39; for more information 

 

Any suggestions as to either of these issues?  

Thanks much. 

 

 

 

CONFIGURATION factory 

length = ""; 

menu_position = "4"; 

offset = "0x00200000"; 

reference_designator = "U17"; 

CONFIGURATION page0 

length = ""; 

menu_position = "1"; 

offset = "0x00500000"; 

reference_designator = "U17"; 

CONFIGURATION page1 

length = ""; 

menu_position = "2"; 

offset = "0x00800000"; 

reference_designator = "U17"; 

CONFIGURATION page2 

length = ""; 

menu_position = "3"; 

offset = "0x00c00000"; 

reference_designator = "U17"; 

}
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

As for the genromfs command... I forgot to add the argument for the -d option 

 

That should be: 

 

genromfs -d target -V "filesystem_2s60" -f romfs.bin -v 

 

Which will generate a filesystem based on the contents in the "target" directory... give it another try and let me know how it goes...
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

Ken, 

 

I&#39;ve worked through figuring out the majority of this process so far. The section listed in my PTF for configurations page0-page2 are the DSP Development Board&#39;s method for selecting a predefined user image section upon power-up. These are selected via a DIP switch. I will choose one of these for my filesystem and set the dipswitch accordingly. 

 

As for running through your command line procedure, things are falling into place. The romfs is generated, and I can convert that over to a flash file. However, doing so with the following command: 

 

[SOPC Builder]$ bin2flash --input=romfs.bin --base=<base address of flash> --output=romfs.flash --location=0x800000 

 

I am unsure if the <base address of flash> refers to the base addy of the flash programmer or the base addy of flash located in the target hardware for the filesystem. In the design itself, the core, I have this as 0x000000 but in the flash programmer design it&#39;s 0x1000000. The flash programmer manual lists this as the "Base address of the flash in your system." Advice there? 

 

I am also replacing the location addy with 0x500000, since that is the beginning of my page0 config. 

 

Keeping my fingers crossed here, in hope that I will soon see a response from envoking the nios2-terminal command. 

 

 

update 

Actually, I&#39;m pretty sure things are going the right way, after using the base address from the flash programmer. I know you mentioned in your post, Ken, that it was the flash programmer&#39;s base addy...just wanted to make perfectly sure. 

 

There&#39;s now a response out of Linux, taking me as far as the "Kernel command line: root=/dev/mtdblock0 ro" command on boot-up. However, it stops there and reboots, over and over. Could this be due to one of the DeviceDriver/MTD settings in the kernel config? I checked through an earlier post, where you mentioned it could be related to an incorrect setting for the reset addy in flash and the exception addy in sdram. Those look correct to me. 

 

Thanks again for your attention - I can see the light at the end of the tunnel here. 

- Matt
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

I&#39;m still getting a continual reboot. It doesn&#39;t seem to matter if I use <base addy of flash> as from my core design or from the flash programmer as stated previously. 

 

However, one run went farther than any other and reported an error near the beginning and at the end that perhaps someone else is familiar with. Here&#39;s my boot sequence. 

 

uClinux/Nios II 

Altera Nios II support © 2004 Microtronix Datacom Ltd. 

 

setup_arch: No persistant network settings signature at 00FF0000 

Built 1 zonelists 

Kernel command line: root=/dev/mtdblock0 ro 

PID hash table entries: 128 (order: 7, 2048 bytes) 

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

Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) 

Memory available: 14472k/16384k RAM, 0k/0k ROM (1422k kernel code, 296k data) 

Mount-cache hash table entries: 512 (order: 0, 4096 bytes) 

NET: Registered protocol family 16 

Serial: JTAG UART driver $Revision: 1.4 $ 

ttyJ0 at MMIO 0x82120940 (irq = 1) is a jtag_uart 

io scheduler noop registered 

io scheduler anticipatory registered 

io scheduler deadline registered 

io scheduler cfq registered 

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize 

smc_probe: 50000 Khz Nios 

Altera NDK flash (AMD): Found 1 x16 devices at 0x0 in 8-bit bank 

Amd/Fujitsu Extended Query Table at 0x0040 

Altera NDK flash (AMD): CFI does not contain boot bank location. Assuming top. 

number of CFI chips: 1 

cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. 

cmdlinepart partition parsing not available 

RedBoot partition parsing not available 

Using Altera NDK partition definition 

Creating 4 MTD partitions on "Altera NDK flash (AMD)": 

0x00200000-0x00800000 : "romfs/jffs2" 

0x00000000-0x00200000 : "loader/kernel" 

0x00800000-0x00c00000 : "User configuration" 

0x00c00000-0x01000000 : "safe configuration" 

microtronix[mtd]: RAM probe address=0x200000 size=0x0 

Creating 1 MTD partitions on "RAM": 

0x00000000-0x00000000 : "ROMfs" 

mtd: partition "ROMfs" is out of reach -- disabled 

microtronix[mtd]: set ROMfs to be root filesystem 

NET: Registered protocol family 2 

IP: routing cache hash table of 512 buckets, 4Kbytes 

TCP established hash table entries: 1024 (order: 1, 8192 bytes) 

TCP bind hash table entries: 1024 (order: 0, 4096 bytes) 

TCP: Hash tables configured (established 1024 bind 1024) 

NET: Registered protocol family 1 

NET: Registered protocol family 17 

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,0)
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

Sorry for not getting back to you sooner Keplin, I&#39;ve been busy with other things at work. 

 

Yes, it looks like you&#39;re going to have to modify your MTD maps... 

 

Take a look at the following lines in your kernel startup: 

 

0x00200000-0x00800000 : "romfs/jffs2" 0x00000000-0x00200000 : "loader/kernel" 0x00800000-0x00c00000 : "User configuration" 0x00c00000-0x01000000 : "safe configuration" 

 

That&#39;s what Linux expects to see. Considering how different your custom board is, we need Linux to recognize your memory partitions. So, there&#39;s a file called "...$KERNEL_PLUGIN/linux-2.6.x/drivers/mtd/maps/altera.c" in the kernel source tree (or something along those lines). Take a look inside the file, you should see a C struct that contains the above info. 

 

Try modifying the record for the romfs entry to reflect where your filesystem lives in flash. In this instance, you&#39;ll want to use offset information. So, looking at everything from before, that should be 0x500000. 

 

Hope this helps... 

 

($KERNEL_PLUGIN is an environment variable in the Nios II SDK Shell... it maps to ...altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_x.x.x)
0 Kudos
Altera_Forum
Honored Contributor II
742 Views

No problem Ken, sorry if I sounded impatient. I only meant to keep you updated with my current status, so you weren&#39;t trying to solve an issue that I had moved beyond. Thanks so much for all your advice, both you and Doug got me through to the end here. Now for some development..

0 Kudos
Altera_Forum
Honored Contributor II
742 Views

No worries... glad I could help in some small way. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif

0 Kudos
Reply