I wrote some usb code and was wondering, is there a sense pin that would put the chip in DFU mode? Or, how else could I exit my usb mode and enter DFU programming?
It's called a button on BOOT0 pin
Or handle it yourself, you'd either want your own button that you check as you start, and redirect into the ROM, or have it recognize a USB packet generated by the host to switch into DFU mode.
ST provides DFU and IAP example firmwares as part of the Cube/HAL or SPL platforms.