Skip to main content
Associate II
April 8, 2024
Solved

Troubleshooting STM32F407 USB Device Mode: IAR vs. Cube IDE Code Generation Differences

  • April 8, 2024
  • 6 replies
  • 3846 views

Hello,

I was trying USB Device mode with STM32F407. I tried with IAR, and it did not work but was working with Cube IDE. Found out the generated code for copying device id in usbd_desc.c for Get_SerialNum function was missing in IAR.

CubeMX version 6.11.0CubeMX_USB.png

 

This topic has been closed for replies.
Best answer by STTwo-32

Hello @Ashvajit-CC 

This issue has been solved on the last release of the CubeMX (V6.11.1). Could you please update to this version. 

Best Regards.

STTwo-32

6 replies

ST Technical Moderator
April 8, 2024

Hello @Ashvajit-CC ,

First let me thank you for posting and welcome to the ST Community.

Your request is under investigation, and I will get back to you ASAP.

Thanks.

Mahmoud.

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Associate II
April 8, 2024

Here's my IOC file for more information.

Thanks

 

ST Technical Moderator
April 8, 2024

Hello @Ashvajit-CC ,

Further to your comment , I generated the project with STM32CubeMX 6.10.0.

Toolchain: STM32CubeIDE 1.14.1

MahmoudBenRomdhane_0-1712573034498.png

Toolchain: Ewarm

MahmoudBenRomdhane_1-1712573086512.png

Thanks.

Mahmoud.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Associate II
April 8, 2024

I regenerated the code, and I can still observe that these lines are not being generated.

I'd like to mention firmware package STM32Cube FW_F4 V1.28.0 and IAR version 9.50.1.

Screenshot 2024-04-08 162914.png

ST Technical Moderator
April 9, 2024

Hello @Ashvajit-CC ,

 

As discussed, the project that you had attached on the comment was generated with STM32CubeMX 6.10.0.

I am using IAR 9.50.2 and the issue is not reproduced.

By using STM32CubeMX 6.11.0, I can confirm that those lines are missing.

deviceserial0 = *(uint32_t *) DEVICE_ID1;

deviceserial1 = *(uint32_t *) DEVICE_ID2;

deviceserial2 = *(uint32_t *) DEVICE_ID3;

It is a regression from STM32CubeMX 6.10.0. 

You can take a look at this Post and notice that the same issue has been already reported internally to Dev team for correction (under internal ticket number 177153) and this will be fixed ASAP.

 

Thanks.

Mahmoud

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
STTwo-32
STTwo-32Best answer
ST Technical Moderator
May 3, 2024

Hello @Ashvajit-CC 

This issue has been solved on the last release of the CubeMX (V6.11.1). Could you please update to this version. 

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.