This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

low power mode and fatfs shutdown

Hi,

We are trying to power optimise our device but in the sleep/powerdown mode we seem to be using much more power than expected.

I am seeing consumption of approx 330uA in this low power mode.

So I am now hunting for peripherals that have not been "un-initied".

One of these is our sdcard/fatfs; we just removed the sdcard power but haven't gone through the process of unmounting filesystems, and ensuring peripherals are un-inited.
Could this be my issue?

I have done quick and dirty and just called app_sdc_uninit() in my shutdown procedure and now current sink is 80uA; much better.

But what is correct sequence to gracefully shutdown the filesystems and this sub-system?

Regards,

Owain

Parents
  • But what is correct sequence to gracefully shutdown the filesystems and this sub-system?

     app_sdc_uninit() seems like a reasonable way to uninit the peripherals, and for unmounting the filesystems I think you can use the f_close() function in the fatfs API. I don't think the filesystem is taken care of in app_sdc_uninit().

  • I think you can ummount filesystems using the f_mount() call like....

    //Ensure no mounted drives
    (void)f_mount(NULL, "0", 1);
    (void)f_mount(NULL, "1", 1);

    We use this in our factory reset routine before partitioning with f_disk(), and making filesystems with f_mkfs() and finally labelling with f_setlabel().

    Its just I am used to using disks etc under an OS; where disk management is taking place in the background; you would sync/flush filesystems and unmount. On return from the unmount you know all housekeeping has been done in the background and the filesystems are intact.

Reply
  • I think you can ummount filesystems using the f_mount() call like....

    //Ensure no mounted drives
    (void)f_mount(NULL, "0", 1);
    (void)f_mount(NULL, "1", 1);

    We use this in our factory reset routine before partitioning with f_disk(), and making filesystems with f_mkfs() and finally labelling with f_setlabel().

    Its just I am used to using disks etc under an OS; where disk management is taking place in the background; you would sync/flush filesystems and unmount. On return from the unmount you know all housekeeping has been done in the background and the filesystems are intact.

Children
Related