Trying to get USB device working
I'm trying to get my STM32 custom board to show up as a USB device on my Windows 10 computer. I realize there are MANY moving parts. It's not working yet. I appreciate your help!
I'm using STM32F105R8T6 with pins 44/45 (PA11/PA12 aka OTG_FS_DM/OTG_FS_DP) connected to usb hub's DM/DP respectively.
Note that pin 43 (PA10 aka USART1_RX aka OTG_FS_ID) is wired on the pcb to be used for USART1, not USB OTG ID. I'm intending for a full time USB device, not with OTG hosting, so this pin wasn't connected for that purpose during pcb design.
I downloaded STM32Cube_FW_F1_V1.8.0 and found inside it .\Projects\STM3210C_EVAL\Applications\USB_Device\CDC_Standalone. I copied that folder and got the project to build using Atollic TrueSTUDIO for STM32, version 9.3.0. I then edited a local copy of stm3210c_eval.h in order to use my desired USART1 rather than USART2, use different LED positions for my custom board, and couldn't specifically find any USB configuration in that .h file. (Note suspicious thing: This example app was NOT using USART1 that possibly conflicts with OTG_FS_ID.)
I programmed my MCU by going into debug mode through my ST-LINK. I have found that after doing this once, subsequent power cycles still have the program. I've both assumed that as well as re-ran in debug mode.
I'm running USBView from FTDI, which shows so much USB detail. I can see my two-input USB hub. I can see a USB flash drive plugged into the hub's second port. But the USB hub's first port is described by USBView as "NoDeviceConnected".
QUESTIONS:
1) I've tried stepping down into the USB code, and I have decades of experience stepping into unknown microcontroller code, but I don't see any recognizable status. Is there something I can look for to see if this process was successful?
2) I'm wondering about that OTG_FS_ID pin that I'm using for other purposes. Is there a way to look with debug to see if the MCU is attempting to get into host or device mode? Is this pin required? (Note that I've alternatively jumpered this pin to GND or 3.3V, and I my hub still doesn't show anything connected in USBView. So I may have eliminated this as an issue.)
3) Be aware that this hub is on my custom PCB. The second port is proven to work, and I see all through points (host side, device side, device side) in USBView. Nevertheless, there could be an error on my PCB with regard to configuring this hub for the full time presence of the MCU. (Or is it not full time due to misc timing and debug reboots?) Because of this additional ambiguity, I'd really like to be able to see the STATUS of the USB DEVICE port in my STM32.
Thanks very much