cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 USBX hub class flaky - Bug???

matt-crc
Associate III

There seems to be a bug when using the USBX hub class.  Sometimes it works, but most often it does not.  The problem appears to be with file: ux_host_stack_enum_thread_entry.c.  The code:

 

 

VOID  _ux_host_stack_enum_thread_entry(ULONG input)
{

    UX_PARAMETER_NOT_USED(input);

    /* Loop forever waiting for changes signaled through the semaphore. */     
    while (1)
    {   

        /* Wait for the semaphore to be put by the root hub or a regular hub.  */
        _ux_host_semaphore_get_norc(&_ux_system_host -> ux_system_host_enum_semaphore, UX_WAIT_FOREVER);

#if UX_MAX_DEVICES > 1
        /* We try the hub first. For this we look into the USBX project
           structure to see if there is at least one hub.  */
        if (_ux_system_host -> ux_system_host_enum_hub_function != UX_NULL)
        {

            /* Yes, there is a HUB function, call it!  */
            _ux_system_host -> ux_system_host_enum_hub_function();
        }
#endif

        /* The signal may be also coming from the root hub, call the root hub handler.  */
        _ux_host_stack_rh_change_process();
    }
}

 

 

on line 16: if(_ux_system_host -> ux_system_host_enum_hub_function != UX_NULL) 

it assumes that the ux_system_host_enum_hub_function was originally initiated, and/or it expects that the ram was cleared on startup (which CubeIDE does not seem to do).

To fix this problem, all memory has to be zeroed for this code to work.

Question: is there a way to clear all ram on startup using CubeIDE, or do I have to do it manually?

0 REPLIES 0