cancel
Showing results for 
Search instead for 
Did you mean: 

Why USB CDC + FreeRTOS code created by CubeMX does not work?

mn
Associate III
Posted on July 15, 2017 at 16:09

Hello.

I am using STM32F746BG. I use FreeRTOS and USB CDC class code.

when I create an IAR Project using STM32CubeMX, USB com port correctly identify by windows but can not open.

0690X00000603wgQAA.jpg

but if i change code like cod below, it works correctly

int main(void)

{

  HAL_Init();

  SystemClock_Config();

  MX_GPIO_Init();

  /* USER CODE BEGIN 2 */

  MX_USB_DEVICE_Init();

  while(1);

  /* USER CODE END 2 */

  MX_FREERTOS_Init();

  /* Start scheduler */

  osKernelStart();

what is wrong??

1 ACCEPTED SOLUTION

Accepted Solutions
mn
Associate III
Posted on July 15, 2017 at 16:38

I change Heap and stack and problem solved.

0690X00000603wqQAA.jpg

View solution in original post

4 REPLIES 4
mn
Associate III
Posted on July 15, 2017 at 16:38

I change Heap and stack and problem solved.

0690X00000603wqQAA.jpg
Rob.Riggs
Senior III
Posted on July 15, 2017 at 17:30

DAHMEN.IMEN

‌ This seems to be a regular problem for developers. Can you ask that STM32CubeMX increase the minimum heap and stack sizes values when USB is used? This seems like something the tool can and should do for the developer.

Posted on July 15, 2017 at 21:48

Some general attentiveness to detail, and base line testing could significantly reduce the support burden . Where I'm from this is low-hanging fruit, and significantly improves the customer experience, and the amount of time wasted fixing the same set of issues over and over. If you solve the problems generating most of the noise you can start seeing where the real issues still remain.

Automated tools that generate bad code just amplify the problems.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Imen.D
ST Employee
Posted on July 15, 2017 at 23:53

Hi

Riggs.Rob

,

I will highlight your feedback to the appropriate developper team for working on this issue.

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen