Usb 在CubeMX生成的项目中,PCD_EP_TX_地址定义在哪里?
我需要从Usb 在CubeMX生成的项目中,PCD_EP_TX_地址定义在哪里?,usb,stm32,stm32f3,Usb,Stm32,Stm32f3,我需要从stm32f3xx\u hal\u PCD.h使用宏PCD\u GET\u EP\u TX\u ADDRESS 其定义如下: #define PCD_GET_EP_TX_ADDRESS(USBx, bEpNum) ((uint16_t)*PCD_EP_TX_ADDRESS((USBx), (bEpNum))) 但使用它会导致编译错误,因为未定义PCD\u EP\u TX\u地址 我对整个项目和字符串PCD\u EP\u TX\u ADDRESS进行了灰色搜索,结果如下: fadedbe
stm32f3xx\u hal\u PCD.h
使用宏PCD\u GET\u EP\u TX\u ADDRESS
其定义如下:
#define PCD_GET_EP_TX_ADDRESS(USBx, bEpNum) ((uint16_t)*PCD_EP_TX_ADDRESS((USBx), (bEpNum)))
但使用它会导致编译错误,因为未定义PCD\u EP\u TX\u地址
我对整个项目和字符串PCD\u EP\u TX\u ADDRESS
进行了灰色搜索,结果如下:
fadedbee@host:~/cubeide/f3-hid$ grep -R "PCD_EP_TX_ADDRESS" *
Binary file Debug/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.o matches
Binary file Debug/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.o matches
Binary file Debug/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.o matches
Binary file Debug/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.o matches
Binary file Debug/USB_DEVICE/App/usb_device.o matches
Binary file Debug/USB_DEVICE/App/usbd_desc.o matches
Binary file Debug/USB_DEVICE/Target/usbd_conf.o matches
Binary file Debug/Core/Src/stm32f3xx_it.o matches
Binary file Debug/Core/Src/system_stm32f3xx.o matches
Binary file Debug/Core/Src/main.o matches
Binary file Debug/Core/Src/stm32f3xx_hal_msp.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi_ex.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pcd_ex.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart_ex.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pcd.o matches
Binary file Debug/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_exti.o matches
Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pcd.h:#define PCD_GET_EP_TX_ADDRESS(USBx, bEpNum) ((uint16_t)*PCD_EP_TX_ADDRESS((USBx), (bEpNum)))
字符串出现在许多对象文件中,表明它是在某个位置定义的
在哪里定义了PCD\U EP\U TX\U地址?它似乎是在内部声明的
它可能没有被CubeMX包括在内,因为CubeMX有时是垃圾。不过,导出中有一些选项,允许您包含比cubemx使用的库更多的要导出的库部分
请不要忘记在stm32xx_HAL_conf.h
中设置正确的HAL include定义,我检查了两个.o
文件中的字符串,只找到了相同的宏定义。
#define PCD_EP_TX_ADDRESS(USBx, bEpNum) ((uint16_t *)((uint32_t)((((USBx)->BTABLE+(bEpNum)*8)*2+ ((uint32_t)(USBx) + 0x400U)))))