cancel
Showing results for 
Search instead for 
Did you mean: 

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

Ashvajit-CC
Associate II

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

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.

View solution in original post

6 REPLIES 6
Mahmoud Ben Romdhane
ST Employee

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.

 

Ashvajit-CC
Associate II

Here's my IOC file for more information.

Thanks

 

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.

Ashvajit-CC
Associate II

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

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

 

STTwo-32
ST Employee

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.