Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

Compact Flash and the Fat File System

Does anyone have a sample app that instansiates the compact flash device and mounts it as a flash file system.

According to the docs, I should be able to define the define using:

ALTERA_AVALON_CF_INSTANCE( CF_0, cf_0);

where cf_o is the name of my SOPC compact flash device.

However, this is defined in altera_avalon_cf_devices.c and the macro is not visable in my file.

To mount the file system I am calling the following( which fails, -1)

err = mount( "/dev/cf_0a/0", "/", "fatfs" );

Any advice would be appriciated.

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by graham615@Jan 22 2006, 01:53 PM

    does anyone have a sample app that instansiates the compact flash device and mounts it as a flash file system.

    according to the docs, i should be able to define the define using:

    altera_avalon_cf_instance( cf_0, cf_0);

    where cf_o is the name of my sopc compact flash device.

    however, this is defined in altera_avalon_cf_devices.c and the macro is not visable in my file.

    to mount the file system i am calling the following( which fails, -1)

    err = mount( "/dev/cf_0a/0", "/", "fatfs" );

    any advice would be appriciated.

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=12317)

    --- quote end ---

    --- Quote End ---

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    OK......I did not dig deep enough or in the right place. In the ecos install directory, hal\devices.h contains the instansiation entry for the compact flash device. It does not need to be included in my code. I still have the problem of not being able to mount the disk.

    I am using 5.1 and the CF IP included with Nios5.1, not the version provided on the forum. I am assuming that this would have been updated in the relased of 5.1.

    I will make the mod on the board to force the card into IDE mode and add a power cycle to the code. I will report the results of these actions. In the mean time, if anyone has any other suggestions...........