Arduino OPTA

Overview

The Arduino™ Opta® is a secure micro Programmable Logic Controller (PLC) with Industrial Internet of Things (IoT) capabilities.

Developed in partnership with Finder®, this device supports both the Arduino programming language and standard IEC-61131-3 PLC programming languages, such as Ladder Diagram (LD), Sequential Function Chart (SFC), Function Block Diagram (FBD), Structured Text (ST), and Instruction List (IL), making it an ideal device for automation engineers.

For Zephyr RTOS, both cores are supported. It is also possible to run only on the M4 making the M7 run the PLC tasks while the M4 core under Zephyr acts as a coprocessor.

Additionally, the device features:

  • Ethernet compliant with IEEE802.3-2002

  • 16MB QSPI Flash

  • 4 x green color status LEDs

  • 1 x green or red led over the reset push-button

  • 1 x blue led over the user push-button (Opta Advanced only)

  • 1 x user push-button

  • 1 x reset push-button accessible via pinhole

  • 8 x analog inputs

  • 4 x isolated relay outputs

More information about the board can be found at the ARDUINO-OPTA website. More information about STM32H747XIH6 can be found here:

Supported Features

The arduino_opta board supports the hardware features listed below.

on-chip / on-board
Feature integrated in the SoC / present on the board.
2 / 2
Number of instances that are enabled / disabled.
Click on the label to see the first instance of this feature in the board/SoC DTS files.
vnd,foo
Compatible string for the Devicetree binding matching the feature.
Click on the link to view the binding documentation.

arduino_opta/stm32h747xx/m4 target

Type

Location

Description

Compatible

CPU

on-chip

ARM Cortex-M4F CPU1

arm,cortex-m4f

ADC

on-chip

STM32 ADC4

st,stm32-adc

CAN

on-chip

STM32H7 series FDCAN CAN FD controller2

st,stm32h7-fdcan

Clock control

on-chip

STM32H7 RCC (Reset and Clock controller)1

st,stm32h7-rcc

on-chip

STM32 HSE Clock1

st,stm32-hse-clock

on-chip

STM32 HSI Clock1

st,stm32h7-hsi-clock

on-chip

Generic fixed-rate clock provider3

fixed-clock

on-chip

STM32 LSE Clock1

st,stm32-lse-clock

on-chip

STM32H7 main PLL3

st,stm32h7-pll-clock

on-chip

STM32 Clock multiplexer1

st,stm32-clock-mux

on-chip

STM32 Microcontroller Clock Output (MCO)2

st,stm32-clock-mco

Counter

on-chip

STM32 counters12

st,stm32-counter

DAC

on-chip

STM32 family DAC1

st,stm32-dac

Display

on-chip

STM32 LCD-TFT display controller1

st,stm32-ltdc

DMA

on-chip

STM32 DMA controller (V1)2

st,stm32-dma-v1

on-chip

STM32 BDMA controller1

st,stm32-bdma

on-chip

STM32 DMAMUX controller2

st,stm32-dmamux

Ethernet

on-chip

STM32H7 Ethernet1

st,stm32h7-ethernet

Flash controller

on-chip

STM32 Family flash controller1

st,stm32-flash-controller

GPIO & Headers

on-chip

STM32 GPIO Controller11

st,stm32-gpio

I2C

on-chip

STM32 I2C V2 controller4

st,stm32-i2c-v2

I2S

on-chip

STM32H7 I2S controller3

st,stm32h7-i2s

Input

on-board

Group of GPIO-bound input keys1

gpio-keys

Interrupt controller

on-chip

ARMv7-M NVIC (Nested Vectored Interrupt Controller)1

arm,v7m-nvic

on-chip

STM32 External Interrupt Controller1

st,stm32-exti

IPM

on-chip

STM32 HSEM MAILBOX1

st,stm32-hsem-mailbox

LED

on-board

Group of GPIO-controlled LEDs1

gpio-leds

MDIO

on-chip

STM32 MDIO Controller1

st,stm32-mdio

Memory controller

on-chip

STM32 Battery Backed RAM1

