I have successfully opened and executed the example program USBX Host Class Mass Storage with the Module Guide R11AN0173EU0101.
I have successfully executed this program in a S5D9 PK with the SSP 1.4.0 and it works well.
Now I'm trying to do the same on a proprietary electronic board with the micro Synergy S3 R7FS3A6783A01CFM.
I create the thread and add the FileX module in USB Mass Storage correctly. As it is an S3 I can only use USB Controller Selection USBFS.
I configure all the modules in a manner as similar as possible to the project with the S5D9, except that the memory of USBX Pool Memory Size can only be a maximum of 17000, since if I put more it does not compile me because it does not enter RAM.
The problem is that in execution, in the "void ux_host_init0 (void)" function within the common_data.c source, the / ** Register to USB host controller. * / UINT status_g_ux_host_0 = ux_host_stack_hcd_register ((UCHAR *) "g_sf_el_ux_hcd_fs_0", g_sf_el_ux_hcd_fs_0_initialize, R_USBFS_BASE, UX_SYNERGY_CONTROLLER); returns error 0x12: UX_MEMORY_INSUFFICIENT.
How should I do the configuration to be able to work with the USB and be able to read and write files on a pendrive?
Thank in advance.
In reply to WarrenM:
In reply to Hanton:
The response from Express Logic
"USBX will have a hard time running on the host with less than 32k of RAM. there is just too much it needs.”
Now that I know this, I looked at the SSP 1.5.0 release notes and see that the S3A6 isn't listed as supporting Host Frameworks.
I should have checked there first. There isn't enough memory available for the framework and application code.
In reply to Renesas Karol:
Hi Karol No, it does not require long names, with 8.3 it would be enough. How can I reduce USBX Mass Storage Host + FileX to 16KB of RAM?
What's more, it would be useful if the file system only allows me to read, I do not need writing at the moment. Thanks Hanton
Please find attached a project for minimal USB Mass Storage Host implementation with FileX: s3_dk_ux_mass_host_mini_1_3_3.zip It may be possible to reduce memory required even further. I've defined following preprocessor symbols:
* UX_HOST_SIDE_ONLY* UX_MAX_CLASS_DRIVER=2 (you can set this to 1, I intended for my project to support another class)
Additionally, FileX Source has following settings modified:
* Max Long Name Len = 13* Max Last Name Len = 13* Max Sector Cache = 2* Max Fat Cache = 8* Media Search Cache = Disabled* Media Statistics = Disabled
USBX Source overrides default settings with following:
* Maximum Host Controllers = 1* Maximum Devices = 1* Maximum TDs = 32* Maximum Isochronous TDs = 1
And for USBX Host Class Mass Storage Source:
* Maximum number of SCSI logical units = 1* Maximum number of storage media instance = 1* Storage memory size in bytes for FileX used for data transfer = 1024* Maximum transfer size in bytes in one BOT data-transport phase = 1024* Stack size for the Mass Storage Class internal thread = 512
This allows project to successfully initialize and run with USBX Pool Memory Size set to 15360. Project is for DK-S3A7 (as it has a USB host port) but will easily migrate to S3A6 board.