This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil RTX USB - USBH_MSC_Read more than 32 sectors fails

I am using the LPC4367 with the USB Host Mass Storage driver and Keil RTX. I have provided the linker in Keil with a 32kB chunk of RAM. I am successfully able to read up to 32 sectors from a USB flash drive in one command: USBH_MSC_Read(0, 0, 32, &usbbuffer1); at a rate of 17 MB/s. I am aiming to achieve 30 MB/s throughput but 21 MB/s would suffice with compression via LZ4. Reading only 1 sector per command results in horrible throughput (under 1MB/s) and reading more sectors per command would allow for the required performance. To achieve performance, no filesystem driver is used since it is not needed as the data is sequential and in the form of a stream so no need for separate files.

I have already tried increasing and lowering the heap and stack allocated for Keil RTX (RTX_Conf_CM.c), the USB driver thread (USBH_Config_0.c), and in startup_LPC43xx.s. None of these settings have allowed me to enter a number of sectors to read higher than 32 (Example: USBH_MSC_Read(0, 0, 33, &usbbuffer1);). I do not believe that it is a lack of memory problem but I am not very experienced with embedded processors or Keil as I am still a student. When debugging the code, it never passes the line and immediately goes to RTX os idle process and the light on the flash drive turns off (maybe the USB driver crashed???). It does not return an error code but hangs.

Any input on what this problem may be and how to potentially go about fixing it would be appreciated. Otherwise, any other way of achieving a higher throughput would also be appreciated as this is the desired result. Thank you!