For agentic workers: Execute this plan inline. Do not create a worktree
because the current working directory contains the user’s uncommitted project
changes and is the only complete current project state.
Goal: Remove unused IAR build inputs and IAR-only Modbus snapshots while
preserving the PLC protocol behavior and the two requested live-watch arrays.
Architecture: The target remains an STM32F407/uC-OS-II Modbus RTU slave.
Only the IAR project source list and application-level diagnostic path change;
the protocol core, backup module, interrupt behavior, public data storage, and
TouchWin contract remain intact. The final project design is generated after
the source edits so every locator reflects the finished code.
Tech Stack: IAR EWARM 8.3, STM32F4 HAL, uC/OS-II, C99 host tests,
PowerShell static checks, Markdown.
holdingRegisters, coilStorage, and extendedHoldingRegister.Drivers/ or RTOS sources under Core/OS/.EWARM/Modbus/Exe/Modbus.hex, document/, uC-OS2_temp/, and IARFiles:
EWARM/Modbus.ewp:1140-1173EWARM/Modbus/List/Modbus.mapInterfaces:
Consumes: the current link map, which records zero linked sections for the
eight listed HAL translation units.
Produces: an IAR source list that compiles only the HAL modules used by the
current target.
Files:
Core/Src/main.c:30-41, 107-116, 630-710, 730-780, 818, 890-940Core/Inc/main.h:37-51Core/OS/Cfg/app_cfg.h:45-47Core/Modbus/app_runtime_test.c:78-106Interfaces:
Consumes: holdingRegisters, coilStorage, and extendedHoldingRegister
as the only IAR Live Watch data interface.
Produces: the same UART recovery and RTU behavior without exported snapshots
or their RAM buffers.
Files:
Core/Src/main.cCore/Inc/main.hCore/OS/Cfg/app_cfg.hCore/Modbus/modbus.cCore/Modbus/modbus.hCore/Modbus/modbus_backup.cCore/Modbus/modbus_backup.hCore/Src/stm32f4xx_it.cCore/Inc/stm32f4xx_it.hInterfaces:
Consumes: existing APIs and symbol names.
Produces: Doxygen comments that explain ownership, protocol constraints,
concurrency boundaries, parameter units, side effects, and error behavior.
Files:
.gitignoreapp_runtime_test.exe, modbus_backup_test.exe,modbus_protocol_test.exe, and all root *.stackdumpEWARM/Modbus/Obj/, EWARM/Modbus/List/Modbus.map,EWARM/Modbus/Exe/Modbus.out, EWARM/Modbus/Exe/Modbus.sim, andEWARM/Modbus.depInterfaces:
Consumes: Modbus.hex as the retained downloadable firmware artifact.
Produces: a source workspace without host-test binaries or IAR intermediate
outputs.
Files:
docs/项目设计.mdCore/Modbus/modbus_test.c, Core/Modbus/modbus_backup_test.c,Core/Modbus/app_runtime_test.c, Core/Modbus/check_rtu_runtime_invariants.ps1,Core/Modbus/check_no_communication_counters.ps1, EWARM/Modbus.ewpInterfaces:
Consumes: final source line numbers after Tasks 1-4.
Produces: a maintainable design document whose code references can be opened
directly in the source tree.