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

About using compact flash with mp3 files?

Altera_Forum
Honored Contributor II
1,254 Views

Can i use the compact flash for storing mp3 files and accessing them in the niosII IDE,, is there anything i must keep in mind in this process? 

 

Thanks
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
434 Views

Hello ahmedazzam, 

 

Of course you can store mp3s on the CompactFlash. If you save the files with your PC you will need a filesystem (FAT16/FAT32, …) to read the stuff with the Nios. You can buy a filesystem or build it up by your own. 

 

Regards, 

niosIIuser
0 Kudos
Altera_Forum
Honored Contributor II
434 Views

Thanks for your answer but i wanna ask you about the way(s) you can store files on the compact flash,,and another thing can i open a mp3 file on the PC just for simulation and without the kit using the nios IDE 

 

Thanks alot
0 Kudos
Altera_Forum
Honored Contributor II
434 Views

Hello, 

 

a CompactFlash card behaves in the same ways like a harddisk. Before using a HDD with a PC you have to format it with a filesystem like FAT, NTFS, … It is also possible to store data in raw format without a filesystem. But no operating system will work with the HDD. If you want to exchange data like mp3s (PC <-> Nios) you should use a filesystem. FAT16 is a very simple one. A lot of small mp3 player projects in the web are suing a FAT16 filesystem together with a HDD, CompactFlash, … 

 

It is possible to simulate the behaviour of a CompactFlash card with the the Nios II IDE. It is some work and of course you will need a simulation model of the CompactFlash card. I don’t know if there is a ready one in the web – perhaps you have to build your own one. 

 

Reagrds, 

niosIIuser
0 Kudos
Altera_Forum
Honored Contributor II
434 Views

The (free) eCOS OS includes support for the compact flash peripheral AND FAT file system. It would require getting up to speed on eCOS, but its built in and ready to go. 

 

Another alternative is to use the new (in 5.0) host file system. This allows you to open a file through JTAG (the file resides in your PC, but Nios opens it just as if it were there in its own private file system).
0 Kudos
Altera_Forum
Honored Contributor II
434 Views

Thanks, 

 

but i wanna focus on these words" Another alternative is to use the new (in 5.0) host file system. This allows you to open a file through JTAG (the file resides in your PC, but Nios opens it just as if it were there in its own private file system)."  

 

1)How does the nios actually opens the file on the PC(i mean does [fopen] works in this case or what?) 

2) Will this need an operating system or i can do without it? 

 

Thanks,
0 Kudos
Altera_Forum
Honored Contributor II
434 Views

 

--- Quote Start ---  

originally posted by ahmedazzam@Jun 17 2005, 01:32 PM 

1)how does the nios actually opens the file on the pc(i mean does [fopen] works in this case or what?) 

2) will this need an operating system or i can do without it? 

--- Quote End ---  

 

Yes, nios uses fopen. You fopen a mount-point that you defined in the Host file system setup (right click your system library, go to properties --> Software Components --> Altera Host Based File System to set it all up). 

 

No OS is required. 

 

...this is a bit obscure but there is an example application. Look at the zip file system example design in Nios II 5.0. In addition to reading the flash file system, it reads and writes a file using the host file system. This should get you on your feet with this feature.
0 Kudos
Reply