STM32CubeMX - an advanced project generator for STM32

    A couple of weeks ago, STMicroelectronics rolled out an update to its MicroXplorer program, which allowed you to graphically configure port initialization in a specific STM32 for your needs, including port remap and visually see what is currently busy.
    This program looked as follows:
    image
    And it allowed to get * .c, * .h files in the output, which contained functions for initializing ports in accordance with the specified requirements using the Standard Peripheral Library.
    What did you decide to change this time?

    And this time, ST decided to add a full-fledged generation of projects to the following environments in this utility:
    • TrueSTUDIO 4.3.1
    • MDK-ARM 4.73
    • EWARM 6.7
    • Gcc

    We renamed SPL to HAL (High Access Level), added Middle Wares (FreeRTOS, Fatfs from Chan, USB classes, etc.), the tool for configuring the frequency of work as a graphical utility is now immediately in the program, and not as before in the excel file, and added An interesting tool that they called the Energy Consumption Calculator - allows you to approximately calculate the energy consumption of MK depending on the conditions and tasks and approximately find out how much it will work on a particular type of food.

    These were spoons of honey. And now, barrels of tar.
    The program has 2 types of delivery - standalone and as a plug-in for eclipse. So, both of these options work only under windows. And functionally do not differ from each other.
    I did not find the claimed support for GCC, apparently they have not implemented it at the moment, although there are GCC startup files in the library, why they did not - it's not clear.
    At the moment, only the F4 line is fully operational.
    UPD 04/06/14: There is support for F2.

    Consider the work of the program on a specific simple example:
    After installing the program, you need to install one available pack for STM32F4 in the Help -> Install New Libraries menu.

    Actually, the initial program window looks like:

    There are not many available actions, as you can see.

    We are making a new project:

    Here we select the chip we need or select the filter on the left according to the necessary parameters.
    Thanks to DEHiCKA for the additions.

    This is what the main screen for pin configuration looks like:

    Here I chose SDIO (for working with SD cards), a couple of ADC, SPI, USART pins and manually configured several ordinary pins. It is worth saying that for each option there are tons of customization options available, so that everything can be changed as you wish without any problems.

    Next is the tab for working with timing:

    If you configured external quartz settings in the configuration, then there will be an opportunity to enter their values.
    Thanks to DEHiCKA for the additions.

    Configuration window:

    Here, depending on what we have chosen, the available settings will be displayed. As you can see, in this case I chose that I will use USB as a CDC class (Com port), SD card, and FATFS to work with the file system on this card.
    I note that you can click and change a lot of available settings for each button, for example, some settings available for USB configuration:

    and ADC:


    The next tab to the project itself and the fact that it will be generated does not have a relationship, but may be useful to someone for calculations energy consumption of a particular device:

    Here we have to add sources of consumption to the table, how often they occur and other parameters affecting consumption, it looks like this:


    In conclusion, we will generate our project. I have only Keil installed from the list of supported IDEs, so I selected it in the configuration:


    Of course, open it and collect it:

    As you can see, everything opened and assembled without any difficulties.

    Conclusion

    It is worth saying that specifically I am not a fan of the systems for generating something. And there are several reasons for this.
    Firstly, the project generator does not free you from reading datasheets. On the contrary, if something does not work as you expect, you will long and hard search for the problem, not understanding the nature of its occurrence. The generator itself may contain errors, and they will all successfully transfer to your projects.
    Secondly, such things abstract the designer from a specific device, and it is unlikely that a person will figure out how to work with USB and why this is happening in this way, and not otherwise only because he used the project generator and successfully pulled up all the libraries.
    As regards this product, it is worth saying that it is still very crude, there is no support for non-proprietary IDEs, STM32F0, F2, F3, not windows platforms. But it’s worth looking at for general development, for example FATFS can be successfully used in your projects. In the final analysis, it is up to you to decide what and how to use.

    Related Materials

    1. STM32CubeMX project page
    2. Weighty 127-page manual for the program
    3. Firmware with HAL and Middle Wares , for those who just need libraries without a generator
    4. Generated project

    Also popular now: