Ignore:
Timestamp:
Jan 30, 2025, 8:24:51 AM (3 months ago)
Author:
Zed
Message:

FatFs? is working, but without DMA.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ctrl/firmware/Main/CubeMX/FATFS/Target/ffconf.h

    r74 r75  
    2626#include "stm32h7xx_hal.h"
    2727#include "bsp_driver_sd.h"
     28#include "cmsis_os.h" /* _FS_REENTRANT set to 1 and CMSIS API chosen */
    2829
    2930/*-----------------------------------------------------------------------------/
     
    4647/   3: f_lseek() function is removed in addition to 2. */
    4748
    48 #define _USE_STRFUNC         2      /* 0:Disable or 1-2:Enable */
     49#define _USE_STRFUNC         0      /* 0:Disable or 1-2:Enable */
    4950/* This option switches string functions, f_gets(), f_putc(), f_puts() and
    5051/  f_printf().
     
    127128/  ff_memfree(), must be added to the project. */
    128129
    129 #define _LFN_UNICODE    1 /* 0:ANSI/OEM or 1:Unicode */
     130#define _LFN_UNICODE    0 /* 0:ANSI/OEM or 1:Unicode */
    130131/* This option switches character encoding on the API. (0:ANSI/OEM or 1:UTF-16)
    131132/  To use Unicode string for the path name, enable LFN and set _LFN_UNICODE = 1.
    132133/  This option also affects behavior of string I/O functions. */
    133134
    134 #define _STRF_ENCODE    3
     135#define _STRF_ENCODE    0
    135136/* When _LFN_UNICODE == 1, this option selects the character encoding ON THE FILE to
    136137/  be read/written via string I/O functions, f_gets(), f_putc(), f_puts and f_printf().
     
    210211/  buffer in the file system object (FATFS) is used for the file data transfer. */
    211212
    212 #define _FS_EXFAT       1
     213#define _FS_EXFAT       0
    213214/* This option switches support of exFAT file system. (0:Disable or 1:Enable)
    214215/  When enable exFAT, also LFN needs to be enabled. (_USE_LFN >= 1)
    215216/  Note that enabling exFAT discards C89 compatibility. */
    216217
    217 #define _FS_NORTC       1
     218#define _FS_NORTC       0
    218219#define _NORTC_MON      1
    219220#define _NORTC_MDAY     1
     
    239240/      lock control is independent of re-entrancy. */
    240241
    241 #define _FS_REENTRANT    0  /* 0:Disable or 1:Enable */
     242#define _FS_REENTRANT    1  /* 0:Disable or 1:Enable */
     243
     244#define _USE_MUTEX       1 /* 0:Disable or 1:Enable */
    242245#define _FS_TIMEOUT      1000 /* Timeout period in unit of time ticks */
    243 #define _SYNC_t          NULL
     246#define _SYNC_t          osMutexId_t
    244247/* The option _FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs
    245248/  module itself. Note that regardless of this option, file access to different
     
    259262/  included somewhere in the scope of ff.h. */
    260263
    261 /* define the ff_malloc ff_free macros as standard malloc free */
     264/* define the ff_malloc ff_free macros as FreeRTOS pvPortMalloc and vPortFree macros */
    262265#if !defined(ff_malloc) && !defined(ff_free)
    263 #include <stdlib.h>
    264 #define ff_malloc  malloc
    265 #define ff_free  free
     266#define ff_malloc  pvPortMalloc
     267#define ff_free  vPortFree
    266268#endif
    267269
Note: See TracChangeset for help on using the changeset viewer.