Skip to main content

Driver Input ECU - ThreadX (MXChip AZ3166)

This optional extension adds two MXChip AZ3166 boards that demonstrate SOME/IP vehicle-signal communication alongside the existing MQTT-based signal flow. The boards run on Eclipse ThreadX with Eclipse ThreadX NetX Duo for networking.

Hardware

ComponentDetails
BoardMXChip AZ3166 (×2)
MCUSTM32F412RG (100 MHz, 1 MB flash, 256 KB SRAM)
Display128×64 OLED for blinker status visualization
LEDsRGB LEDs controlled by P9813
InputTwo buttons (A and B)
ConnectivityWi-Fi (2.4 GHz)
SensorsTemperature/Humidity (HTS221), Pressure (LPS22HB)

See the Hardware BOM for sourcing details.

Responsibilities

  • Capture button input (left/right blinker toggle)
  • Display current blinker/brake status on the OLED
  • Publish and subscribe to VSS signals over MQTT
  • Communicate between boards via SOME/IP (OpenSOME/IP over UDP)
  • Control RGB LEDs to indicate blinker and brake states

Communication Modes

The application supports two communication modes that can run simultaneously:

MQTT Mode (Default)

Communicates with the Mosquitto MQTT broker on the Raspberry Pi 5. Subscribes to InVehicleTopics to receive blinker state updates from the joystick ECU.

SOME/IP Mode (Optional)

Direct UDP-based vehicle signal communication between two AZ3166 boards using OpenSOME/IP:

RoleLocal EndpointTarget Endpoint
Device 1192.168.88.91:30490192.168.88.92:30500
Device 2192.168.88.92:30500192.168.88.91:30490

SOME/IP payload: 5 bytes [left, right, brake, button_a, button_b] (each value is 0 or 1)

Prerequisites

Development Environment

ToolMinimum Version
CMake3.15
NinjaLatest
Arm GNU Embedded Toolchain13.3.rel1
GitWith submodule support

Installation

Windows:

winget install --id=Arm.GnuArmEmbeddedToolchain -e
winget install --id=Ninja-build.Ninja -e
winget install --id=Kitware.CMake -e

Ubuntu/Linux:

sudo apt install ninja-build cmake
wget https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
sudo tar xJf arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz -C /opt
export PATH=$PATH:/opt/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin

macOS: Download from Arm GNU Toolchain Downloads.

Project Setup

Ensure submodules are initialized from the repository root:

git submodule init
git submodule update --recursive

Building

Build scripts are in external/challenge-threadx-playRemote/MXChip/AZ3166/scripts/.

MQTT-Only Build

cd external/challenge-threadx-playRemote
# Windows: MXChip\AZ3166\scripts\build.bat
# Linux/macOS:
./MXChip/AZ3166/scripts/build.sh

Output: external/challenge-threadx-playRemote/MXChip/AZ3166/build/app/az3166_app.elf

Build with SOME/IP

cd external/challenge-threadx-playRemote
# Build for Device Role 1:
./MXChip/AZ3166/scripts/build-with-someip.sh 1
# Build for Device Role 2:
./MXChip/AZ3166/scripts/build-with-someip.sh 2

Manual CMake Build

cd external/challenge-threadx-playRemote/MXChip/AZ3166
cmake -B build -GNinja \
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/arm-gcc-cortex-m4.cmake \
-DENABLE_OPENSOMEIP=ON \
-DSOMEIP_DEVICE_ROLE=1 \
-DOPENSOMEIP_SOURCE_DIR=../../third_party/opensomeip
cmake --build build

Configuration

Network Configuration

Edit external/challenge-threadx-playRemote/MXChip/AZ3166/app/cloud_config.h:

SettingDefaultDescription
WIFI_SSIDTarget Wi-Fi network SSID
WIFI_PASSWORDWi-Fi network password
MQTT_BROKER_ADDRESS192.168.88.100MQTT broker IP (Raspberry Pi 5)
MQTT_BROKER_PORT1883MQTT broker port
SOMEIP_SIGNAL_TARGET_IPRemote SOME/IP endpoint IP (when SOME/IP enabled)
SOMEIP_SIGNAL_TARGET_PORTRemote SOME/IP endpoint port
SOMEIP_SIGNAL_SERVICE_IDShared SOME/IP service ID
SOMEIP_SIGNAL_EVENT_IDShared SOME/IP event ID
SOMEIP_SIGNAL_CLIENT_IDSOME/IP client identifier

Runtime Operation

User Interface

InputAction
Button AToggle left blinker / send left signal
Button BToggle right blinker / send right signal
Button A + B (hold 2 sec)Graceful shutdown (MQTT unsubscribe/disconnect)

LED and Display

  • RGB LEDs: Blink for active indicators, solid for brake
  • OLED Display: Shows current button state and blinker status
  • When SOME/IP is enabled, displays remote state: SIP LxRxBx AxBx

Serial Debug

Monitor at 115200 baud for [MQTT], [SOMEIP][TX], and [SOMEIP][RX] log messages.

Debugging

Wireshark SOME/IP Capture

udp.port == 30490 || udp.port == 30500

Or with the SOME/IP dissector:

someip

References