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.

[参考译文] TM4C129XNCZAD:SD 卡写入正在重启微控制器。

Guru**** 2405335 points


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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1084626/tm4c129xnczad-sd-card-write-is-rebooting-the-microcontroller

部件号:TM4C129XNCZAD

大家好,

我最近参加了一个项目,我们正在使用 TIVA TM4C 控制器和 TI RTOS。 多个 TI 提供的库类似。

1) grlib_rast_driver_8bpp.c{Graphic library}

2) SD 卡{<driverlib/sysctl.h> <driverlib/ssi.h><driverlib/GPIO .h>}  

我们都是新团队成员,将继续在特定平台上工作。

我很想知道我可以在哪里获得详细信息,如(TI RTOS 开发人员指南,图形库和 SD 卡相关)与这些信息相关的任何应用说明。

第2部分

>>目前,我面临一个与 SD 卡相关的问题。 我正在使用全 SD 卡测试 SD 卡的功能。

   SD 卡已满时,我正在尝试写入数据。 然后系统将重新启动。 看起来像内存异常。

    我很想知道如何在写入 SD 卡之前获得 SD 卡可用内存的状态。   

   如果 SD 卡驱动程序已提供 API,请指导我。

此致,

维沙尔·拉纳

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

    维沙尔,你好

    对于 TI-RTOS 宣传资料,我们有几个:

    TM4C/TIVA-C MCU 使用入门指南: https://www.ti.com/lit/ug/spruhu5d/spruhu5d.pdf

    TI-RTOS 用户指南: http://www.ti.com/lit/pdf/spruhd4

    SYS/BIOS 用户指南: http://www.ti.com/lit/pdf/spruex3

    对于图形,我们有两个特定于 BareMetal 的资源- TIA-RTOS for TIA-C 没有正式将图形库(grlib)移植到内核中,因此没有特定的资源:

    图形库用户指南: https://www.ti.com/lit/pdf/spmu300

    为 TM4C MCU 开发 LCD 应用程序注意: https://www.ti.com/lit/pdf/spma082

    [引用 userid="476357 " url="~ë/support/microcontrollers/arm-based microcontroller-group/arm-based microcontrollers/f/arm-based microcontroller-forum-forum/1084626/tm4c129xnczad-SD-card-write-reboot-the-microcontrollers"

    >>目前,我面临一个与 SD 卡相关的问题。 我正在使用全 SD 卡测试 SD 卡的功能。

       SD 卡已满时,我正在尝试写入数据。 然后系统将重新启动。 看起来像内存异常。

        我很想知道如何在写入 SD 卡之前获得 SD 卡可用内存的状态。   

       如果 SD 卡驱动程序已提供 API,请指导我。

    [/引用]

    我对 SD 卡 API 并不是很熟悉,因为我没有太多地使用它们,但这种 API 看起来会对您的需要有用:

    FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs);	/* Get number of free clusters on the drive */

    这在 ff.h 的[Install Path]\TivaWare_C_Series-2.2.0.295\thire_party\fatfs\src 下得到了说明

    您还应该在所有 API (即 FRESULT)运行时获得一个代码。 目录已满,有一个已定义的代码。 可能需要在应用程序代码中检查该代码,如果它被返回为 FR_DENIED,则会采取措施以避免程序崩溃。

    typedef enum {
    	FR_OK = 0,				/* (0) Succeeded */
    	FR_DISK_ERR,			/* (1) A hard error occurred in the low level disk I/O layer */
    	FR_INT_ERR,				/* (2) Assertion failed */
    	FR_NOT_READY,			/* (3) The physical drive cannot work */
    	FR_NO_FILE,				/* (4) Could not find the file */
    	FR_NO_PATH,				/* (5) Could not find the path */
    	FR_INVALID_NAME,		/* (6) The path name format is invalid */
    	FR_DENIED,				/* (7) Access denied due to prohibited access or directory full */   <---- Here is FR_DENIED description
    	FR_EXIST,				/* (8) Access denied due to prohibited access */
    	FR_INVALID_OBJECT,		/* (9) The file/directory object is invalid */
    	FR_WRITE_PROTECTED,		/* (10) The physical drive is write protected */
    	FR_INVALID_DRIVE,		/* (11) The logical drive number is invalid */
    	FR_NOT_ENABLED,			/* (12) The volume has no work area */
    	FR_NO_FILESYSTEM,		/* (13) There is no valid FAT volume */
    	FR_MKFS_ABORTED,		/* (14) The f_mkfs() aborted due to any parameter error */
    	FR_TIMEOUT,				/* (15) Could not get a grant to access the volume within defined period */
    	FR_LOCKED,				/* (16) The operation is rejected according to the file sharing policy */
    	FR_NOT_ENOUGH_CORE,		/* (17) LFN working buffer could not be allocated */
    	FR_TOO_MANY_OPEN_FILES,	/* (18) Number of open files > _FS_SHARE */
    	FR_INVALID_PARAMETER	/* (19) Given parameter is invalid */
    } FRESULT;

    此致,

    拉尔夫·雅各比