Hello, I would like to write an application using the internal storage of the K64F (512KiB, or even better 768KiB if possible) as USB MSD.
The intended use is for the user to move files to the MSD, which the program will then use.
Enabling USB MSD compiles okay it seems, but setting
//#define SDCARD_SUPPORT // SD-card interface
#define FLASH_FAT // FAT in internal flash
//#define SPI_FLASH_FAT // FAT in external SPI flash
#define FAT_EMULATION
Does not compile.
I get:
Building file: ../uTasker/utFAT/mass_storage.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g -D_KINETIS -D_KDS -D_GNU -I"[i]removed[/i]" -std=c99 -MMD -MP -MF"uTasker/utFAT/mass_storage.d" -MT"uTasker/utFAT/mass_storage.o" -c -o "uTasker/utFAT/mass_storage.o" "../uTasker/utFAT/mass_storage.c"
../uTasker/utFAT/mass_storage.c: In function 'fnMassStorage':
../uTasker/utFAT/mass_storage.c:2061:32: error: 'DISK_EM_FAT' undeclared (first use in this function)
if (iDiskNumber == DISK_EM_FAT) {
^
../uTasker/utFAT/mass_storage.c:2061:32: note: each undeclared identifier is reported only once for each function it appears in
../uTasker/utFAT/mass_storage.c:2072:17: error: continue statement not within a loop
continue;
^
../uTasker/utFAT/mass_storage.c: In function 'fnGetDataPointer':
../uTasker/utFAT/mass_storage.c:7380:14: error: 'DISK_EM_FAT' undeclared (first use in this function)
iDisk -= DISK_EM_FAT;
^
../uTasker/utFAT/mass_storage.c: In function 'fnGenerateFAT':
../uTasker/utFAT/mass_storage.c:7403:46: error: 'DISK_EM_FAT' undeclared (first use in this function)
int iDisk = (ptr_utDisk->ucDriveNumber - DISK_EM_FAT);
^
../uTasker/utFAT/mass_storage.c: In function 'fnReadEmulatedSector':
../uTasker/utFAT/mass_storage.c:7562:18: error: 'DISK_EM_FAT' undeclared (first use in this function)
iDisk -= DISK_EM_FAT;
^
../uTasker/utFAT/mass_storage.c: At top level:
../uTasker/utFAT/mass_storage.c:7610:12: error: redefinition of 'fnReadSector'
extern int fnReadSector(unsigned char ucDisk, unsigned char *ptrBuffer, unsigned long ulSectorNumber)
^
../uTasker/utFAT/mass_storage.c:7226:12: note: previous definition of 'fnReadSector' was here
extern int fnReadSector(unsigned char ucDisk, unsigned char *ptrBuffer, unsigned long ulSectorNumber)
^
../uTasker/utFAT/mass_storage.c:7618:12: error: redefinition of 'fnWriteSector'
extern int fnWriteSector(unsigned char ucDisk, unsigned char *ptrBuffer, unsigned long ulSectorNumber)
^
../uTasker/utFAT/mass_storage.c:7263:12: note: previous definition of 'fnWriteSector' was here
extern int fnWriteSector(unsigned char ucDisk, unsigned char *ptrBuffer, unsigned long ulSectorNumber)
^
../uTasker/utFAT/mass_storage.c: In function 'fnPrepareRootDirectory':
../uTasker/utFAT/mass_storage.c:7679:50: error: 'DISK_EM_FAT' undeclared (first use in this function)
int iDisk = (ptr_utDisk->ucDriveNumber - DISK_EM_FAT);
^
../uTasker/utFAT/mass_storage.c: At top level:
../uTasker/utFAT/mass_storage.c:7849:22: error: redefinition of 'fnGetDiskInfo'
extern const UTDISK *fnGetDiskInfo(unsigned char ucDisk)
^
../uTasker/utFAT/mass_storage.c:7275:22: note: previous definition of 'fnGetDiskInfo' was here
extern const UTDISK *fnGetDiskInfo(unsigned char ucDisk)
^
../uTasker/utFAT/mass_storage.c:1578:20: warning: 'fnReadPartialEmulatedSector' used but never defined [enabled by default]
static int fnReadPartialEmulatedSector(UTDISK *ptr_utDisk, unsigned long ulSector, void *ptrBuf, unsigned short usOffset, unsigned short usLength);
^
uTasker/utFAT/subdir.mk:18: recipe for target 'uTasker/utFAT/mass_storage.o' failed
make: *** [uTasker/utFAT/mass_storage.o] Error 1
Is there a specific way I can accomplish my goal easily?
And is the source code for the
USB-MSD with SD card, internal Flash disk and external SPI-Flash disk
example on the Kinetis landing page available (So I can strip out the SD-Card and SPI-Flash code)?