FAT on USB Mass Storage

Hi,

 

I would like to use the USB port to connect a memory stick and use it read/write files.

I have a old example here which uses "g_fx_media0 FileX on USB Mass Storage".

I am currently using SSP 1.2.1 and I am not finding this framework to add to my project.

 

Which framework should I use to achieve what I need?

Parents
  • Hi Mad River,

    You can find this stack in X-Ware > FileX > FileX on USB Mass Storage. In USBX on ux configuration make sure to set USBX Pool Memory Size to 65536 bytes and probably you may want to enable Auto Media Initialization in the top-level block of this stack.

    Regards,
    adboc
  • Hi adboc,

    I inserted the stack as you indicated.
    Tried to compile it and got these errors:

    ../src/synergy_gen/common_data.c: In function 'ux_host_init0':
    ../src/synergy_gen/common_data.c:299:59: error: 'SYNERGY_NOT_DEFINED_initialize' undeclared (first use in this function)
    SYNERGY_NOT_DEFINED_initialize, SYNERGY_NOT_DEFINED,
    ^
    ../src/synergy_gen/common_data.c:299:91: error: 'SYNERGY_NOT_DEFINED' undeclared (first use in this function)
    SYNERGY_NOT_DEFINED_initialize, SYNERGY_NOT_DEFINED,
    ^
    ../src/synergy_gen/common_data.c:300:59: error: 'UX_SYNERGY_CONTROLLER' undeclared (first use in this function)

     

     

    The function is that one:
    void ux_host_init0(void)
    {
    /** Register a USB host controller. */
    UINT status_g_ux_host_0 = ux_host_stack_hcd_register ((UCHAR*) "SYNERGY_NOT_DEFINED",
    SYNERGY_NOT_DEFINED_initialize, SYNERGY_NOT_DEFINED,
    UX_SYNERGY_CONTROLLER);
    if (UX_SUCCESS != status_g_ux_host_0)
    {
    g_ux_host_0_err_callback (NULL, &status_g_ux_host_0);
    }
    }

    What should I create to replace SYNERGY_NOT_DEFINED_initialize, SYNERGY_NOT_DEFINED and UX_SYNERGY_CONTROLLER?

     

     

     

    EDIT:

    I saw this is new content from 1.2.1.

    The only examples I could find are using 1.2.0.

    Is there any examples of how to use the FX on USB in the new 1.2.1? (Or at least how to compile the auto-generated code)

     

  • I tried to replace:

    /** Register a USB host controller. */
    UINT status_g_ux_host_0 = ux_host_stack_hcd_register ((UCHAR*) "SYNERGY_NOT_DEFINED",
    SYNERGY_NOT_DEFINED_initialize, SYNERGY_NOT_DEFINED,
    UX_SYNERGY_CONTROLLER);

     

    for:

    /** Register a USB host controller. */
    UINT status_g_ux_host_0 = ux_host_stack_hcd_register ((UCHAR*) "Anything",
    ux_hcd_synergy_initialize, UX_SYNERGY_CONTROLLER,
    UX_SYNERGY_CONTROLLER_S3A7);

     

    But the e2studio undo my changes when I compile the code! The code goes back to its original content (which doesn't compile!).

    So, the Synergy generate a file that doesn't compile and I can't edit that file.

    Now, what can I do?

Reply
  • I tried to replace:

    /** Register a USB host controller. */
    UINT status_g_ux_host_0 = ux_host_stack_hcd_register ((UCHAR*) "SYNERGY_NOT_DEFINED",
    SYNERGY_NOT_DEFINED_initialize, SYNERGY_NOT_DEFINED,
    UX_SYNERGY_CONTROLLER);

     

    for:

    /** Register a USB host controller. */
    UINT status_g_ux_host_0 = ux_host_stack_hcd_register ((UCHAR*) "Anything",
    ux_hcd_synergy_initialize, UX_SYNERGY_CONTROLLER,
    UX_SYNERGY_CONTROLLER_S3A7);

     

    But the e2studio undo my changes when I compile the code! The code goes back to its original content (which doesn't compile!).

    So, the Synergy generate a file that doesn't compile and I can't edit that file.

    Now, what can I do?

Children
  • Hi Mad River,

    The SYNERGY_NOT_DEFINED is a place holder because you have not selected a required module and configured it.

    Please verify your configuration is correct.  You can not edit files in the synergy or the synergy_gen folders because they are auto-generated when you build.  You must change your configuration in the Synergy Configurator to fix these files.

    Here is an example of properly configured USB mass storage host configuration:

    -Gary

  • Hi Gary,

    I was missing the HCD module. I was expecting that the Synergy would not generate the code if something is missing, but it doesn't show any sort of error in the Threads tab.

    Anyway, it compile now! Tomorrow I will test it.

    Thank you very much!