Hi Federico
The uTasker Kinetis project supports USB-MSD in an AT45DB161 (16 Mbit SPI Flash) by enabling the following defines:
- #define SPI_FLASH_FAT // enable FAT in SPI flash
- #define SPI_FLASH_AT45DB161 // enable SPI device type
with option of 512 or 528 byte pages [#define SPI_FLASH_PAGE_LENGTH 512 or #define SPI_FLASH_PAGE_LENGTH 528]
- #define USB_INTERFACE // enable USB interface
- #define USB_MSD_LOADER // enable USB-MSD class
Then the application can use the integrated utFAT interface to read from the drive in the SPI Flash and copy the data to a UART.
Since you haven't developed with the uTasker framework you will need to find solutions for the following:
1. USB driver and USB-MSD class (if not already available)
2. Adapt the MSD class (if not an option in it already) to work with SPI Flash (will need an SPI driver and driver interface to the chip type used)
3. Integrate a FAT file system with SPI Flash support (interface should be shared with USB-MD class) to allow the application access to the files that were written by the USB host.
An alternative that I see, however, is to adapt the USB-MSD boot loader to emulate two LUMs (one for the firmware upload and one for a second SPI disk). Then the application needs neither its own USB-MSD mode nor FAT since the loader can save the file linearly and not as FAT. This can be performed quite easily with the uTasker serial loader as long as SPI Flash from ATMEL, ST or SST (or compatible) are available.
Regards
Mark
Kinetis: http://www.utasker.com/kinetis.html
K60: µTasker Kinetis TWR-K60N512 support / µTasker Kinetis TWR-K60D100M support / µTasker Kinetis TWR-K60F120M support
For the complete "out-of-the-box" Kinetis experience and faster time to market