2025-02-10 3:50 AM
Hello,
I am trying to create a project using the STM32F429ZIT6 board, but whenever I activate and try to use the usbd libraries, I get countless "error: unknown type name 'USBD_ClassTypeDef'" and similar errors. For some reason, the library usbd_def.h is not "seen" by the other usbd libraries, and all the definitions aren't being imported despite all the header files including usbd_def.h, whether directly or indirectly. I have tried changing the header files to only directly include usbd_def.h, but there's always one file that doesn't seem to want to work; for me, it is usbd_cdc.h. Am I missing something obvious when setting up the project?
I am using STM32CubeIDE 1.17 and the firmware is "STM32Cube_FW_F4_V1.28.1", which should be the latest firmware. The steps I took to create these errors are:
After fiddling with the code for some time, I can reduce the errors to around 43 or so when I remove some circular dependencies between the usbd libraries. Still, there shouldn't be any errors with the generated code in the first place, which makes me wonder what I'm doing wrong. I saw that there was one forum post in the past that was similar, but the problem they had was outdated firmware. Attached is the console output for the errors.
2025-02-12 12:12 AM
Hello @jchang98
I would like to thank you for posting.
Currently, I am investigating the issue mentioned above.
It would be great if you could share your IOC so that I can check your configuration.
THX
Ghofrane
2025-02-12 1:41 AM
Hello @jchang98
When I followed the steps mentioned above :
Using PD11 and PD12 as address bits will cause a conflict with the FMC_NE3 (Flexible Memory Controller Chip Select 3) signal. This conflict will result in the FMC becoming partially disabled, limiting the maximum number of address bits you can use to 16 bits instead of the intended 18 bits
To avoid this issue, I recommend selecting different GPIO pins for the address bits, such as PC13 and PC14. This will ensure that the FMC functionality remains fully operational.
Additionally, the usbd_cdc.h
file have been successfully included in my project, and the project was built with 0 errors and 0 warnings. Here is the IOC configuration for your reference.
2025-02-12 9:30 AM
Hi Ghofrane,
Here is my .ioc file. For PD11 and PD12, I had them assigned as FMC_A16 and FMC_A17, respectively. I thought these were address bits but I could be wrong.
I downloaded and imported the ioc file that you have given, but I still get the same problem when I include "usbd_cdc.h" in main.h. Maybe it's a problem with my setup?
2025-03-11 3:36 AM - last edited on 2025-03-11 3:44 AM by Andrew Neil
Merged into the original thread - please don't start multiple threads on the same topic.
Hello,
I had a previous post about this issue but it was not resolved. The proposed ioc file solution did not work when I ran it on my system.
I am trying to create a project using the STM32F429ZIT6 board, but whenever I activate and try to use the usbd libraries, I get countless "error: unknown type name 'USBD_ClassTypeDef'" and similar errors. For some reason, the library usbd_def.h is not "seen" by the other usbd libraries, and all the definitions aren't being imported despite all the header files including usbd_def.h, whether directly or indirectly. I have tried changing the header files to only directly include usbd_def.h, but there's always one file that doesn't seem to want to work; for me, it is usbd_cdc.h. Am I missing something obvious when setting up the project?
I am using STM32CubeIDE 1.17 and the firmware is "STM32Cube_FW_F4_V1.28.1", which should be the latest firmware. The steps I took to create these errors are:
After fiddling with the code for some time, I can reduce the errors to around 43 or so when I remove some circular dependencies between the usbd libraries. Still, there shouldn't be any errors with the generated code in the first place, which makes me wonder what I'm doing wrong. I saw that there was one forum post in the past that was similar, but the problem they had was outdated firmware. Attached is the console output for the errors as well as my ioc file.
2025-03-11 3:50 AM
@jchang98 wrote:4. After saving and generating code, I included usbd_cdc.h to my main.h header. Building it generates 308 errors
Where, exactly, did you include it?
Maybe the order matters?
Perhaps get a preprocessor listing to see what the compiler's seeing?
@Ghofrane GSOURI wrote:Additionally, the usbd_cdc.h file have been successfully included in my project, and the project was built with 0 errors and 0 warnings.
@Ghofrane GSOURI perhaps you could also share where, exactly, did you include it?
2025-03-12 6:46 AM
I included it where there are comments saying where user private includes should be written. Is this wrong?
As far as I know, the other included file does not depend on usbd_cdc.h, and vice versa.