st,stm32-bbram

on-chip

STM32H7 Flexible Memory Controller (FMC)1

st,stm32h7-fmc

on-chip

STM32 Flexible Memory Controller (SDRAM controller)1

st,stm32-fmc-sdram

MIPI-DSI

on-chip

STM32 MIPI DSI host1

st,stm32-mipi-dsi

Miscellaneous

on-board

Group of relays (like in the original Opta) or other kinds of power switches controlled by a GPIO1

gpio-power-switches

MMC

on-chip

STM32 SDMMC Disk Access2

st,stm32-sdmmc

MTD

on-chip

STM32 flash memory1

st,stm32-nv-flash

on-board

Fixed partitions of a flash (or other non-volatile storage) memory1

fixed-partitions

PHY

on-chip

This binding is to be used by all the usb transceivers which are built-in with USB IP1

usb-nop-xceiv

Pin control

on-chip

STM32 Pin controller1

st,stm32-pinctrl

PWM

on-chip

STM32 PWM12

st,stm32-pwm

QSPI

on-chip

STM32 QSPI Controller1

st,stm32-qspi

Reset controller

on-chip

STM32 Reset and Clock Control (RCC) Controller1

st,stm32-rcc-rctl

RNG

on-chip

STM32 Random Number Generator1

st,stm32-rng

RTC

on-chip

STM32 RTC1

st,stm32-rtc

Sensors

on-chip

STM32 family TEMP node for production calibrated sensors with two calibration temperatures1

st,stm32-temp-cal

on-chip

STM32 VBAT1

st,stm32-vbat

on-chip

STM32 VREF+1

st,stm32-vref

Serial controller

on-chip

STM32 USART4

st,stm32-usart

on-chip

STM32 UART4

st,stm32-uart

on-chip

STM32 LPUART1

st,stm32-lpuart

SMbus

on-chip

STM32 SMBus controller4

st,stm32-smbus

SPI

on-chip

STM32H7 SPI controller6

st,stm32h7-spi

SRAM

on-chip

Generic on-chip SRAM description1

mmio-sram

Timer

on-chip

ARMv7-M System Tick1

arm,armv7m-systick

on-chip

STM32 timers14

st,stm32-timers

on-chip

STM32 low-power timer (LPTIM)1

st,stm32-lptim

USB

on-chip

STM32 OTGHS controller1

st,stm32-otghs

on-chip

STM32 OTGFS controller1

st,stm32-otgfs

Video

on-chip

STM32 Digital Camera Memory Interface (DCMI)1

st,stm32-dcmi

Watchdog

on-chip

STM32 watchdog1

st,stm32-watchdog

on-chip

STM32 system window watchdog1

st,stm32-window-watchdog

arduino_opta/stm32h747xx/m7 target

Type

Location

Description

Compatible

CPU

on-chip

ARM Cortex-M7 CPU1

arm,cortex-m7

ADC

on-chip

STM32 ADC4

st,stm32-adc

CAN

on-chip

STM32H7 series FDCAN CAN FD controller2

st,stm32h7-fdcan

Clock control

on-chip

STM32H7 RCC (Reset and Clock controller)1

st,stm32h7-rcc

on-chip

STM32 HSE Clock1

st,stm32-hse-clock

on-chip

STM32 HSI Clock1

st,stm32h7-hsi-clock

on-chip

Generic fixed-rate clock provider1 2

fixed-clock

on-chip

STM32 LSE Clock1

st,stm32-lse-clock

on-chip

STM32H7 main PLL1 2

st,stm32h7-pll-clock

on-chip

STM32 Clock multiplexer1

st,stm32-clock-mux

on-chip

STM32 Microcontroller Clock Output (MCO)2

st,stm32-clock-mco

Counter

on-chip

STM32 counters12

st,stm32-counter

DAC

on-chip

STM32 family DAC1

st,stm32-dac

Display

on-chip

STM32 LCD-TFT display controller1

st,stm32-ltdc

DMA

on-chip

STM32 DMA controller (V1)2

st,stm32-dma-v1

on-chip

STM32 BDMA controller1

st,stm32-bdma

on-chip

STM32 DMAMUX controller2

st,stm32-dmamux

Ethernet

on-chip

STM32H7 Ethernet1

st,stm32h7-ethernet

on-board

Generic MII PHY1

ethernet-phy

Flash controller

on-chip

STM32 Family flash controller1

st,stm32-flash-controller

GPIO & Headers

on-chip

STM32 GPIO Controller11

st,stm32-gpio

I2C

on-chip

STM32 I2C V2 controller4

st,stm32-i2c-v2

I2S

on-chip

STM32H7 I2S controller3

st,stm32h7-i2s

Input

on-board

Group of GPIO-bound input keys1

gpio-keys

Interrupt controller

on-chip

ARMv7-M NVIC (Nested Vectored Interrupt Controller)1

arm,v7m-nvic

on-chip

STM32 External Interrupt Controller1

st,stm32-exti

IPM

on-chip

STM32 HSEM MAILBOX1

st,stm32-hsem-mailbox

LED

on-board

Group of GPIO-controlled LEDs1

gpio-leds

MDIO

on-chip

STM32 MDIO Controller1

st,stm32-mdio

Memory controller

on-chip

STM32 Battery Backed RAM1

st,stm32-bbram

on-chip

STM32H7 Flexible Memory Controller (FMC)1

st,stm32h7-fmc

on-chip

STM32 Flexible Memory Controller (SDRAM controller)1

st,stm32-fmc-sdram

MIPI-DSI

on-chip

STM32 MIPI DSI host1

st,stm32-mipi-dsi

Miscellaneous

on-board

Group of relays (like in the original Opta) or other kinds of power switches controlled by a GPIO1

gpio-power-switches

MMC

on-chip

STM32 SDMMC Disk Access2

st,stm32-sdmmc

MMU / MPU

on-chip

ARMv7-M Memory Protection Unit (MPU)1

arm,armv7m-mpu

MTD

on-chip

STM32 flash memory1

st,stm32-nv-flash

on-board

Fixed partitions of a flash (or other non-volatile storage) memory1

fixed-partitions

PHY

on-chip

This binding is to be used by all the usb transceivers which are built-in with USB IP1

usb-nop-xceiv

Pin control

on-chip

STM32 Pin controller1

st,stm32-pinctrl

PWM

on-chip

STM32 PWM12

st,stm32-pwm

QSPI

on-chip

STM32 QSPI Controller1

st,stm32-qspi

Reset controller

on-chip

STM32 Reset and Clock Control (RCC) Controller1

st,stm32-rcc-rctl

RNG

on-chip

STM32 Random Number Generator1

st,stm32-rng

RTC

on-chip

STM32 RTC1

st,stm32-rtc

Sensors

on-chip

STM32 family TEMP node for production calibrated sensors with two calibration temperatures1

st,stm32-temp-cal

on-chip

STM32 VBAT1

st,stm32-vbat

on-chip

STM32 VREF+1

st,stm32-vref

Serial controller

on-chip

STM32 USART4

st,stm32-usart

on-chip

STM32 UART4

st,stm32-uart

on-chip

STM32 LPUART1

st,stm32-lpuart

SMbus

on-chip

STM32 SMBus controller4

st,stm32-smbus

SPI

on-chip

STM32H7 SPI controller6

st,stm32h7-spi

SRAM

on-chip

Generic on-chip SRAM description1

mmio-sram

Timer

on-chip

ARMv7-M System Tick1

arm,armv7m-systick

on-chip

STM32 timers14

st,stm32-timers

on-chip

STM32 low-power timer (LPTIM)1

st,stm32-lptim

USB

on-chip

STM32 OTGHS controller1

st,stm32-otghs

on-chip

STM32 OTGFS controller1

st,stm32-otgfs

Video

on-chip

STM32 Digital Camera Memory Interface (DCMI)1

st,stm32-dcmi

Watchdog

on-chip

STM32 watchdog1

st,stm32-watchdog

on-chip

STM32 system window watchdog1

st,stm32-window-watchdog

