vefwise.blogg.se

Nucleo f042k6
Nucleo f042k6





nucleo f042k6
  1. Nucleo f042k6 how to#
  2. Nucleo f042k6 serial#
  3. Nucleo f042k6 software#

The STM32F042K6 comes with 6 kB of RAM, which isn’t a whole lot. In the Project Manager tab, change the Minimum Heap Size to 0x100. This should automatically change all of the necessary clocks to 48 MHz. Luckily, you can just click Yes on the pop-up when asked to run the automatic clock issues solver. We need to bump those up to 48 MHz for USB to work. By default, the Nucleo-F042K6 board is configured for 8 MHz clocks for almost everything.

nucleo f042k6

Nucleo f042k6 software#

The software will tell you that your clocks have issues.

Nucleo f042k6 serial#

This tells the USB stack that we want to enumerate as a CDC device, which will allow us to send serial data to and from our computer across the USB lines.Ĭlick on the Clock Configuration tab. 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.VUSB → Diode → Nucleo 5V (don’t want to short something if we’re plugging in 2 USB cables!).To begin, strip a USB cable or get a USB breakout board (like this one from SparkFun) and connect the lines to a breadboard as shown in the Fritzing diagram below. Note that if you are using a Nucleo board with an STM32F401 or STM32F411, you will need to solder an external crystal to the board, as it is unpopulated on those boards. I highly recommend looking over the USB Hardware and PCB Guidelines document from ST Microelectronics to learn about what’s needed for your particular STM32 part. Specifically, I’m using the Nucleo-F042K6, as it has a built-in USB device peripheral (full speed), and it does not require an external crystal.

Nucleo f042k6 how to#

As I continue my journey with STM32 development, I wanted to share my findings with how to get a Virtual COM Port (VCP) working with a Nucleo board.







Nucleo f042k6