Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

uBlaze: Cannot make ram disk smaller than 3 mb

Posted by rasty1 on July 25, 2016

Hi, I'm trying to optimize a footprint and reduce size of Ram disk, but get error if I define it smaller than 3 mb. Image contains backtrace, place where it fails and some local variables. I'd appreciate any idea. https://rslutsker-gmail.tinytake.com/sf/ODUzNjA5XzM3MTEwMTE

Thanks Rasty


uBlaze: Cannot make ram disk smaller than 3 mb

Posted by rasty1 on July 25, 2016

Backtrace and variables

Attachments

ram_disk_error.png (72946 bytes)

uBlaze: Cannot make ram disk smaller than 3 mb

Posted by rtel on July 25, 2016

FAT imposes some minimum volume sizes. For example see the following thread: http://superuser.com/questions/74392/minimum-volume-size-for-fat16

The minimum size for FAT12 is smaller.


uBlaze: Cannot make ram disk smaller than 3 mb

Posted by rasty1 on July 25, 2016

How can I force it to use FAT12?


uBlaze: Cannot make ram disk smaller than 3 mb

Posted by heinbali01 on July 25, 2016

Unfortunately, the FF_Format() routine does not (yet) support FAT12, only FAT16 and FAT32.

Two parameters indicate your preference:

xPreferFAT16: try to use FAT16, if not possible, try FAT32 xSmallClusters: try small clusters first, if not possibly, try larger clusters.

Larger clusters are more efficient in terms of speed, small clusters have less waste of space.

Microsoft states that:

~~~~ if( CountofClusters < 4085 ) { /* Volume is FAT12 / } else if( CountofClusters < 65525 ) { / Volume is FAT16 / } else { / Volume is FAT32 */ } ~~~~

+FAT is following Microsoft's guidelines to get a maximum compatibility. However, you are not going to exchange your RAM disk with another system.

You could try the following in ff_format.c :

~~~~

ifdef ffconfigMINCLUSTERSFAT16
#define MIN_CLUSTERS_FAT16    ffconfigMIN_CLUSTERS_FAT16
else
#define MIN_CLUSTERS_FAT16    ( 4085 + 1 )
endif

~~~~

And define ffconfigMIN_CLUSTERS_FAT16 in your FreeRTOSFATConfig.h with a smaller value of e.g. :

~~~~ #define ffconfigMINCLUSTERSFAT16 1800 ~~~~

Regards.

Attachments

alternate (2056 bytes)

uBlaze: Cannot make ram disk smaller than 3 mb

Posted by heinbali01 on July 25, 2016

Just tested in the WIN32 demo project and it works as expected.

A 2MB RAM-disk will get 4023 clusters, a 1MB disk gets1991 clusters. In these cases, each cluster will contain a single sector of 512 bytes.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists