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 驱动程序和 FreeRTOS API

Guru**** 2535750 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1232147/processor-sdk-am64x-mcu-sdk-mmcsd-driver-and-freertos-api

器件型号:PROCESSOR-SDK-AM64X

您好

我的客户正在 AM64 MCU+ SDK 上开发 AM64。

现在、我将检查 mmcsd_file_io 示例项目中的 MMCSD 驱动程序。

问题1. ff_fopen ()中允许的文件名大小是多少?

我想知道允许多少 ASCII 字符串。 我很高兴能提供字节和字符串。

问题2. 在该 API 中、"收件人文件是 FAT16?" ,FAT32? 或者别的吗?

谢谢。

GR

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    GR、

    感谢您的查询、我正在查看开发团队的查询、请预计一两天内得到答复。

    此致

    安舒

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Anshu、您好!

    感谢您的支持。

    我很高兴你让我有任何更新。

    此致、

    GR

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    GR

    Unknown 说:
    ff_fopen ()中允许的文件名大小是多少?

    中定义了 ff_fopen 函数  \SOURCE\FS\freertos_fat\freertos-FAT\ff_stdio.c

    这是免费 RTOS FAT 库的一部分、请参阅以下说明

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

    该条规定:

    如果文件无法打开、则返回 NULL、并  设置任务的 errno 以指示原因。 任务可以使用 stdioGET_errno () API 函数获取其 errno 值。

    链接到下面的标准错误值,如果路径名太长,则设置错误值后  

    91 pdFREERTOOS_ERRNO_ENAMETOOLONG 文件或路径名太长

    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 标准 API

    请点击下面的链接  

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

    fconfigMAX_FILENAME

    设置文件名(包括路径)的最大长度。 请注意、这个定义的值与+FAT 库的最大栈使用量直接相关。 在某些 API 中、将在栈上声明大小为"ffconfigMAX_FILENAME"的字符缓冲区。

    从文件: sources\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

    希望这对您有所帮助

    此致

    安舒

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Anshu、您好!

    感谢您提供的信息!

    我明白了。

    此致、

    GR