STM32F103RB / STM32G071RB (uGOAL)

Introduction

The STM32G071RB incorporate the Arm®Cortex®-M0 32-bit RISC CPU with up to 48MHz. It provides up to 128kB of Flash and 36kB of SRAM. The STM32F103 is capable as an application controller for the iRJ45/SoM module.

STM32F103 and STM32G071 targets are only compatible with uGOAL.

 

The port for STM32F01RB and STM32G071RB base on ST’s HAL Layers. Thus porting to any other ST hardware is very easy. See here for additional information: https://portgmbh.atlassian.net/wiki/spaces/IRJ45SOM/pages/201490466 .

Software

Toolchain

For compiling the example code, the GNU Arm Embedded Toolchain is required. It can be obtained in several ways. Further information can be found here: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads.

Make sure, the toolchain is added properly to your path variable after the installation.

Building

Within a example folder (e.g. projects/ugoal/02_profinet/gcc) of the software delivery build the firmware with following commands:

1 2 3 4 # build for f103rb make PLATFORM=stm32f103rb clean all # build for g071rb make PLATFORM=stm32g071rb clean all

Flashing

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

1 make PLATFORM=stm32f103rb UART=/dev/tty.ACM0 flash serial

The Makefile target serial will use minterm.py from the pyserial package. Thus python and pyserial needs to be installed.

Getting Started

Preparations

Hardware Requirements

Arduino PMOD Adaptershield

Make sure following settings are set:

  • J13 - Connect “iRJ45” with “Sockel”

  • J8 - Connect “CS_SOURCE” with “PB2”, “PB0” for STM32F103rb Targets

  • J7 - Connect “RST_SOURCE” with “PD7”

  • Set all DIP-Switches to “OFF”

STM32G071 Board

There is no configuration required.

Target System

Please connect both boards with each other, before you connect them per USB to your computer.

There is no further configuration required.

Debugging

UART

The STM32G071 provides an UART over USB cable. Choose the following settings:

Speed

115200

Data Bits

8

Stop Bits

1

Parity

Odd

Flow Control

XON/XOFF

Application 02_profinet

The available applications are described here. Following you’ll find an example. After setting up the serial monitor and starting the debug session, the output should look like this:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 [INF] ../rpc/goal_mctc_rb.c:277 creating rpc ring buffer with buffer size 768 and elem size 256 [INF] ../rpc/goal_mctc_rb.c:277 creating rpc ring buffer with buffer size 768 and elem size 256 [INF] ../goal_media/goal_mi_mctc.c:793 rpc transfer size set to 1024 [INF] ../goal_media/goal_mi_mctc.c:723 peer requested Sync Init [INF] ../goal_media/goal_mi_mctc.c:723 peer requested Sync Init [INF] ../goal_media/goal_mi_mctc.c:723 peer requested Sync Init [INF] ../goal_media/goal_mi_mctc.c:723 peer requested Sync Init [INF] ../goal_media/goal_mi_mctc.c:455 RPC state synchronized, running appl_setup [INF] ../goal_media/goal_mi_mctc.c:458 configuring timeout values for peer [INF] ../pnio/goal_pnio_rpc_ac.c:259 PROFINET Application Core successfully started [INF] ../example/02_profinet/goal_appl.c:188 Initializing device structure [INF] ../example/02_profinet/goal_appl.c:230 PROFINET ready [INF] ../goal_media/goal_mi_mctc.c:487 local setup done [INF] ../ugoal/ugoal.c:212 HEAP utilization: 3400/4096 (83%).

Known Issues

Currently there are no limitations regarding the STM32G071.