problem with USB mass storage driver imxRT1050 with FreeRTOS

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

problem with USB mass storage driver imxRT1050 with FreeRTOS

824 Views
euginjeyapradee
Contributor II

Hello,

We are using imxRT1050 wth Free rtos for one of our product. We have a problem with USB mass storage software, where when transferring small amount of data, transfer is successful. But when transferring large amoung of data, USB transfer fails. When the failure happens, i could see that the bulk endpoint buffer is less than 512 bytes of data, whereas, when i analyzed, it was not end of file or FAT header update. It was in the middle of transferring file data, where it was not supposed to transmit data lesser than 512 bytes.

euginjeyapradee_0-1675653024906.png

I am using SDK version 2.12.1 as above. 

I have attached the snapshot of the USB log that i have taken using data center software, where you can see the failure

I need some help to know whether anyone had faced this problem and if yes what was causing it. 
Appreciate your response

 

Regards,

Eugin

 

Labels (1)
Tags (2)
0 Kudos
4 Replies

569 Views
euginjeyapradee
Contributor II

Moved the buffer to the DTCM memory and the USB issue seemed to be resolved. Ran the test for several hours transferring data to the emmc and have not seen any failure. It is not advisable to have the USB buffer in cacheable region of memory as the USB transfer can fail at some point in time.

We were chasing down another problem related to SDRAM memory corruption for close to 6 months, due to an issue in IMXRT chipset on the AXI to SEMC queueing and re-ordering scheme settings. This issue was not covered in the ERRATA and we found the solution to this issue from the forum where they have faced the same issue, and a proposed solution for the same. This could probably be the reason for the USB issue that we have been seeing when the buffer was in the SDRAM (SDRAM corruption due to the reordering mechanism between AXI and SEMC).

I have copied the link related the issue that Tom was facing in imxRT1060 and i have also commented on the same forum regarding the similar problem we faced in imxRT1050 and the respective solution to it.

Solved: Re: i.MXRT1060 SEMC SDRAM Data Corruption - NXP Community

After applying the SDRAM corruption related fix, need to move the USB buffer back to the SDRAM memory and see whether the same problem could be happening or not. 

 

 

0 Kudos

778 Views
euginjeyapradee
Contributor II

This is the macro that we enabled. 

#define USB_HOST_CONFIG_BUFFER_PROPERTY_CACHEABLE (1U)

When we searched for this macro in the code we have come accross a function that allocates memory in the cacheable region of memory

SDK_Malloc(). THis functions aligns the memory before allocating. But the OSA_MemoryAllocate() function that allocates memory in the heap4 region does nor do the memory alignment properly i beleive

Regards,

Eugin

 

 

0 Kudos

779 Views
euginjeyapradee
Contributor II

We are not using Virtual disk and we are copying files from eMMC to the pen drive . When we use the USB descriptor structure and buffers to use non cacheable region of memory we are facing this problem. It looks like the problem is due to memory alignment when using the noncacheable region (using heap4). When we try to use the cacheable region of the memory for USB descriptors and buffers, transfer is happening properly

 

Regards,

Eugin 

0 Kudos

791 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @euginjeyapradee ,

Could it because the file you write is too big? The MSC demo use SRAM to store, the virtual disk is really small.

 

Regards,

Jing

0 Kudos