admin管理员组

文章数量:1386632

I am trying to create a project using the STM32F429ZIT6 board, but whenever I activate and try to use the usbd libraries, I get hundreds of error: unknown type name 'USBD_ClassTypeDef and similar errors. For some reason, the header file usbd_def.h is not being registered by the other usbd files, 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?

Screenshot of errors when building 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:

  • I created the project via File -> New -> STM Project
  • I selected the STM32F429ZIT6 Board and generated the ioc file I changed a few things in the ioc file:
  • I added 2 address bits at PD11 and PD12
  • I changed PG10 to FMC_NE3 and enabled NOR Flash/PSRAM/SRAM/ROM/LCD 1, to chip select -> NE3, 18 Address bits, and 16 data bits, and enabled write operation
  • I changed USB_OTG_HS, Internal FS Phy to Device Only, and enabled USB_DEVICE (Class for HS IP to Virtual Port Com)
  • After saving and generating code, I included usbd_cdc.h to my main.h header. Building it generates 308 errors

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.

The following are images of the ioc file that I slightly changed from the default configuration: Top part of pinout view Middle part of pinout view

Bottom part of pinout view USB Device settings

本文标签: