Keep the existing Modbus RTU slave responsive during long-running TouchWin
communication. The primary acceptance test is a 24-hour TouchWin cyclic
read/write session with no timeout and no need to restart the HMI or slave.
The uC/OS-II port defines CPU_CFG_KA_IPL_BOUNDARY as 4. Therefore only
interrupt priorities 4 through 15 are allowed to call uC/OS-II APIs.
The current SysTick priority is 0, but its handler calls OSIntEnter(),
OSTimeTick(), and OSIntExit(). It can preempt an OS critical section and
corrupt the scheduler or semaphore state.
0x41, 0x42,0x43 wire contracts unchanged.4 and use the uC/OS-II Cortex-M5 and USART1 priority 6; both are alreadyHAL_UART_Receive_IT() result must not be discarded. The recovery path mustThe receive path must attempt recovery only after a frame has been processed
or after a UART error. It must not overwrite a completed frame. If rearming
fails, the code must capture the HAL status and continue with a bounded retry
path rather than silently leaving USART1 unarmed.
Static regression checks must prove that:
AppTaskModbus() handles, rather than discards, receive-rearm failures.Firmware verification consists of an IAR build followed by two hardware
tests with the final binary:
The existing host Modbus protocol and RTC-backup tests remain required
regressions, but cannot replace the hardware communication tests.