This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM64X: MCU+SDK MMCSD driver and FreeRTOS API

Expert 1996 points
Part Number: PROCESSOR-SDK-AM64X

Hi

My customer is developing AM64 at AM64 MCU+ SDK.

Now, I'm checking MMCSD driver in mmcsd_file_io sample project.

Question1. How many size allowed filename in the ff_fopen()?

I want to know how many ASCII strings allowed. I'm glad if provide byte and strings.

Question2. In this API, Generete file is FAT16? , FAT32? or else?

Thanks,

GR

  • GR,

    Thanks for your query, I am checking the query from dev team please expect response in a day or two.

    Regards

    Anshu

  • Hi Anshu,

    Thank you to your support.

    I'm glad if you let me any update.

    Best regards,

    GR

  • GR

    How many size allowed filename in the ff_fopen()?

    the ff_fopen function is defined in <SDK Install Path>\source\fs\freertos_fat\FreeRTOS-FAT\ff_stdio.c

    This is part of the Free RTOS FAT Library, See Description below

    https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_FAT/stdio_API/ff_fopen.html

    it states :

    If the file could not be opened then NULL is returned and the task's errno is set to indicate the reason. A task can obtain its errno value using the stdioGET_ERRNO() API function.

    Link to STD error values below , if the pathname is too long following Error value is set 

    91 pdFREERTOS_ERRNO_ENAMETOOLONG File or path name too long

    www.freertos.org/.../errno.html

    FF_FILE * ff_fopen( const char * pcFile,
                        const char * pcMode )
    {
        FF_FILE * pxStream = NULL;
        FF_DirHandler_t xHandler;
        FF_Error_t xError;
        uint8_t ucMode;
    
        /* Insert the current working directory in front of relative paths. */
        pcFile = prvABSPath( pcFile );
    
        /* Look-up the I/O manager for the file system. */
        if( FF_FS_Find( pcFile, &xHandler ) == pdFALSE )
        {
            stdioSET_ERRNO( pdFREERTOS_ERRNO_ENXIO ); /* No such device or address. */
        }
        else
        {
            /* Now 'xHandler.pcPath' contains an absolute path within the file system.
             * Translate a type string "r|w|a[+]" to +FAT's mode bits. */
            ucMode = FF_GetModeBits( pcMode );
    
            pxStream = FF_Open( xHandler.pxManager, xHandler.pcPath, ucMode, &xError );
            stdioSET_ERRNO( prvFFErrorToErrno( xError ) );
    
            #if ( ffconfigUSE_NOTIFY != 0 )
                {
                    if( ( pxStream != NULL ) && ( ( ucMode & ( FF_MODE_WRITE | FF_MODE_APPEND ) ) != 0 ) )
                    {
                        /*_RB_ Function	name needs updating. */
                        callFileEvents( pcFile, eFileCreate );
                    }
                }
            #endif /* ffconfigUSE_NOTIFY */
    
            #if ( ffconfigDEV_SUPPORT != 0 )
                {
                    if( pxStream != NULL )
                    {
                        FF_Device_Open( pcFile, pxStream );
                    }
                }
            #endif /* ffconfigDEV_SUPPORT */
        }
    
        return pxStream;
    }

    FreeRTOS-Plus-FAT Standard APIs

    Please check the below link 

    https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_FAT/Embedded_File_System_Configuration.html#ffconfigMAX_FILENAME

    fconfigMAX_FILENAME

    Sets the maximum length for file names, including the path. Note that the value of this define is directly related to the maximum stack use of the +FAT library. In some API's, a character buffer of size 'ffconfigMAX_FILENAME' will be declared on stack.

    From File : source\fs\freertos_fat\FreeRTOS-FAT\include\FreeRTOSFATConfigDefaults.h

    /* Sets the maximum length for file names, including the path.
     * Note that the value of this define is directly related to the maximum stack
     * use of the +FAT library. In some API's, a character buffer of size
     * 'ffconfigMAX_FILENAME' will be declared on stack. */
        #define ffconfigMAX_FILENAME    129

    Hope this helps

    Regards

    Anshu

  • Hi Anshu,

    Thank you to your information!

    I understood it.

    Best regards,

    GR