STM32 (uGOAL)

Introduction

In this document general notes regarding support for STM32 controllers are given.

Thanks to uGOAL (minimalistic implementation of a small subsystem of GOAL framework functionality) nearly every STM32 controller can be used with SoM as an application controller. Porting to STM32 controller derivates can be done very quickly thanks to the usage of the ST HAL Layers.

Additional information about uGOAL can be found here: https://portgmbh.atlassian.net/wiki/spaces/IRJ45SOM/pages/138739774

Requirements and supported targets

Requirements for the used controller are minimal:

  • SPI Controller

  • at least 64kByte Flash

  • at least 8 kByte RAM

Thus nearly every STM32 Target is possible. Example ports for STM32F103RB and STM32G01RB are available. Following boards are supported right away:

  • NUCLEO-F103RB

https://www.st.com/en/evaluation-tools/nucleo-f103rb.html

  • NUCLEO-G071RB

https://www.st.com/en/evaluation-tools/nucleo-g071rb.html

  • NUCLEO-F429ZI

https://www.st.com/en/evaluation-tools/nucleo-f429zi.html

Examples

Examples are available, where additional information can be found here: https://portgmbh.atlassian.net/wiki/spaces/IRJ45SOM/pages/171704363

Building

The uGOAL software delivery already contains generated projects for several platforms for the STM32CubeIDE - please refer to “Integration into STM32CubeIDE”. Building a project is only necessary, if the project files for your desired platform are missing.

Examples are located in the project folder of the software delivery:

projects ├── 2015013_irj45 │   ├── 01_pnio_io_mirror │   ├── 02_eip_io_data │   ├── 04_pnio_validation │   ├── 05_pnio_01_simple_io │   ├── 06_eip_io_data_static_ip │   ├── 07_pnio_dsn │   ├── 08_pnio_01_simple_io_http │   ├── 09_ecat_slave │   ├── 10_pnio_process_alarm │   ├── 11_firmware_update │   ├── 12_ecat_validation │   ├── 13_firmware_update_callback │   ├── 14_ip_management │   └── 15_tcp_proxy ├── goal_http │   ├── 01_get │   ├── 02_post │   ├── 03_list_res │   ├── 04_auth │   ├── 05_template_cm │   ├── 06_template_list │   └── 07_template_table ├── goal_net │   ├── 01_udp_receive │   ├── 02_tcp_client │   └── 03_tcp_server └── ugoal ├── 01_ethercat ├── 02_profinet ├── 03_eip ├── 04_profinet_dyn_modules ├── 05_ccm ├── 06_ethercat_minimal ├── 07_http_ip_management ├── 08_pnio_io_mirror └── 09_pnio_io_mirror_new_api

 

To build an example enter its folder and execute the following build command:

cd projects/ugoal/02_profinet/gcc make

 

This command will list all supported platforms

*** Please specify platform from the list *** > make PLATFORM=atmega2560 > make PLATFORM=linux > make PLATFORM=osx > make PLATFORM=rl78g14 > make PLATFORM=stm32 > make PLATFORM=stm32f103rb > make PLATFORM=stm32f429zi > make PLATFORM=stm32g071rb

 

Building for a specific platform is done with the following command:

Flashing

Flashing the firmware is done with the following command. Please use the UART device for your system.

 

To get serial logging an additional Makefile target “serial” is available. It will use the pyserial-miniterm tool from the pyserial package. Flashing and opening a serial console can be combined in one call:

Integration into STM32CubeIDE

The uGOAL delivery already contains project files for STM32CubeIDE for several platforms. Just skip the creation of the Project and go straigth to importing project into STMCubeIDE.

Create Project with command line

If you want to build your own project, just use the project generator which is delivered with the uGOAL software. It requires a python3 installation.

Within the project folder trigger project creation using the following command:

The multiple choice menu allows selection of a template. For STM32G071RB and STM32F429ZI templates are available, which can be selected by choosing menu 3 (stmcubeide):

After selection of the proper template (which needs to match the platform), an STM32CubeIDE project is located in the “ide” subfolder of the project.

Import Projects into STMCubeIDE

The projects can be imported into STM32CubeIDE via “File”->”Import…”:

Select the project folder for project import, check your desired platform and click “Finish”:

 

The imported project can be compiled and debugged: