Skip to content

Comments

Add MQTT Broker with TLS support for STM32H753ZI#39

Open
dgarske wants to merge 2 commits intowolfSSL:masterfrom
dgarske:stm32_mqtt_broker
Open

Add MQTT Broker with TLS support for STM32H753ZI#39
dgarske wants to merge 2 commits intowolfSSL:masterfrom
dgarske:stm32_mqtt_broker

Conversation

@dgarske
Copy link
Contributor

@dgarske dgarske commented Feb 20, 2026

Requires: wolfSSL/wolfMQTT#463

Summary

Ports the MQTT broker implementation from STM32H563 to STM32H753ZI, enabling a fully functional MQTT broker with TLS 1.3 on port 8883.

Changes

wolfIP (src/port/stm32h753/)

  • Added mqtt_broker.c and mqtt_broker.h - broker wrapper for bare-metal integration
  • Updated Makefile - added ENABLE_MQTT_BROKER build option with wolfMQTT sources
  • Updated user_settings.h - configured wolfMQTT broker with optimized limits for 512KB RAM
    • BROKER_MAX_CLIENTS=3 (reduced from 4 on H563)
    • WOLFMQTT_BROKER_CUSTOM_NET for application-managed TLS context
  • Updated config.h - increased MAX_TCPSOCKETS from 8 to 12, adjusted buffers for broker
  • Updated main.c - integrated broker initialization and polling

Memory Usage

  • Flash: 222KB (fits in 1MB)
  • RAM: 490KB (fits in 512KB)
  • Broker supports 3 concurrent TLS clients

Testing

# Build and flash
make ENABLE_MQTT_BROKER=1 CC=arm-none-eabi-gcc \
     WOLFSSL_ROOT=../../../../wolfssl \
     WOLFMQTT_ROOT=../../../../wolfmqtt
st-flash write app.bin 0x08000000

# Test broker
mosquitto_pub -h 10.0.4.201 -p 8883 --insecure -t test -m "Hello"
mosquitto_sub -h 10.0.4.201 -p 8883 --insecure -t test/# -v

Testing output

=== Clock Config Debug ===
Running at 64MHz HSI...
Configuring HSE + PLL (400MHz)...
Clock config OK! Now at 400MHz SYSCLK, 200MHz HCLK
RNG init: OK val=0xF1A664F3


=== wolfIP STM32H753ZI Echo Server ===
Initializing wolfIP stack...
Initializing Ethernet MAC...
  PHY link: UP, PHY addr: 0x00000000
Waiting for DHCP...
DHCP configuration received.
IP Address: 10.0.4.201
Subnet Mask: 10.0.4.1
Gateway: 10.0.4.1
DNS Server: 10.0.4.1
DHCP configuration received:
  IP: 10.0.4.201
  Mask: 10.0.4.1
  GW: 10.0.4.1
Creating TCP echo server on port 7...
Initializing MQTT broker on port 8883 (TLS)...
MQTT Broker: Initializing
Entering main loop. Ready for connections!
  TCP Echo: port 7
MQTT Broker: TLS initialized (TLS 1.3, ECC P-256)
MQTT Broker: Running on port 8883 (TLS)

@dgarske dgarske assigned dgarske, danielinux and wolfSSL-Bot and unassigned dgarske Feb 20, 2026
@dgarske dgarske requested a review from danielinux February 20, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants