Skip to content

the stm32h743iit6 has no response after init tinyusb, the jlink also lost connectionΒ #649

@ActivePeter

Description

@ActivePeter

Set up
[Mandatory] Provide details of your setup help us to reproduce the issue as quick as possible

  • PC OS : Windows 10
  • Board : stm32 h743
  • Firmware: examples/device/cdc_msc

Describe the bug
I'm trying to use the tinyusb on my own stm32h743 board, before using this lib, I already success to use the usb cdc provided by cubemx. When I'm using the tinyusb, it just has no reponse after running tusb_init(), the jlink also lost connection

void basicInit()
{
    tusb_init();
    while (1)
    {
        //        SDRAM::test();
        if (tud_cdc_connected())
        {
            tud_cdc_write_str("Hello World\r\n");
            tud_cdc_write_flush();
        }

        tud_task();
    }
    // osThreadDef(usbTask, usbTask, osPriorityNormal, 0, 6000);
    // osThreadCreate(osThread(usbTask), NULL);
}

before running the basicInit(), i called

int main(void)
{
  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration--------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* USER CODE BEGIN Init */

  /* USER CODE END Init */

  /* Configure the system clock */
  SystemClock_Config();

  /* USER CODE BEGIN SysInit */
#define GFXMMU_VIRTUAL_BUFFER0_BASE 0
  /* USER CODE END SysInit */

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_SPI1_Init();
  MX_SPI2_Init();
  MX_TIM2_Init();
  MX_TIM3_Init();
  MX_FMC_Init();
  MX_USB_OTG_FS_PCD_Init();
  /* USER CODE BEGIN 2 */
  basicInit();

also i've replaced the irq funcs

/**
  * @brief This function handles USB On The Go FS End Point 1 Out global interrupt.
  */
void OTG_FS_EP1_OUT_IRQHandler(void)
{
  /* USER CODE BEGIN OTG_FS_EP1_OUT_IRQn 0 */
  tud_int_handler(0);
  /* USER CODE END OTG_FS_EP1_OUT_IRQn 0 */
  // HAL_PCD_IRQHandler(&hpcd_USB_OTG_FS);
  /* USER CODE BEGIN OTG_FS_EP1_OUT_IRQn 1 */

  /* USER CODE END OTG_FS_EP1_OUT_IRQn 1 */
}

/**
  * @brief This function handles USB On The Go FS End Point 1 In global interrupt.
  */
void OTG_FS_EP1_IN_IRQHandler(void)
{
  /* USER CODE BEGIN OTG_FS_EP1_IN_IRQn 0 */
  tud_int_handler(0);
  /* USER CODE END OTG_FS_EP1_IN_IRQn 0 */
  // HAL_PCD_IRQHandler(&hpcd_USB_OTG_FS);
  /* USER CODE BEGIN OTG_FS_EP1_IN_IRQn 1 */

  /* USER CODE END OTG_FS_EP1_IN_IRQn 1 */
}

/**
  * @brief This function handles USB On The Go FS global interrupt.
  */
void OTG_FS_IRQHandler(void)
{
  /* USER CODE BEGIN OTG_FS_IRQn 0 */
  tud_int_handler(0);
  /* USER CODE END OTG_FS_IRQn 0 */
  // HAL_PCD_IRQHandler(&hpcd_USB_OTG_FS);
  /* USER CODE BEGIN OTG_FS_IRQn 1 */

  /* USER CODE END OTG_FS_IRQn 1 */
}

Is there any wrong operation in my code? hope for a simple guidance.

To reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. See error

Screenshots
If applicable, add screenshots, bus capture to help explain your problem.

Log
Please provide the stack's log (uart/rtt/swo) where the issue occurred, best with comments to explain the actual events. To enable logging, add LOG=2 to to the make command if building with stock examples or set CFG_TUSB_DEBUG=2 in your tusb_config.h. More information can be found at example's readme

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions