# User Manual # Introduction {{@264}} [![image.png](https://doc.redisage.com/uploads/images/gallery/2024-06/scaled-1680-/4Qcimage.png)](https://doc.redisage.com/uploads/images/gallery/2024-06/4Qcimage.png) If you want to get started, make sure you have complete set of: - [Tag-connect cable](https://redisage.com/en/products/p04-tc2050-idc-nl-10-pin-no-legs-cable-with-ribbon-connector-124) - [Tag-connect retaining clip board](https://redisage.com/en/products/p05-tc2050-clip-3pack-retaining-clip-board-for-tc2050-nl-cables-3-pack-125?query_id=1) (optional) - Open IoT and IIoT Gateway - [USB Programmer](https://redisage.com/en/products/pac-iot/procesing-unit-cpu/esp32/p03-usb-programmer-for-esp32-p01-p02-open-gateways-ftdi-39.html) - [ST-LINK programmer](https://www.st.com/en/development-tools/st-link-v2.html) # Hardware ## {{@264#bkmrk-open-iot-and-iiot-ga}} ### Features
**Features** [![image.png](https://doc.redisage.com/uploads/images/gallery/2024-06/scaled-1680-/4Qcimage.png)](https://doc.redisage.com/uploads/images/gallery/2024-06/4Qcimage.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**
{{@169}} ### {{@263#bkmrk-specifications%E2%80%8E%E2%80%8E%E2%80%8E}} {{@263#bkmrk-redisage-pn-p01-p02-}} ### LED indicators
**Gateways P10 - P12**
[![image.png](https://doc.redisage.com/uploads/images/gallery/2024-06/scaled-1680-/Llbimage.png)](https://doc.redisage.com/uploads/images/gallery/2024-06/Llbimage.png)
**LED indicator****Color****Function**
PWBluePower
L1GreenLED 1
L2GreenLED 2
L3YellowLED 3
L4RedLED 4
L5RedLED 5
### {{@263#bkmrk-pin-assignments}} {{@263#bkmrk-p01-%C2%A0-p02-%C2%A0}} ### Board overview The complete Open IoT and IIoT Gateway kit consists of: - developer module - power supply module - RJ45 network adapter - hardware programmer (TagConnect + adapter for ST-LINK) #### Main Board [![image.png](https://doc.redisage.com/uploads/images/gallery/2025-02/scaled-1680-/ginimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-02/ginimage.png) #### Power Supply Board [![image.png](https://doc.redisage.com/uploads/images/gallery/2025-02/scaled-1680-/ZGqimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-02/ZGqimage.png) #### Power input & RS232/RS485 ports [![image.png](https://doc.redisage.com/uploads/images/gallery/2025-02/scaled-1680-/w9yimage.png) ](https://doc.redisage.com/uploads/images/gallery/2025-02/w9yimage.png)[![image.png](https://doc.redisage.com/uploads/images/gallery/2025-02/scaled-1680-/zsFimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-02/zsFimage.png) - **Vcc1**, **Vcc2** - power supply input 12-30 VDC - **FG** - frame ground - **GND** - power supply ground

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](https://doc.redisage.com/uploads/images/gallery/2025-02/scaled-1680-/CEIimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-02/CEIimage.png) [![image.png](https://doc.redisage.com/uploads/images/gallery/2025-02/scaled-1680-/JUVimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-02/JUVimage.png) # Programming ## {{@264#bkmrk-open-iot-and-iiot-ga}} ### Install IDE & Programmer Download and install [STM32CubeIDE](https://www.st.com/en/development-tools/stm32cubeide.html#get-software) for ability to creating own programs. For device programming, you must install [STM32CubeProgrammer](https://www.st.com/en/development-tools/stm32cubeprog.html). 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](https://www.st.com/en/development-tools/st-link-v2.html) - 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](https://doc.redisage.com/uploads/images/gallery/2025-02/scaled-1680-/Y3mimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-02/Y3mimage.png) ### Connect the power supply The gateway works with 12-30V DC power supplies. Make sure your supply is properly set. [![image.png](https://doc.redisage.com/uploads/images/gallery/2025-02/scaled-1680-/yKHimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-02/yKHimage.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](https://doc.redisage.com/uploads/images/gallery/2025-01/scaled-1680-/image.png)](https://doc.redisage.com/uploads/images/gallery/2025-01/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](https://www.st.com/resource/en/application_note/an5952-how-to-use-cmake-in-stm32cubeide-stmicroelectronics.pdf). #### 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](https://doc.redisage.com/uploads/images/gallery/2025-01/scaled-1680-/fCjimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-01/fCjimage.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](https://doc.redisage.com/uploads/images/gallery/2025-01/scaled-1680-/iWgimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-01/iWgimage.png) Find the .elf file (it should always be generated in the Debug folder in your project's path). [![image.png](https://doc.redisage.com/uploads/images/gallery/2025-01/scaled-1680-/Ezsimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-01/Ezsimage.png) Click "Open". [![image.png](https://doc.redisage.com/uploads/images/gallery/2025-01/scaled-1680-/4gJimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-01/4gJimage.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](https://doc.redisage.com/uploads/images/gallery/2025-01/scaled-1680-/dUIimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-01/dUIimage.png) [![image.png](https://doc.redisage.com/uploads/images/gallery/2025-01/scaled-1680-/Vivimage.png)](https://doc.redisage.com/uploads/images/gallery/2025-01/Vivimage.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](https://doc.redisage.com/uploads/images/gallery/2025-01/scaled-1680-/MXCimage.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](https://redisage.com/usb-converter/c37-to-1x-uart-3v3-logic-ftdi)). 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 ## {{@264#bkmrk-open-iot-and-iiot-ga}} ### CGM Rev. 3.1
ElementConnection
**LED**
Power LED+3V3
LED1 PG6
LED2PH14
LED3PA10
LED4PH12
LED5PI9
**ST3232BTR\_1 UART RS232 Transceiver (P10 & P11)**
T1\_INUSART1\_TXD
T2\_INUSART6\_TXD
T1\_OUTTXD1
T2\_OUTTXD2
R1\_INRXD1
R2\_INRXD2
R1\_OUTUSART1\_RXD
R2\_OUTUSART6\_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\_1RXD2
I/O\_2 TXD1
I/O\_3RXD1
I/O\_4TXD2
GNDFGC
**ST3232BTR\_2 UART RS232 Transceiver (P10)**
T1\_INUSART3\_TXD
T2\_INUART7\_TXD
T1\_OUTB\_4
T2\_OUTB\_3
R1\_INA\_4
R2\_INA\_3
R1\_OUTUSART3\_RXD
R2\_OUTUART7\_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\_3B\_4
I/O\_4A\_4
GNDFGC
**MAX481CSA\_1 UART RS485 Transceiver (P12)**
DIUSART1\_TXD
DERS485\_DRIVER\_ENABLE1
RE/RS485\_RECEIVER\_ENABLE1
ROUSART1\_RXD
ATXD1
BRXD1
**MAX481CSA\_2 UART RS485 Transceiver (P12)**
DIUSART6\_TXD
DERS485\_DRIVER\_ENABLE2
RE/RS485\_RECEIVER\_ENABLE2
ROUSART6\_RXD
ATXD2
BRXD2
**MAX481CSA\_3 UART RS485 Transceiver (P11 & P12)**
DIUSART3\_TXD
DERS485\_DRIVER\_ENABLE3
RE/RS485\_RECEIVER\_ENABLE3
ROUSART3\_RXD
AA\_3
BB\_3
**MAX481CSA\_4 UART RS485 Transceiver (P11 & P12)**
DIUART7\_TXD
DERS485\_DRIVER\_ENABLE4
RE/RS485\_RECEIVER\_ENABLE4
ROUART7\_RXD
AA\_4
BB\_4
**USBLC6-2P6 ESD protection**
VCCVBUS\_ADC, MICROUSB\_B\_U254-051T-4BH83-F1S (PIN1)
GNDGND
IO1\_AMICROUSB\_B\_U254-051T-4BH83-F1S (PIN2)
IO2\_AMICROUSB\_B\_U254-051T-4BH83-F1S (PIN3)
IO1\_BBOOTLOADER\_TX
IO2\_BBOOTLOADER\_RX
**Serial EEPROM M24C08-RMC6TG**
E0GND
E1GND
E2+3V3
VSSGND
VCC+3V3
WC/GND
SCLI2C1\_SCL
SDAI2C1\_SDA
**Serial Flash A25LQ64M**
CS#SPI2\_SS
SOSPI2\_MISO
WP#SPI2\_W
VSSGND
VCC+3V3
HOLD#SPI2\_IO3
SCLKSPI2\_SCK
SISPI2\_MOSI
**IP101GRI ETHERNET PHY transceivers**
MDCETH\_MDC
MDIOETH\_MDIO
MDI\_TPTXD+
MDI\_TNTXD-
MDI\_RPRXD+
MDI\_RNRXD-
X2-
X1ETH\_MCO
RESET\_NETH\_RESET\_N
ISETETH\_ISET
LED0/PHY\_AD0ETH\_LED0/PHY\_AD0
LED3/PHY\_AD3ETH\_LED3/PHY\_AD3
TEST\_ON-
REGOUTC23 (100 nF), C29 (10 uF)
VDDIO+3V3
AVDD33+3V3
GNDGND
TXENETH\_TX\_EN
TXER/FXSD-
TXCLK/50M\_CLKIETH\_RMII\_REF\_CLK
TXD0ETH\_TXD0
TXD1ETH\_TXD1
TXD2-
TXD3-
RXDV/CRS\_DV/FX\_HENETH\_RXDV/CRS\_DV
RXCLK/50M\_CLKO-
RXD0ETH\_RXD0
RXD1ETH\_RXD1
RXD2-
RXD3-
RXER/INTR\_32-
COL/RMIIETH\_COL/RMII
CRS/LEDMOD-
**STM32 F439NIH6**
PA0-
PA1ETH\_RMII\_REF\_CLK
PA2ETH\_MDIO
PA3-
PA4-
PA5-
PA6SWITCH
PA7ETH\_RXDV/CRS\_DV
PA8ETH\_MCO
PA9BUZZER\_PWM
PA10LED\_A3
PA11USB\_DM BOOTLOADER\_RX
PA12USB\_DP BOOTLOADER\_TX
PA13JTMS
PA14JTCK
PA15CONF2
PB0ETH\_LED0/PHY\_AD0
PB1ETH\_LED3/PHY\_AD3
PB2BOOT1
PB3SW0
PB4USART1\_RXD
PB5USART1\_TXD
PB6USART1\_TXD
PB7USART1\_RXD
PB8I2C1\_SCL
PB9I2C1\_SDA
PB10USART3\_TXD
PB11USART3\_RXD
PB12USART3\_RXD
PB13USART3\_TXD
PB14-
PB15-
PC0SD\_NWE
PC1ETH\_MDC
PC2-
PC3-
PC4ETH\_RXD0
PC5ETH\_RXD1
PC6USART6\_TXD
PC7USART6\_TXD
PC8CONF4
PC9CONF1
PC10BOOTLOADER\_TX
PC11BOOTLOADER\_RX
PC12CONF3
PC13RTC\_AF1
PC14OSC32\_IN
PC15OSC32\_OUT
PD0D2
PD1D3
PD2CONF6
PD3-
PD4NOR\_NOE
PD5NOR\_NWE
PD6NOR\_NWAIT
PD7NOR\_NE1
PD8D13
PD9D14
PD10D15
PD11A16
PD12A17
PD13A18
PD14D0
PD15D1
PE0SD\_LDOM
PE1SD\_UDOM
PE2-
PE3A19
PE4A20
PE5A21
PE6-
PE7D4
PE8D5
PE9D6
PE10D7
PE11D8
PE12D9
PE13D10
PE14D11
PE15D12
PF0A0
PF1A1
PF2A2
PF3A3
PF4A4
PF5A5
PF6UART7\_RXD
PF7UART7\_TXD
PF8VBUS\_ADC
PF9L2
PF10L1
PF11SD\_NDRAS
PF12A6
PF13A7
PF14A8
PF15A9
PG0A10
PG1A11
PG2A12
PG3A13
PG4A14
PG5A15
PG6LED\_A1
PG7DIP\_SWITCH
PG8SD\_CLK
PG9USART6\_RXD
PG10USART6\_RXD
PG11ETH\_TXEN
PG12-
PG13ETH\_TXD0
PG14ETH\_TXD1
PG15SD\_NCAS
PH0OSC+IN
PH1OSC\_OUT
PH2SD\_CKE0
PH3SD\_NE0
PH4I2C2\_SCL
PH5I2C2\_SDA
PH6-
PH7-
PH8RS485\_DRIVER\_ENABLE1
PH9RS485\_RECEIVER\_ENABLE1
PH10RS485\_DRIVER\_ENABLE2
PH11RS485\_RECEIVER\_ENABLE2
PH12LED\_A4
PH13-
PH14LED\_A2
PH15CONF5
PI0WP#//ACC
PI1SPI2\_SCK
PI2SPI2\_MISO
PI3SPI2\_MOSI
PI4SPI2\_W
PI5SPI2\_IO3
PI6ETH\_RST
PI7RS485\_DRIVER\_ENABLE3
PI8RS485\_RECEIVER\_ENABLE3
PI9LED\_5
PI10RS485\_TERMINATION\_ENABLE4
PI11RS485\_TERMINATION\_ENABLE3
PI12SPI2\_SS
PI13-
PI14RS485\_RECEIVER\_ENABLE4
PI15RS485\_DRIVER\_ENABLE4
### Optional
ElementConnection
**HTS221**
VDD+3V3
CS+3V3
GNDGND
SCL/SPCI2C2\_SCL
SDA/SDI/SDOI2C2\_SDA
DRDY-
**LIS3DH**
VDD\_IO+3V3
NC-
NC-
SCL/SPC I2C2\_SCL
GND GND
SDA/SDI/SDOI2C2\_SDA
SDO/SAO-
CS+3V3
ADC1-
ADC2-
VDD+3V3
ADC3-
GNDGND
INT1-
RESGND
INT2-
**LSM6DS33**
GND, GND, RES, RES, RES, RESGND
INT1-
INT2-
VDDIO+3V3
SCLI2C2\_SCL
SDAI2C2\_SDA
SDO-
CS+3V3
NC-
RESGND
VDD+3V3
**SI7006-A20/SI7020-A20**
SDAI2C2\_SDA
SCLI2C2\_SCL
GNDGND
VDD+3V3
DNC1-
DNC2-