Problem with new version STM32CubeIDE ver1.5.1 and STM32CubeMX ver6.1.1 (fatal error: usb_device.h: No such file or directory)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-16 05:00 AM
Before that there was STM32CubeIDE ver1.4.0 STM32CubeMX ver6.0.0 everything was fine.
Installed STM32CubeIDE ver1.5.1 and STM32CubeMX ver6.1.1, there was an error when connecting USB_DEVICE.
Tried creating a project from scratch with nothing but USB_DEVICE. Gives an error message.
What to do?
Solved! Go to Solution.
- Labels:
-
STM32CubeIDE
-
STM32CubeMX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-16 11:39 AM
I took your IOC, hit generate code, loaded the project and hit build. It built fine. Win10, CubeIDE 1.5.1, CubeMX 6.1.1, latest HAL package.
I know it's frustrating. Sorry, good luck.
...
Finished building target: new_new_f407vet6.elf
arm-none-eabi-size new_new_f407vet6.elf
arm-none-eabi-objdump -h -S new_new_f407vet6.elf > "new_new_f407vet6.list"
arm-none-eabi-objcopy -O binary new_new_f407vet6.elf "new_new_f407vet6.bin"
text data bss dec hex filename
25584 492 7948 34024 84e8 new_new_f407vet6.elf
Finished building: default.size.stdout
Finished building: new_new_f407vet6.bin
Finished building: new_new_f407vet6.list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-16 05:45 AM
Check your include directories
Project properties -> C/C++ Build -> Setting -> Tool Settings -> MCU GCC Compiler -> Include Paths
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-16 08:18 AM
Added everything. It didn't get any easier. Error again!
I specifically looked at the settings on the old version. The settings on both the old and the new version are the same. But the new one doesn't work!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-16 08:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-16 09:51 AM
1) I'm launching a new version of STM32CubeIDE ver1.5.1 (STM32CubeMX ver6.1.1).
I indicate the directory with the old project on STM32CubeIDE ver1.4.0 STM32CubeMX ver6.0.0.
At startup it says: “The workspace was written with an older version. Continue and update workspace which may make it incompatible with older version? ".
I click Continue.
An older version message appears.
I click Continue.
The project opens and works as expected.
Settings in the photo.
2) I click to create a new project.
I indicate the same chip.
USB only settings in virtual com port mode.
I generate a project.
Checking - again the same error!
Attach the IOC file.
Half a day was wasted. The new version does not work as expected out of the box. Very upset. I roll back to STM32CubeIDE ver1.4.0 STM32CubeMX ver6.0.0. Extremely disappointed.
Thank you for helping me. But this is beyond my strength.
My system: Windows 10 Pro, Lenovo ThinkPad T590 laptop. All updates have been installed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-16 11:39 AM
I took your IOC, hit generate code, loaded the project and hit build. It built fine. Win10, CubeIDE 1.5.1, CubeMX 6.1.1, latest HAL package.
I know it's frustrating. Sorry, good luck.
...
Finished building target: new_new_f407vet6.elf
arm-none-eabi-size new_new_f407vet6.elf
arm-none-eabi-objdump -h -S new_new_f407vet6.elf > "new_new_f407vet6.list"
arm-none-eabi-objcopy -O binary new_new_f407vet6.elf "new_new_f407vet6.bin"
text data bss dec hex filename
25584 492 7948 34024 84e8 new_new_f407vet6.elf
Finished building: default.size.stdout
Finished building: new_new_f407vet6.bin
Finished building: new_new_f407vet6.list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-16 11:50 AM
Thanks for the answer. Now I will know that the problem is on my side.
Good luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-22 03:12 AM
Did you manage to solve your problem?
I had something similar and I suspect the code generation to not go all the way to the end: in your project's screenshot there's an "mx.scratch" file leftover, which should disappear once the code is generated.
Then, CubeMX might not generate/include all the driver files such as your usb_device.h one.
I managed to get rid of it by re-doing all the project creation from the *.ioc file. It worked for some time but it happens again, and it's quite laborious to re-do everything...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-22 04:14 AM
Hello.
No. The problem could not be resolved. I am working on version 1.4.
I even rolled back Windows to the old version, when I didn't have the CubeIDE program. Actually installed CubeIDE v1.5 from scratch.
And when creating a project, the same error came out!
Java is the latest version.
I tried to install Java of a different version, and noticed that a new error related to the usb library popped up. I didn't understand. The strength was gone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-08 01:50 PM
I had exactly the same problem with CubeIDE 1.9.0 and was stuck. Then I thought it'd be great to see some codegen logs, as it seems like codegen fails, since mx.scratch file stays in the project after codegen completes. That basically means there was something wrong with codegen.
So I though of that CubeIDE seems eclipse based, so I googled where eclipse's logs are, and they turn out to be in the workspace folder, under ".metadata' folder
In the logs I saw a weird error
!ENTRY com.st.stm32cube.common.mx 4 0 2022-06-08 16:42:07.293
!MESSAGE Error on line 9 of document file:/C:/STM32CubeIDE/workspace_1.9.0/another-try/mx.scratch: Invalid byte 2 of 2-byte UTF-8 sequence.
!STACK 0
org.jdom.input.JDOMParseException: Error on line 9 of document file:/C:/STM32CubeIDE/workspace_1.9.0/another-try/mx.scratch: Invalid byte 2 of 2-byte UTF-8 sequence.
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:530)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:905)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:884)
So I looked into mx.scratch file, line 9
And that line is specifying Firmware installation repository path. And that path has my name spelled in cyrillic.
So I went on to change the repository path, which you can do using "Window -> Preferences -> STM32Cube -> Firmware Updater -> Firmware installation repository"
You might as well want it fixed for CubeMX, "Help -> Updater Settings -> Repository Folder"
I changed it to "C:\ST\Repository"
Changing it as you might have guessed would not move the files, but it will redownload everything next time you try to build or codegen.
If this doesn't help, maybe you could further look into the logs file for clues..
Good luck with that :grinning_face: