PreArm: Internal errors 0x800 l:240 watchdog_rst after adding a new sensor through uart->serial(4)

I tried to add a new sensor(a telem transfering data computed by a computer) simply by uart->serial(4). But when serial(4) works, there is always a error “PreArm: Internal errors 0x800 l:240 watchdog_rst” no matter armed or disarmed. I read the topics related to watchdog_rst carefully yet have no idea about the problem.

The codes added for the new sensor are:
(1)Arducopter/system.cpp: add “hal.serial(4)>begin(57600,128,128);” before the code " serial_manager.set_blocking_writes_all(false);"
(2)Arducopter/copter.cpp: add “SCHED_TASK(uart_ceshi, 20, 50),”
(3)Arducopter/copter.cpp: add function “uart_ceshi” used to read and write datas.

The errors displayed in the missionplanner are:
2021/4/21 17:03:51 : 4196355 MM0 MC0 IE2048 IEC1 TN:Ardu
2021/4/21 17:03:51 : WDG: T-1 SL0 FL127 FT3 FA0 FTP180 FLR806BBF9 FICSR
2021/4/21 17:03:41 : 4196355 MM0 MC0 IE2048 IEC1 TN:Ardu
2021/4/21 17:03:41 : WDG: T-1 SL0 FL127 FT3 FA0 FTP180 FLR806BBF9 FICSR
2021/4/21 17:03:38 : PreArm: Internal errors 0x800 l:240 watchdog_rst
2021/4/21 17:03:31 : 4196355 MM0 MC0 IE2048 IEC1 TN:Ardu
2021/4/21 17:03:31 : WDG: T-1 SL0 FL127 FT3 FA0 FTP180 FLR806BBF9 FICSR
2021/4/21 17:03:21 : 4196355 MM0 MC0 IE2048 IEC1 TN:Ardu
2021/4/21 17:03:21 : WDG: T-1 SL0 FL127 FT3 FA0 FTP180 FLR806BBF9 FICSR
2021/4/21 17:03:11 : 4196355 MM0 MC0 IE2048 IEC1 TN:Ardu
2021/4/21 17:03:11 : WDG: T-1 SL0 FL127 FT3 FA0 FTP180 FLR806BBF9 FICSR

2 1980-1-1 8-00-00.bin (692 KB)

We can’t really help unless you can show us your patches.

At that baudrate it is almost certainly the case that you’ve misunderstood
SCHED_TASK - it doesn’t create a separate thread, it runs that function on
the main thread and it must return.