Skip to main content
mn_it
Associate II
July 15, 2017
Solved

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

  • July 15, 2017
  • 4 replies
  • 1261 views
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??

    This topic has been closed for replies.
    Best answer by mn_it
    Posted on July 15, 2017 at 16:38

    I change Heap and stack and problem solved.

    0690X00000603wqQAA.jpg

    4 replies

    mn_it
    mn_itAuthorBest answer
    Associate II
    July 15, 2017
    Posted on July 15, 2017 at 16:38

    I change Heap and stack and problem solved.

    0690X00000603wqQAA.jpg
    Rob.Riggs
    Senior
    July 15, 2017
    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.

    Tesla DeLorean
    Guru
    July 15, 2017
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    ST Technical Moderator
    July 15, 2017
    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

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks