User Manual

Introduction

STM32 Open IoT and IIoT Gateways (P10 - P12)

Open IoT Gateway is also called as a PAC (Programmable Automation Controller). PAC products combine the functionality and openness of PC, the reliability of a programmable logic unit like PLC and the intelligence of I/O modules with flexible software tools for a wide range of applications from data acquisition, process control, motion control to energy and building management.

Our PAC family includes FreeRTOS PACs for different requirements in OS, CPU and development platforms.

The P10 - P12 gateways are based on STM32 ARM Cortex-M4.

image.png

If you want to get started, make sure you have complete set of:

Hardware

STM32 Open IoT and IIoT Gateways (P10 - P12)

Features

Features

image.png

Open IoT gateway

ESD protection for the RS485 data line

Power supply: +12 to +30 VDC

Transmission speed up to 115200 bps

Tx, Rx and power LED indicators

RS485 embedded termination 120 ohm

Operating temperatures: -40°C to +75°C

DIN-rail mounting

Dimensions: 98x56.4x22.5 mm

3 years warranty

Customization of OEM is welcomed

Frame ground FG

Electronic circuits are constantly prone to electrostatic discharge ESD. Redisage Electronics modules feature a design for the frame ground terminal block FG. The frame ground provides a path for bypassing ESD, which provides enhanced static protection ESD abilities and ensures the module is more reliable. Connecting FG terminal block to the earth ground will bypass the ESD disturbances outside the device so will provide a better level of protection against ESD.

Frame Ground FG connection reference drawing is provided below.

If earth ground is not available FG can be left floating or it can be connected with the power supply GND.

Specifications‎‎‎

Redisage PN

P10

P11

P12

Ports

RS232

4x

-

2x

RS485

-

4x

2x

RS232/RS485

-

-

-

Microcontroller

STM32

WiFi

N/A

Bluetooth

N/A

SMA socket connector for WiFi/BT antenna

:x:

Tactile switch

:white_check_mark:

Power

Voltage

12-30 VDC

Power

< 1 W

Frame ground protection

yes

Baud rate

up to 115200 bps

LED indicators

power, link activity, programmable RGB

RS485 termination

120 ohm manually enabled

Connector

RS232/RS485

8-pin terminal block max. 2.5 mm2 wire

Power

3-pin terminal block max. 2.5 mm2 wire

Ethernet

RJ45

Transmission
distance


RS485

max. 1,200 m at 9.6 kbps; max. 400 m at 115.2 kbps
(Belden 9841 2P twisted-pair cable, if different cables are used,
the transmission distance may change)

RS232

max. 15 m at 115.2 kbps

Mounting and enclosure

DIN rail, plastic PA - UL 94 V0, black/green

Temperatures

-40°C to +75°C operating and storage

Humidity

10 - 90% RH, non-condensing

ESD protection

±4 kV contact discharge / ±8 kV air discharge

Certification 

CE, RoHS

LED indicators

Gateways P10 - P12
image.png
LED indicator Color Function
PW Blue Power
L1 Green LED 1
L2 Green LED 2
L3 Yellow LED 3
L4 Red LED 4
L5 Red LED 5

Pin assignments

P10

P10 Name Plate Label v1 #1090.png

P11

P11 Name Plate Label v1 #1091.png

P12

P12 Name Plate Label v1 #1089.png

Board overview

The complete Open IoT and IIoT Gateway kit consists of:

Main Board

image.png

Power Supply Board

image.png

Power input & RS232/RS485 ports

image.png              image.png

RS232/RS485 ports depend on the device variant.

Ethernet

To support the Ethernet network interface communication, the network adapter available in the kit must be installed on the module (pay attention to its correct installation). This interface is supported by the external IP101G physical layer which communicates with the STM32 microcontroller.

image.png

image.png

Programming

STM32 Open IoT and IIoT Gateways (P10 - P12)

Install IDE & Programmer

Download and install STM32CubeIDE for ability to creating own programs. For device programming, you must install STM32CubeProgrammer. Follow the instructions located on the producer's site. Software is available on Windows, Linux and macOS. Of course, there is a possibility of using other IDEs, but Cube is dedicated to STM32 MCUs and provides a lot of compatible libraries.

Connect the programmer

STM32 IoT and IIoT Gateways can be programmed only with the MCU producer's external hardware programmer - ST LINK - connected via the Tag-Connect connector to the board. After connecting it to the board and a PC, the device should be available in Device Manager as STM32 STLink in Universal Serial Bus devices.

image.png

Connect the power supply

The gateway works with 12-30V DC power supplies. Make sure your supply is properly set.

image.png


Create your own programs

After all of the above steps are done, the device should be ready to be programmed.

Build, flash and monitor the device

There are two options for building your program.

STM32CubeIDE

image.png

Right click on your project and choose Debug As -> STM32 C/C++ Application. It should generate the .elf file in the Debug folder in the project.

CMake

The project can also be built in STM32CubeIDE via CMake. For more information and instructions check the producer's instructions.

Flash

There are two ways to flash the device.

STM32CubeProgrammer

It is the most recommended to use Programmer.

Open the software and connect it to the ST-Link programmer.

image.png

After successful connect you should see the device memory with addresses on the screen.

Click on the down-arrow on the left side of the screen and browse for your file path.

image.png

Find the .elf file (it should always be generated in the Debug folder in your project's path).

image.png

Click "Open".

image.png

Click "Start Programming". 

If programming have been done successfully, you should see on the screen some messages in pop-up windows and Log console.

image.png

image.png

The Gateway has been programmed.

Flashing in IDE

It is possible to flash your program directly from STM32CubeIDE. However, this method works only with some simple, small projects without using CMake. Just click on the image.png icon in the IDE, and after a few seconds, the device should be programmed. If it doesn't work, use the previous method.

Monitoring

You can connect the device to your computer using a console and Serial connection. To do so, you need two USB cables and a USB -> UART Converter (for example, C37).
If the connection is correct, the device will be visible as a USB Serial Port (COMx/ttyUSB). You can use any console terminal with the Serial option. The baudrate depends on USB UART settings in the project.

Pin Map

STM32 Open IoT and IIoT Gateways (P10 - P12)

CGM Rev. 3.1

Element Connection
LED
Power LED +3V3

LED1

PG6
LED2 PH14
LED3 PA10
LED4 PH12
LED5 PI9
ST3232BTR_1 UART RS232 Transceiver (P10 & P11)
T1_IN USART1_TXD
T2_IN USART6_TXD
T1_OUT TXD1
T2_OUT TXD2
R1_IN RXD1
R2_IN RXD2
R1_OUT USART1_RXD
R2_OUT USART6_RXD
V+

C7 (100nF)

V- C8 (100nF)
C1+ C5 (100nF)
C1- C5 (100nF)
C2+ C6 (100nF)
C2- C6 (100nF)
ESDA25-4BP6 ESD protection
I/O_1 RXD2

I/O_2

TXD1
I/O_3 RXD1
I/O_4 TXD2
GND FGC
ST3232BTR_2 UART RS232 Transceiver (P10)
T1_IN USART3_TXD
T2_IN UART7_TXD
T1_OUT B_4
T2_OUT B_3
R1_IN A_4
R2_IN A_3
R1_OUT USART3_RXD
R2_OUT UART7_RXD
V+

C64 (100nF)

V- C65 (100nF)
C1+ C57 (100nF)
C1- C57 (100nF)
C2+ C50 (100nF)
C2- C50 (100nF)
ESDA25-4BP6 ESD protection
I/O_1 -

I/O_2

-
I/O_3 B_4
I/O_4 A_4
GND FGC
MAX481CSA_1 UART RS485 Transceiver (P12)
DI USART1_TXD
DE RS485_DRIVER_ENABLE1
RE/ RS485_RECEIVER_ENABLE1
RO USART1_RXD
A TXD1
B RXD1
MAX481CSA_2 UART RS485 Transceiver (P12)
DI USART6_TXD
DE RS485_DRIVER_ENABLE2
RE/ RS485_RECEIVER_ENABLE2
RO USART6_RXD
A TXD2
B RXD2
MAX481CSA_3 UART RS485 Transceiver (P11 & P12)
DI USART3_TXD
DE RS485_DRIVER_ENABLE3
RE/ RS485_RECEIVER_ENABLE3
RO USART3_RXD
A A_3
B B_3
MAX481CSA_4 UART RS485 Transceiver (P11 & P12)
DI UART7_TXD
DE RS485_DRIVER_ENABLE4
RE/ RS485_RECEIVER_ENABLE4
RO UART7_RXD
A A_4
B B_4
USBLC6-2P6 ESD protection
VCC VBUS_ADC, MICROUSB_B_U254-051T-4BH83-F1S (PIN1)
GND GND
IO1_A MICROUSB_B_U254-051T-4BH83-F1S (PIN2)
IO2_A MICROUSB_B_U254-051T-4BH83-F1S (PIN3)
IO1_B BOOTLOADER_TX
IO2_B BOOTLOADER_RX
Serial EEPROM M24C08-RMC6TG
E0

GND

E1

GND

E2

+3V3

VSS

GND

VCC

+3V3

WC/

GND

SCL

I2C1_SCL

SDA

I2C1_SDA

Serial Flash A25LQ64M
CS# SPI2_SS
SO SPI2_MISO
WP# SPI2_W
VSS GND
VCC +3V3
HOLD# SPI2_IO3
SCLK SPI2_SCK
SI SPI2_MOSI
IP101GRI ETHERNET PHY transceivers
MDC

ETH_MDC

MDIO

ETH_MDIO

MDI_TP

TXD+

MDI_TN

TXD-

MDI_RP

RXD+

MDI_RN

RXD-

X2 -
X1 ETH_MCO
RESET_N ETH_RESET_N
ISET ETH_ISET
LED0/PHY_AD0 ETH_LED0/PHY_AD0
LED3/PHY_AD3 ETH_LED3/PHY_AD3
TEST_ON -
REGOUT C23 (100 nF), C29 (10 uF)
VDDIO +3V3
AVDD33 +3V3
GND GND
TXEN ETH_TX_EN
TXER/FXSD -
TXCLK/50M_CLKI ETH_RMII_REF_CLK
TXD0 ETH_TXD0
TXD1 ETH_TXD1
TXD2 -
TXD3 -
RXDV/CRS_DV/FX_HEN ETH_RXDV/CRS_DV
RXCLK/50M_CLKO -
RXD0 ETH_RXD0
RXD1 ETH_RXD1
RXD2 -
RXD3 -
RXER/INTR_32 -
COL/RMII ETH_COL/RMII
CRS/LEDMOD -
STM32 F439NIH6
PA0 -
PA1 ETH_RMII_REF_CLK
PA2 ETH_MDIO
PA3 -
PA4 -
PA5 -
PA6 SWITCH
PA7 ETH_RXDV/CRS_DV
PA8

ETH_MCO

PA9 BUZZER_PWM
PA10 LED_A3
PA11 USB_DM BOOTLOADER_RX
PA12 USB_DP BOOTLOADER_TX
PA13 JTMS
PA14 JTCK
PA15 CONF2
PB0 ETH_LED0/PHY_AD0
PB1 ETH_LED3/PHY_AD3
PB2 BOOT1
PB3 SW0
PB4 USART1_RXD
PB5 USART1_TXD
PB6 USART1_TXD
PB7 USART1_RXD
PB8 I2C1_SCL
PB9 I2C1_SDA
PB10 USART3_TXD
PB11 USART3_RXD
PB12 USART3_RXD
PB13 USART3_TXD
PB14 -
PB15 -
PC0 SD_NWE
PC1 ETH_MDC
PC2 -
PC3 -
PC4

ETH_RXD0

PC5 ETH_RXD1
PC6 USART6_TXD
PC7 USART6_TXD
PC8 CONF4
PC9 CONF1
PC10 BOOTLOADER_TX
PC11 BOOTLOADER_RX
PC12 CONF3
PC13 RTC_AF1
PC14 OSC32_IN
PC15 OSC32_OUT
PD0 D2
PD1 D3
PD2 CONF6
PD3 -
PD4 NOR_NOE
PD5 NOR_NWE
PD6 NOR_NWAIT
PD7 NOR_NE1
PD8 D13
PD9 D14
PD10 D15
PD11 A16
PD12 A17
PD13 A18
PD14 D0
PD15 D1
PE0 SD_LDOM
PE1 SD_UDOM
PE2 -
PE3 A19
PE4 A20
PE5 A21
PE6 -
PE7 D4
PE8 D5
PE9 D6
PE10 D7
PE11 D8
PE12 D9
PE13 D10
PE14 D11
PE15 D12
PF0 A0
PF1 A1
PF2 A2
PF3 A3
PF4 A4
PF5 A5
PF6 UART7_RXD
PF7 UART7_TXD
PF8 VBUS_ADC
PF9 L2
PF10 L1
PF11 SD_NDRAS
PF12 A6
PF13 A7
PF14 A8
PF15 A9
PG0 A10
PG1 A11
PG2 A12
PG3 A13
PG4 A14
PG5 A15
PG6 LED_A1
PG7 DIP_SWITCH
PG8 SD_CLK
PG9 USART6_RXD
PG10 USART6_RXD
PG11 ETH_TXEN
PG12 -
PG13 ETH_TXD0
PG14 ETH_TXD1
PG15 SD_NCAS
PH0 OSC+IN
PH1 OSC_OUT
PH2 SD_CKE0
PH3 SD_NE0
PH4 I2C2_SCL
PH5 I2C2_SDA
PH6 -
PH7 -
PH8 RS485_DRIVER_ENABLE1
PH9 RS485_RECEIVER_ENABLE1
PH10 RS485_DRIVER_ENABLE2
PH11

RS485_RECEIVER_ENABLE2

PH12 LED_A4
PH13 -
PH14 LED_A2
PH15 CONF5
PI0 WP#//ACC
PI1 SPI2_SCK
PI2 SPI2_MISO
PI3 SPI2_MOSI
PI4 SPI2_W
PI5 SPI2_IO3
PI6 ETH_RST
PI7 RS485_DRIVER_ENABLE3
PI8 RS485_RECEIVER_ENABLE3
PI9 LED_5
PI10 RS485_TERMINATION_ENABLE4
PI11 RS485_TERMINATION_ENABLE3
PI12 SPI2_SS
PI13 -
PI14 RS485_RECEIVER_ENABLE4
PI15 RS485_DRIVER_ENABLE4

Optional

Element Connection
HTS221
VDD +3V3
CS +3V3
GND GND
SCL/SPC I2C2_SCL
SDA/SDI/SDO I2C2_SDA
DRDY -
LIS3DH
VDD_IO +3V3
NC -
NC -

SCL/SPC

I2C2_SCL

GND

GND
SDA/SDI/SDO I2C2_SDA
SDO/SAO -
CS +3V3
ADC1 -
ADC2 -
VDD +3V3
ADC3 -
GND GND
INT1 -
RES GND
INT2 -
LSM6DS33
GND, GND, RES, RES, RES, RES GND
INT1 -
INT2 -
VDDIO +3V3
SCL I2C2_SCL
SDA I2C2_SDA
SDO -
CS +3V3
NC -
RES GND
VDD +3V3
SI7006-A20/SI7020-A20
SDA I2C2_SDA
SCL I2C2_SCL
GND GND
VDD +3V3
DNC1 -
DNC2 -