Embedded Firmware

Client mission · N7 Consulting

SOGECLAIR Simulation

I developed and validated the embedded C firmware of a simulator I/O board migrated from an Infineon XC167 to an STM32H753. The board drives cockpit equipment in pilot-training simulators. My firmware receives the host protocol over RS232 or native Ethernet, rebuilds the frames, runs the communication state machine and passes commands to the I/O layer, keeping the behaviour the existing simulators expect. I checked it with functional and non-regression tests.

FIG. 01 · Simulator I/O board interfacesIllustration.
01

What I built

  • Serial transportUSART reception with DMA into receive buffers, so frames arrive without blocking the firmware. RS232 stays available and carries the same protocol.
  • Ethernet transportNative Ethernet through the STM32H753 MAC, RMII and an external PHY, with LwIP carrying the protocol over TCP and UDP.
  • Frame layerFrame reassembly from start and end markers, the legacy additive checksum, and a communication state machine with timers and retransmission.
  • BehaviourHost commands keep priority over periodic refresh, and outputs keep the logical states the legacy board produced.
  • ValidationFunctional and non-regression tests of the protocol behaviour on the STM32H753 target.
02

Before and after

Simulator I/O board: XC167 architecture and STM32H753 architectureBefore: the host reaches the XC167 board over RS232, or over Ethernet through an external Ethernet-to-serial converter. After: the STM32H753 takes Ethernet natively through a PHY, RMII and its MAC with DMA, then LwIP for TCP and UDP; RS232 remains a second transport. Both transports feed a transport abstraction, frame reassembly with the legacy checksum, and the communication state machine, which drives the client's hardware API and the simulator I/O.BEFORE · INFINEON XC167AFTER · STM32H753Ethernet TCP/UDPRS232serialEthernet TCP/UDPRS232RMIISimulation hostsame frame protocol on every transportEthernet ↔ serial converterexternal moduleUARTXC167 firmwareframes, checksum,state machineSimulator I/Obuttons, lights, displaysEthernet PHY 10/100MAC + Ethernet DMAcache-coherent buffersLwIP · TCP and UDPRS232 transceiverUSART + DMAasynchronous receptionReceive buffersTransport abstraction · send / receive / statusFrame reassemblystart / end, legacy checksumCommunication state machinetimers, retransmissionClient hardware API and driversSimulator I/O · buttons, lights, displays, motors
  • Data
  • Command
  • My firmware

FIG. 02Migration architecture. Before, Ethernet reached the XC167 only through an external converter. After, Ethernet is native and RS232 remains a second transport for the same frames. Highlighted blocks are my firmware; the hardware API and drivers belong to the client.
03

Two problems worth explaining

  • TCP is a byte streamOne receive can hold half a frame or several frames. The frame layer rebuilds frames from their markers and never assumes that a TCP segment, or a UDP datagram, is one frame.
  • DMA meets the Cortex-M7 cacheThe Ethernet and UART DMA engines write memory that the core reads through its data cache. Buffers and descriptors need alignment and explicit cache maintenance, or non-cacheable regions, rather than a cache disabled for the whole firmware.

Validation results forthcomingComparison against the client's reference equipment.

04

Mission

Client mission through N7 Consulting. The client's hardware API, protocol documents and source code stay confidential.