USB Mass Storage Device SPI External Flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB Mass Storage Device SPI External Flash

Jump to solution
793 Views
rd1
Contributor II

Hello,

i'm trying to implement a mass storage device on the LPCXpresso55s69 board that uses an external flash connected to the micro with an SPI protocol.

I started with looking at your examples dev_msc_disk_freertos and dev_msc_ramdisk_freertos using MCUXpresso IDE to get the info that i needed. I modified the function "USB_DeviceMscCallback(class_handle_t handle, uint32_t event, void *param)" replacing code below in the dev_msc_ramdisk_freertos example

errorCode =

          USB_Disk_WriteBlocks(lba->buffer, lba->offset, lba->size >> USB_DEVICE_DISK_BLOCK_SIZE_POWER);

errorCode =

          USB_Disk_ReadBlocks(lba->buffer, lba->offset, lba->size >> USB_DEVICE_DISK_BLOCK_SIZE_POWER);

with a function that reads and writes in the external flash.

I also changed the LBA size with 4096 cause because the sector size of the flash is 4096 and it's easier to program an entire sector.

The function terminates correctly and it seems to write and read the external flash.

But when i initialize the msd from the pc (cause when it's connected the computer sees a RAW msd and needs to initialize it) the computer cannot terminate the initilization.

I'm stuck here and i really don't know how to find the solution of this problem since everythings looks "fine" and gives no error.

 

Is there any function that i can look at or any common problem with this situation?

Labels (2)
0 Kudos
1 Solution
768 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

It seems this is the same question with your case in salesforce, and I saw you close it,

do you still have any question about this?

 

 

View solution in original post

0 Kudos
1 Reply
769 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

It seems this is the same question with your case in salesforce, and I saw you close it,

do you still have any question about this?

 

 

0 Kudos