AnsweredAssumed Answered

External RAM with RAM Disk USB App

Question asked by js tessier on Apr 21, 2016
Latest reply on Apr 29, 2016 by isaacavila


Hi,

 

I am using the dev_msd_cdc_bm_twrk65f180m app as a starting example with the RAM Disk configuration as storage for the MSD.

 

The example is using the internal RAM as storage and want to modify the example to use the external ram of my development board.

 

I have the SDRAM driver working and can read and write to the external RAM in my main routine.

 

I have modified the disk_struct_t to accept a pointer to my external RAM instead of fix address in internal RAM.

 

typedef struct _disk_variable_struct

{

    msd_handle_t app_handle;

    uint32_t start_app;

    uint16_t speed;

    #if RAM_DISK_APP

    /* disk space reserved */

  //uint8_t storage_disk[DISK_SIZE];

    uint8_t * storage_disk;

    #endif

    uint8_t disk_lock;

} disk_struct_t;

 

I have modified my scatter file to create a section in external RAM for my new bigger size array as follow:

 

__attribute__ ((section(".ext_ram"))) uint8_t storage_disk2[DISK_SIZE];

 

Then assign the array to pointer

...

    msc_disk_init(&g_composite_device.msc_disk);

    g_composite_device.msc_disk.storage_disk = storage_disk2;

...

By doing these simple changes I cant get the drive (MSD) to work (Doesnt show as drive). I would assume that it doesn't matter where the data goes unless there is something wrong when accessing the SDRAM controller inside the USB MSD callback function "Disk_USB_App_Class_Callback".

 

I have tried a several thing and can't get it to work, any help would be really appreciated.

 

Regards.

Outcomes