![]() Issues with development toolchains can be painful to sort out when things don't just work. For bare microcontrollers, the config files for development boards of the same family often work fine. When prompted, choose the relevant OpenOCD board config file to use for flashing rules. Remember to save your CubeMX project, then generate the code with the "Generate Code" button on the right side of the top toolbar.ĬLion will detect the new files and update the project to match. I also recommend clicking the "Code Generator" settings tab, and selecting the Generate peripheral initalization as a pair of '.c/.h' files per peripheral box, as it makes the generated project structure easier to manage in the long-run. Set the Project Name, Project Location to match the existing file created by CLion, and set the Toolchain / IDE dropdown to SW4STM32. In the "Project Manager" tab, we need to re-configure the Project Settings as the microcontroller change effectively created a new file. The hardware serial peripheral is now configured. In the "NVIC Settings" tab, enable the USART2 global interrupt. Set the mode to Asynchronous, and check that the baud rate is set to 115200 Bits/s, with 8-bit word length, no parity, and 1 stop bit. With the "Pinout & Configuration" tab open, we'll expand the "Connectivity" pane, and then select USART2. This is useful to skip manually setting up GPIO for the user button and LEDs. If you are selecting a board rather than a bare microcontroller, CubeMX will prompt if the peripherals should be configured in their default mode. In this example, we'll be setting up ElectricUI to operate over USART2 which corresponds to pins PA2 and PA3. This article will use the trusty STM32F407 Discovery Board. The template doesn't start with our target microcontroller selected, clicking the name of the microcontroller in the top breadcrumb bar next to "Home" will take you to the device selection page.įind your microcontroller or development board. ioc file which you need to edit in CubeMX. We'll also cover project creation basics, but will configure the peripherals and change firmware needed to actually get things running.Ĭreate a new project with the STM32CubeMX template. This JetBrains article shows the process and covers dependancy resolution and configuration. We'll basically follow the normal project creation process with CLion's embedded support. We also have a Github repo with a DMA based UART example for the STM32F4 which is a bit more advanced than this guide.Ī STM32F407 Discovery development board is used, but most STM32 targets should also work fine. ![]() This guide uses CLion 2019.1 with integrated embedded support, and will cover the entire process of creating a new STM32F4 project, setting up the UART, and then integrating Electric UI.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |