USBX Mass Storage Host S5D9

Hi

I am working on a project that reads files from a pendrive and records them in flash memory. 

I have the USBX Mass Storage example on the S5D9 development board and it works correctly.

I have a user project that is already running on that same S5D9 board and that has 485 communications with other devices, and I want to add this functionality to read files from a pendrive in this project.

When I add a new thread usb_thread, with a FileX on USB Mass Storage, and I configure it exactly like the sample project, I get an error when trying to debug the application.

In common_data.c, line 215, in the function ux_common_init0, the inicialization of the host stack return an error, the line 

status_ux_init = ux_host_stack_initialize (ux_system_host_change_function); return 0x16 (UX_THREAD_ERROR).

All the configuration of two projects are equal. I do not know where the error may be, can someone help me with this?

The e2studio is version 6.3.0 and today I installed the ssp version 1.5.1.

Thanks

  • Hi Hanton,

    How's this issue? Were you able to solve it?

    JB
    RenesasRulz Forum Moderator

    https://renesasrulz.com/
    https://academy.renesas.com/
    https://en-us.knowledgebase.renesas.com/

  • In reply to JB:

    Hi JB

    No, I have not solved it yet. I do not know where to continue investigating, we do not have much experience with Renesas, we are almost starting.

    Hanton
  • In reply to Hanton:

    Hi Hanton,

    Could you share the view of usb_thread from the configurator? What properties do you have configured for "USBX on ux" module? Does your project have USBX Source or ThreadX Source?

    Regards
  • In reply to Renesas Karol:

    Hi Karol

    I attached the thread and USBX on ux configuration.

    In my project I have not included USBX Source, I do not know if it is necessary.

    But in the TCP communications thread, NetX Source and ThreadX Source are added.

    Now I change the USBX Pool Memory Size to 63488, and I put a callback function: User Callback for Host Event Notification(Only valid for USB Host) usb_host_plug_event_notification. The result after these changes is the same error.

    Thanks for your help.

    Hanton

  • In reply to Hanton:

    Hi Karol

    Now I have added the USBX Source without modifying its configuration by default and the problem is solved, it does not give the error. But i do not know why.

    Thanks
    Hanton
  • In reply to Renesas Karol:

    Hi Karol

    Now I have added the USBX Source without modifying its configuration by default and the problem is solved, it does not give the error. But i do not know why.

    And now I have another problem, I do not get the error, but when I enter the pendrive it does not call the callback function usb_host_plug_event_notification.

    The configuration of the USBX Source is:

    I don´t know if I have to configure something to activate the callback function, because in the example project that does work, not even the USBX Source is added.

    Regards

    Hanton

  • In reply to Hanton:

    Hello Hanton,

    You mentioned your project has ThreadX Source - have you changed any properties in that module?

    Regards
  • In reply to Renesas Karol:

    Hi Karol

    No, I have not changed anything about the ThreadX Source configuration, it was added because it was necessary when adding NetX Source, which is necessary to change Maximum Listen Requests to 16.

    In any case I enclose the ThreadX Source configuration, the missing fields are empty, and the last field Show linkage warning is Disabled.

    Regards

    Hanton

  • In reply to Renesas Karol:

    Hi Karol

    Do you have any suggestions on how I can solve this problem?

    Regards
    Hanton
  • In reply to Hanton:

    Was there any resolution to this problem?

    I have the same issue (UX_THREAD_ERROR, then on including USB Source no triggering of the insert/remove callback) on SSP 1.4.0.

    My project is a HID Host stack to implement keyboard, the USBX mass storage stack works in a variant project on the same hardware (S7) too.
  • In reply to Josh:

    Following up in case anyone was following this question.

    On adding USBX source (might have been Host Class HID Source actually) I was able to step through and find that UX_NO_CLASS_MATCH was returned in the stack during enumeration, and the device was reporting 0x09 instead of an expected 0x03 to indicate a HID device (keyboard). The device class 0x09 wasn't referenced in the stack, so I verified here: www.usb.org/defined-class-codes. The keyboards I was connecting to my custom S7 board were technically USB hubs as they had external USB ports that other devices could be connected to.

    So if you have this issue I would suggest the device you are connecting is not reporting to be the class you are expecting and supporting from your USBX stack (be it HID or mass storage etc).