This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Filesystem: How to check if FAT drive is initialzed or not?

Hi,

Re: MDK-ARM CM3 Middleware FileSystem. FAT Drive on a NAND Flash ("N0:").

I'm looking for a method to check, wether a FAT drive is initialized or not! I must check, wether finit() had already been called or not.

I could not find a sufficient "high"-level Utility Routine. Thus I considered about using IO Control Interface Routines. Therfore I first had to get an id:
fs_ioc_get_id("N0:") returns drv_id = 1 on an uninitialized(!) drive which causes further fs_ioc-functions to crash.

Do anyone have an idea, how to check wether a (nonremovable NAND Flash) FAT drive is initialized or not?

Best regards
Matz

Parents
  • Sorry, I wasn't precise enough in my question:
    I only want to check wether finit() has already been called.
    Thus to ensure that the file system and the driver are initialized for the drive.

    There is no need for me to check wether the drive is formatted or something else.

    The background:
    I basicly want to call fs_ioc_get_id() to get a drv_id. But I must be sure that drv_id is valid.
    One way in general to ensure that is to call finit previously. But in my app I should not call finit if it has been already called before, because a second finit will unmount the drive. This will interfere with other stuff accessing the mounted drive.

    Maybe I'm thinking too complicately. But I dont find a way to check wether the drv_id from fs_ioc_get_id is valid.

Reply
  • Sorry, I wasn't precise enough in my question:
    I only want to check wether finit() has already been called.
    Thus to ensure that the file system and the driver are initialized for the drive.

    There is no need for me to check wether the drive is formatted or something else.

    The background:
    I basicly want to call fs_ioc_get_id() to get a drv_id. But I must be sure that drv_id is valid.
    One way in general to ensure that is to call finit previously. But in my app I should not call finit if it has been already called before, because a second finit will unmount the drive. This will interfere with other stuff accessing the mounted drive.

    Maybe I'm thinking too complicately. But I dont find a way to check wether the drv_id from fs_ioc_get_id is valid.

Children