RealEmbedBench: Benchmarking LLMs on Real-World Application-Layer Embedded Software Tasks
Organizations: Nanjing University of Aeronautics and Astronautics, Nanjing, China · Nanjing Research institute of electronics engineering, Nanjing, China
Abstract
Large language models (LLMs) perform well on general coding tasks, but their capabilities in application-layer embedded software development remain underexplored. Existing embedded benchmarks primarily focus on hardware-in-the-loop validation in simulated environments. We introduce RealEmbedBench, a benchmark of 5,142 samples covering three application-layer tasks: code generation and completion, state machine modeling and implementation, and cross-OS code translation. We evaluate six representative LLMs and find substantial performance differences across tasks and models. Project context, especially the local code window, significantly affects code generation and completion. Models perform reasonably well at state machine modeling but struggle to translate these models into executable code. Cross-OS translation performance varies substantially by direction. Translation from Harmony to RT-Thread is particularly challenging, with an average pass rate of 0.1667. These findings suggest that developers should consider local code context when using LLMs for code generation and completion and select models according to the translation direction. They also motivate the use of more real-world state machine implementation data in LLM training to narrow the gap between modeling and executable code.
Figures & tables
| Category | Count | Percentage |
| Context-aware code generation and completion | 33 | 26.4% |
| State machine modeling and implementation | 28 | 22.4% |
| Cross-OS code translation | 23 | 18.4% |
| RTOS scheduling and task management | 15 | 12.0% |
| Firmware–hardware coupling and abstraction design | 12 | 9.6% |
| Embedded system architecture and modularization | 9 | 7.2% |
| Syntactic Context Type | Mapped Embedded Software Content |
| Local code window | State checks, buffer operations, sequential logic |
| Import dependencies | HAL headers, protocol libraries, driver interfaces |
| Call dependencies | Interrupt handlers, message dispatch, task callbacks |
| Global data | Device flags, control blocks, global buffers |
| Type definition | Message structs, state enums, configuration structs |
| Benchmark | Embedded Focus | Context | Cross-OS Translation | State Machine Comprehension |
| Englhardt et al. [ 2 ] | ✓ | |||
| EmbedAgent [ 1 ] | ✓ | ✓ | ||
| BigCodeBench [ 23 ] | ✓ | |||
| CoCo-Bench [ 24 ] | ✓ | |||
| Deveval [ 25 ] | ✓ | |||
| RefactorBench [ 26 ] | ✓ |
| Project Name | Domain | Primary Language | Stars | Forks |
| ardupilot | Transportation | C/C++, Python, Objective-C | 14.2k | 19.9k |
| Marlin | Industrial automation | C/C++, Python | 17.2k | 19.6k |
| navigation2 | Industrial automation | C++, Python, CMake | 3.7k | 1.7k |
| openpilot | Automotive | Python, C++, Shell | 59.4k | 10.5k |
| RetroArch | Gaming | C, C++ | 12.4k | 2k |
| Tasmota | Home automation | C/C++, Berry, Python | 23.9k | 5k |
| Task | Size | Statistics |
| Code Gen. / Completion | 1,426 / 3,026 | 56 LOC; 4.93 calls; 3.91 globals; 3.98 types |
| State Machine | 80 | 7.73 states; 14.05 transitions |
| Cross-OS Translation | 610 | 6 OSs; 26 directions |
| OS Type | FreeRTOS | RT-Thread | Unix-like | Zephyr | NuttX | Harmony |
| FreeRTOS | - | 49 | 48 | 24 | 20 | 18 |
| RT-Thread | 49 | - | 37 | 21 | 18 | 1 |
| Unix-like | 48 | 37 | - | 23 | 22 | 4 |
| Zephyr | 24 | 21 | 23 | - | 20 | 0 |
| NuttX | 20 | 18 | 22 | 20 | - | 0 |
| Harmony | 18 | 1 | 4 | 0 | 0 | - |
| Metric | Description | Formula |
| Syntactic Validity | Evaluate the syntactic correctness of PlantUML diagrams | Whether the PlantUML passes compilation |
| State Machine State Coverage | Measure the proportion of correctly covered reference states | |
| State Transition Coverage | Measure the proportion of correctly covered reference transitions |
| Task | Code Gen./Comp. | State Machine | Code Trans. | |||||
| Model | CodeGen | CodeComp | R2P-C | R2P-N | R2P-E | P2C | R2C | CodeTrans |
| deepseek-v3.2 | 0.5388 | 0.5738 | 0.9567 | 0.7598 | 0.6467 | 0.3848 | 0.3809 | 0.7529 |
| qwen3-235b-a22b-instruct | 0.4916 | 0.5211 | 0.9523 | 0.7508 | 0.5601 | 0.4100 | 0.4148 | 0.7371 |
| glm-4.7 | 0.4901 | 0.4804 | 0.9589 | 0.7334 | 0.6766 | 0.3902 | 0.3934 | 0.7833 |
| gemini-3.1-pro | 0.7076 | 0.6915 | 0.9601 | 0.7183 | 0.6566 | 0.4177 | 0.4379 | 0.7481 |
| gpt-5.2 | 0.5095 | 0.6812 | 0.9545 | 0.7493 | 0.6914 | 0.3750 | 0.3706 | 0.6982 |
| Model | RT-Thread to FreeRTOS | RT-Thread to Harmony | RT-Thread to NuttX | RT-Thread to Unix | RT-Thread to Zephyr | FreeRTOS to RT-Thread | FreeRTOS to Harmony |
| deepseek-v3.2 | 0.643 | 1.000 | 0.812 | 0.650 | 0.917 | 0.697 | 0.467 |
| glm-4.7 | 0.536 | 1.000 | 0.778 | 0.609 | 0.923 | 0.700 | 0.538 |
| qwen3-235b | 0.667 | 1.000 | 0.765 | 0.706 | 0.909 | 0.727 | 0.333 |
| gpt-5.2 | 0.600 | 1.000 | 0.722 | 0.750 | 0.923 | 0.667 | 0.429 |
| gemini-3.1-pro | 0.788 | 1.000 | 0.667 | 0.688 | 0.933 | 0.786 | 0.722 |
| starcoder | 0 | 1.000 | 0 | 0.215 | 0.247 | 0 | 0.191 |
| Model | Full | ImpEsc | CodeWinEsc | CallDepEsc | GlobDataEsc | TypeDepEsc | NoCtx |
| deepseek-v3.2 | 0.5388 | 0.5360 | 0.4642 | 0.5063 | 0.5273 | 0.5236 | 0.3260 |
| qwen3-235b-a22b-instruct | 0.4916 | 0.4893 | 0.4148 | 0.4555 | 0.4728 | 0.4783 | 0.2451 |
| glm-4.7 | 0.4901 | 0.4855 | 0.4204 | 0.4608 | 0.4744 | 0.4628 | 0.2938 |
| gemini-3.1-pro | 0.7076 | 0.6907 | 0.5929 | 0.6712 | 0.6739 | 0.6857 | 0.4149 |
| gpt-5.2 | 0.5095 | 0.4773 | 0.4235 | 0.4522 | 0.4911 | 0.4673 | 0.2466 |
| starcoder | 0.3823 | 0.3775 | 0.3082 | 0.3699 | 0.3654 | 0.3605 | 0.3676 |
| Error Pattern | Freq. |
| API usage mismatch | 38% |
| Misplaced condition evaluation | 32% |
| Transition logic simplification | 22% |
| State structure over-complication | 14% |
| Error Type | Frequency |
| Omitting Available Functions | 19.21% |
| Misusing Target Functions | 11.70% |
| Mistranslating Return Values | 7.80% |
LLM Evaluation
Large language model evaluation measures what models can do, how reliably they do it, and whether benchmark scores predict real-world performance.
See all 2,509 papers