Change Class For FS IP to Communication Device Class (CDC). Under Categories > Middleware, select USB_DEVICE. You should see PA11 and PA12 be automatically configured for USB_DM and USB_DP. In the Pinout & Configuration tab, go to Categories > Connectivity and click USB. In the CubeMX configuration perspective, you’ll need to enable a few options to initialize the USB as a Virtual COM Port. Yes to “initialize all peripherals with their default Mode”.Click Finish, and you’ll be asked a few questions: We’ll be using C as our language for this example. On the next screen, give your project a useful name (such as “nucleo-f042k6-vcp-test”). ![]() I’ll pick the Nucleo-F042K6, since that’s the board I have. In STM32CubeIDE, start a new project (File > New > STM32 Project). I don’t have a bootloader working (yet) to where we can send binary files over VCP, but that’s on my to-do list.įor this, I’m using STM32CubeIDE along with the STM32F0 HAL API. We’ll be sending our compiled program over to the ST-LINK side of the board, and the VCP will enumerate on the USB lines that we just added. Plug the two USB cables from the Nucleo board into your computer. USB GND → USB Shield (don’t know if this is necessary, but it makes me feel better)Īlso, this is super important: remove the jumper that comes default on your Nucleo board! It bridges D2 and GND and will short out our D+ line if left in place. ![]()
0 Comments
Leave a Reply. |