Pin Mapping

Both the M7 and M4 cores have access to the 9 GPIO controllers. These controllers are responsible for pin muxing, input/output, pull-up, etc.

For more details please refer to ARDUINO-OPTA website.

Default Zephyr Peripheral Mapping

  • Status LED1: PI0

  • Status LED2: PI1

  • Status LED3: PI3

  • Status LED4: PH15

  • Green “reset” LED: PH12

  • Red “reset” LED: PH11

  • Blue LED: PE5

  • User button: PE4

  • Input 1 : PA0

  • Input 2 : PC2

  • Input 3 : PF12

  • Input 4 : PB0

  • Input 5 : PF10

  • Input 6 : PF8

  • Input 7 : PF6

  • Input 8 : PF4

  • Relay 1: PI6

  • Relay 2: PI5

  • Relay 3: PI7

  • Relay 4: PI4

System Clock

The STM32H747I System Clock can be driven by an internal or external oscillator, as well as by the main PLL clock. By default, the CPU2 (Cortex-M4) System clock is driven at 240MHz. PLL clock is fed by a 25MHz high speed external clock. The M7 clock is driven at 400MHz.

Resources sharing

The dual core nature of STM32H747 SoC requires sharing HW resources between the two cores. This is done in 3 ways:

  • Compilation: Clock configuration is only accessible to M7 core. M4 core only has access to bus clock activation and deactivation.

  • Static pre-compilation assignment: Peripherals such as a UART are assigned in devicetree before compilation. The user must ensure peripherals are not assigned to both cores at the same time.

  • Run time protection: Interrupt-controller and GPIO configurations could be accessed by both cores at run time. Accesses are protected by a hardware semaphore to avoid potential concurrent access issues.

Programming and Debugging

Applications for the arduino_opta use the regular Zephyr build commands. See Building an Application for more information about application builds.

Flashing

Flashing operation will depend on the target to be flashed and the SoC option bytes configuration. The OPTA has a DFU capable bootloader which can be accessed by connecting the device to the USB, and then pressing the RESET button shortly twice, the RESET-LED on the board will fade indicating the board is in bootloader mode.

By default:

  • CPU1 (Cortex-M7) boot address is set to 0x08040000

  • CPU2 (Cortex-M4) boot address is set to 0x08180000

Zephyr flash configuration has been set to be compatible with the “Flash split: 1.5MB M7 + 0.5MB M4” option in the Arduino IDE. The flash is partitioned as follows:

  • 0x08000000-0x0803FFFF (256k) Arduino MCUboot-derived bootloader

  • 0x08040000-0x080FFFFF (768k) M7 application

  • 0x08180000-0x081FFFFF (512k) M4 application

Flashing an application to ARDUINO OPTA M7

First, connect the device to your host computer using the USB port to prepare it for flashing. Then build and flash your application.

Here is an example for the Blinky application on M7 core.

# From the root of the zephyr repository
west build -b arduino_opta/stm32h747xx/m7 samples/basic/blinky
west flash

Flashing an application to ARDUINO OPTA M4

First, connect the device to your host computer using the USB port to prepare it for flashing. Then build and flash your application.

Here is an example for the Blinky application on M4 core.

# From the root of the zephyr repository
west build -b arduino_opta/stm32h747xx/m4 samples/basic/blinky
west flash

Starting the application on the ARDUINO OPTA M4

If you also flashed an application to M7 the M4 processor is started at boot. If not you will need to start the processor from an Arduino sketch.

Make sure the option bytes are set to prevent the M4 from auto-starting, and that the M7 side starts the M4 at the correct Flash address.

This can be done by selecting in the Arduino IDE’s “Tools” / “Flash Split” menu the “1.5MB M7 + 0.5MB M4” option, and loading a sketch that contains at least the following code:

#include <RPC.h>

void setup() {
    RPC.begin();
}

void loop() { }

Debugging

The debug port does not have an easy access but it is possible to open the case and solder a standard 10-pin SWD connector to the board. After that both flashing and debugging are available via ST-LINK (M7 core only).