cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H723 problem with USB middleware initialization when FREERTOS is used

Andrey_Yunin
Associate

Hi!

I have a problem.

I faced with a problem of USB middleware initialization as a virtual port in CubeMX. After code generation USB init initializes in main.c within of one of task FREERTOS. If I initialize USB only as connectivity USB init replaces right. How to resolve it?

Here details is:

/* USER CODE END Header_start_task_can_handler */

void start_task_can_handler(void *argument)

{

/* init code for USB_DEVICE */

MX_USB_DEVICE_Init();

/* USER CODE BEGIN 5 */

app_start_task_can_handler(argument);



/* Infinite loop */

for(;;)

{

osDelay(1);

}

/* USER CODE END 5 */

}
2 REPLIES 2
TDK
Super User

> If I initialize USB only as connectivity USB init replaces right.

What does this mean?

If you feel a post has answered your question, please click "Accept as Solution".

Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code.

Connectivity - > USB_OTG_HS -> Internal FS Phy -> Device only

Middleware and software ->USB_Device -> Disable

In this case I get USB init in correct place within main.c:

/* USER CODE END SysInit */


/* Initialize all configured peripherals */

MX_GPIO_Init();

MX_FDCAN1_Init();

MX_USB_OTG_HS_PCD_Init();