cancel
Showing results for 
Search instead for 
Did you mean: 

Code Stuck in tx_application_define() Function During USB Initialization

saikumar
Associate III

Hello,

I am working with [STM32 MCU model, e.g., STM32U5G9ZJT6Q], and I downloaded code from GitHub (link:

https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/STM32U5G9J-DK2/Applications/USBX/Ux_Device_CDC_ACM ).

While running the project, the code gets stuck in the tx_application_define() function, specifically in the while(1) loop after the USB initialization MX_USBX_Device_Init().

Here is the relevant portion of the function:

VOID tx_application_define (VOID *first_unused_memory)
{
        UINT status = TX_SUCCESS;
         VOID *memory_ptr;

  if (tx_byte_pool_create( &tx_app_byte_pool,  "Tx App memory pool",  tx_byte_pool_buffer,     TX_APP_MEM_POOL_SIZE) != TX_SUCCESS)
  {
      while(1);
  }

    memory_ptr = (VOID *)&tx_app_byte_pool;
    status = App_ThreadX_Init(memory_ptr);
    if (status != TX_SUCCESS)
   {
    while(1);
   }

    if (tx_byte_pool_create(&ux_device_app_byte_pool, "Ux App memory pool", ux_device_byte_pool_buffer, UX_DEVICE_APP_MEM_POOL_SIZE) != TX_SUCCESS)
    {
      while(1); 
    }

    memory_ptr = (VOID *)&ux_device_app_byte_pool;
    status = MX_USBX_Device_Init(memory_ptr);
   if (status != UX_SUCCESS)
   {
     while(1);  // Getting stuck here 
    }
}

0 REPLIES 0