1: My Harmony OS PAD send cmd to ESP32S3(as HOS pad as udp client to esp32 as udp master.):
I (523755) WIFI: PagePara=0x06EAFF00,len=19
and then esp32s3 will decode as [0x06 0xEA 0xFF 0x00 ]
stm32 will send Request for this data from HOS pad.
Received: [ FE 03 00 C8 00 02 51 FA ]
esp32 will reply stm32 with following data:
Reply: [ FE 03 04 06 EA FF 00 95 B0 ]
so : stm32 will reponse following data :
Received:[ FE 10 00 EA 00 06 0C 00 02 0A 0D 00 00 00 19 00 07 00 4F 7F 07 ]
to keep udp alive, pad will send WF=? to esp32.
I (525355) WIFI: WF=?,len=4
and esp32 will response WF=OK
Generally, this request and response will keep about 5 turns , then system will be crashed due to watchdog triggerd problems.
Please kindly advise , thanks a lot.
the cash log details as following:
- I (523755) WIFI: PagePara=0x06EAFF00,len=19
- [0x06 0xEA 0xFF 0x00 ]
- [udp_socket]:CmdNo=7
- Received:[ FE 03 00 C8 00 02 51 FA ]
- Reply:[ FE 03 04 06 EA FF 00 95 B0 ]
- Received:[ FE 10 00 EA 00 06 0C 00 02 0A 0D 00 00 00 19 00 07 00 4F 7F 07 ]
- I (524755) WIFI: Received 19 bytes from 192.168.4.2:
- I (524755) WIFI:
- Reply:[ FE 10 00 EA 00 06 75 F0 00 ]
- Received:[ FE 10 00 EA 00 06 0C 00 02 0A 49 00 00 00 19 00 07 00 4E BD C4 ]
- I (525355) WIFI: WF=?,len=4
- WF=OK
- I (525355) WIFI: Received 4 bytes from 192.168.4.2:
- I (525355) WIFI:
- Reply:[ FE 10 00 EA 00 06 75 F0 00 ]
- Received:[ FE 10 00 EA 00 06 0C 00 02 0A 67 00 00 00 19 00 07 00 4D 28 64 FE 10 00 EA 00 06 0C 00 02 0A A3 00 00 00 19 00 08 00 50 BA AB ]
- Reply:[ FE 10 00 EA 00 06 75 F0 00 ]
- Received:[ FE 10 00 EA 00 06 0C 00 02 0A C1 00 00 00 19 00 07 00 4F 7A 02 FE 10 00 EA 00 06 0C 00 02 0A F3 00 00 00 19 00 07 00 4D B6 A2 ]
- I (528065) WIFI: WF=?,len=4
- WF=OK
- I (528065) WIFI: Received 4 bytes from 192.168.4.2:
- I (528065) WIFI:
- Reply:[ FE 10 00 EA 00 06 75 F0 00 ]
- Received:[ FE 10 00 EA 00 06 0C 00 02 0B 1B 00 00 00 19 00 07 00 4E 09 62 FE 10 00 EA 00 06 0C 00 02 0B 4D 00 00 00 19 00 07 00 4F 1F 01 ]
- E (529155) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
- E (529155) task_wdt: - IDLE1 (CPU 1)
- E (529155) task_wdt: Tasks currently running:
- E (529155) task_wdt: CPU 0: IDLE0
- E (529155) task_wdt: CPU 1: IDLE1
- E (529155) task_wdt: Print CPU 1 backtrace
- ;Bamk r5c9150x t3skBwE:0 TFskBwBtc0do0377t39r0ggFCed3 0 ex4o3lA78ng0taskA/DC0 0xd2d0no6 r0x3FCthD 0 txhd3gEin5tixe:C[5E0 252015FCA5E2k_
- dt: - IDLE0 (CPU 0)
- E (529155) task_wdt: Tasks currently running:
- E (529155) task_wdt: CPU 0: IDLE0
- E (529155) task_wdt: CPU 1: IDLE1
- E (529155) task_wdt: Print CPU 0 (current core) backtrace
- Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
- 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
- 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
- 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
- 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
- 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
- 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
- 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
- E (529155) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
- E (529155) task_wdt: - IDLE0 (CPU 0)
- E (529155) task_wdt: Tasks currently running:
- E (529155) task_wdt: CPU 0: IDLE0
- E (529155) task_wdt: CPU 1: IDLE1
- E (529155) task_wdt: Print CPU 0 (current core) backtrace
- Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
- 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
- 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
- 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
- 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
- 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
- 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
- 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
- E (529155) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
- E (529155) task_wdt: - IDLE0 (CPU 0)
- E (529155) task_wdt: Tasks currently running:
- E (529155) task_wdt: CPU 0: IDLE0
- E (529155) task_wdt: CPU 1: IDLE1
- E (529155) task_wdt: Print CPU 0 (current core) backtrace
- Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
- 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
- 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
- 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
- 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
- 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
- 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
- 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
- E (529155) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
- E (529155) task_wdt: - IDLE0 (CPU 0)
- E (529155) task_wdt: Tasks currently running:
- E (529155) task_wdt: CPU 0: IDLE0
- E (529155) task_wdt: CPU 1: IDLE1
- E (529155) task_wdt: Print CPU 0 (current core) backtrace
- Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
- 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
- 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
- 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
- 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
- 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
- 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
- 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
- E (529155) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
- E (529155) task_wdt: - IDLE0 (CPU 0)
- E (529155) task_wdt: Tasks currently running:
- E (529155) task_wdt: CPU 0: IDLE0
- E (529155) task_wdt: CPU 1: IDLE1
- E (529155) task_wdt: Print CPU 0 (current core) backtrace
- Backtrace: 0x420115FB:0x3FC9AD80 0x42011A18:0x3FC9ADA0 0x40377639:0x3FC9ADD0 0x42011A18:0x3FCA5660 0x42003E6E:0x3FCA5680 0x4037EC35:0x3FCA56A0 0x4037DA25:0x3FCA56C0
- 0x420115fb: task_wdt_timeout_handling at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
- 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
- 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
- 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
- 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
- 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
- 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
- E (529155) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
- E (529155) task_wdt: - IDLE0 (CPU 0)
- E (529155) task_wdt: Tasks currently running:
- E (529155) task_wdt: CPU 0: IDLE0
- E (529155) task_wdt: CPU 1: IDLEGuru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0).
- Core 0 register dump:
- PC : 0x4004883b PS : 0x00060734 A0 : 0x80048c6c A1 : 0x3fc9ac50
- 0x4004883b: uart_tx_one_char_uart in ROM
- A2 : 0xe080c000 A3 : 0x00000031 A4 : 0x00000000 A5 : 0x00000000
- A6 : 0x00000004 A7 : 0xffffffff A8 : 0x60000000 A9 : 0x00000380
- A10 : 0x00000031 A11 : 0x6000001c A12 : 0x3fcef130 A13 : 0x3fc9add0
- A14 : 0x00000000 A15 : 0x3fc990b8 SAR : 0x00000004 EXCCAUSE: 0x00000005
- EXCVADDR: 0x00000000 LBEG : 0x40056f5c LEND : 0x40056f72 LCOUNT : 0x00000000
- 0x40056f5c: memcpy in ROM
- 0x40056f72: memcpy in ROM
- Core 0 was running in ISR context:
- EPC1 : 0x4207f8ab EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x4004883b
- 0x4207f8ab: uart_hal_write_txfifo at D:/ESP/idf/v5.2.1/esp-idf/components/hal/uart_hal_iram.c:27
- 0x4004883b: uart_tx_one_char_uart in ROM
- Backtrace: 0x40048838:0x3fc9ac50 0x40048c69:0x3fc9ac70 0x40043d03:0x3fc9ac90 0x40043cd5:0x3fc9acb0 0x40044131:0x3fc9acd0 0x40044281:0x3fc9ad50 0x420119e3:0x3fc9ada0 0x40377639:0x3fc9add0 0x42011a18:0x3fca5660 0x42003e6e:0x3fca5680 0x4037ec35:0x3fca56a0 0x4037da25:0x3fca56c0
- 0x40048838: uart_tx_one_char_uart in ROM
- 0x40048c69: uart_tx_one_char in ROM
- 0x40043d03: ets_write_char_uart in ROM
- 0x40043cd5: ets_write_char in ROM
- 0x40044131: ets_vprintf in ROM
- 0x40044281: ets_printf in ROM
- 0x420119e3: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:499 (discriminator 3)
- 0x40377639: _xt_lowint1 at D:/ESP/idf/v5.2.1/esp-idf/components/xtensa/xtensa_vectors.S:1240
- 0x42011a18: task_wdt_isr at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
- 0x42003e6e: esp_vApplicationIdleHook at D:/ESP/idf/v5.2.1/esp-idf/components/esp_system/freertos_hooks.c:59
- 0x4037ec35: prvIdleTask at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4273 (discriminator 1)
- 0x4037da25: vPortTaskWrapper at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
- Core 1 register dump:
- PC : 0x4037dc77 PS : 0x00060934 A0 : 0x82011820 A1 : 0x3fca5d50
- 0x4037dc77: spinlock_acquire at D:/ESP/idf/v5.2.1/esp-idf/components/esp_hw_support/include/spinlock.h:130
- (inlined by) xPortEnterCriticalTimeout at D:/ESP/idf/v5.2.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:473
- A2 : 0x3fc99504 A3 : 0xffffffff A4 : 0xb65694b3 A5 : 0x00060923
- A6 : 0xb33fffff A7 : 0x0000abab A8 : 0x8037dc80 A9 : 0x3fca5d30
- A10 : 0x00000000 A11 : 0xb33f3232 A12 : 0x0000abab A13 : 0x3fc9b350
- A14 : 0x3fc98da8 A15 : 0xffffffff SAR : 0x00000000 EXCCAUSE: 0x00000005
- EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
- static void modbus_decode_10(uint8_t *data,int len)
- {
- uint8_t send[10]={0};
- regAdd=data[2]<<8|data[3];
- regNum=data[4]<<8|data[5];
- if(data[6]==2*data[5])
- {
- crcRec=data[8+data[6]]<<8|data[7+data[6]];
- crcCal=usMBCRC16(data,7+data[6]);
- if(crcRec==crcCal)
- {
- if(regNum==data[5]&&data[6]==regNum)
- {
- for(uint8_t i=0;i<regNum;i++)
- {
- paramData[regAdd+i]=data[7+i];
- }
- send[0]=0xfe;
- send[1]=0x10;
- send[2]=regAdd>>8;
- send[3]=regAdd&0xFF;
- send[4]=regNum>>8;
- send[5]=regNum&0xFF;
- crcCal=usMBCRC16(send,6);
- send[6]=crcCal&0xFF;
- send[7]=crcCal>>8;
- uint16_t bufferSize=100;
- float temp;
- size_t offset = 0;
- switch (regAdd)
- {
- case 0:
- break;
- case 0x14:
- break;
- case 0x28:
- break;
- case 0x40:
- break;
- case 0xE0:
- case 0xE6:
- case 0xE8:
- temp = (float)((uint16_t)(data[7]<<24|data[8]<<16|data[9]<<8|data[10])/10000000.0);
- offset = snprintf(UartQ.buf + offset, bufferSize - offset, "Cur_C=%.4f&",temp);
- temp = (float)((uint32_t)(data[11]<<24|data[12]<<16|data[13]<<8|data[14])/10000000.0);
- offset += snprintf(UartQ.buf + offset, bufferSize - offset, "Cur_A=%.4f",temp);
- UartQ.len=offset;
- xQueueSend(udpQueue,&UartQ,300);
- break;
- case 0xEA:
- temp = (float)((uint32_t)(data[7]<<24|data[8]<<16|data[9]<<8|data[10])/10000000.0);
- offset = snprintf(UartQ.buf + offset, bufferSize - offset, "Cur_A=%.8f&",temp);
- temp = (float)((uint32_t)(data[11]<<24|data[12]<<16|data[13]<<8|data[14])/10000000.0);
- offset += snprintf(UartQ.buf + offset, bufferSize - offset, "Cu_A=%.8f&",temp);
- temp = (float)((uint16_t)(data[15]<<8|data[16])/10.0);
- offset += snprintf(UartQ.buf + offset, bufferSize - offset, "LoadValt=%.2f&",temp);
- temp = (float)((uint16_t)(data[17]<<8|data[18]));
- offset += snprintf(UartQ.buf + offset, bufferSize - offset, "LoadCur%.1f",temp);
- UartQ.len=offset;
- xQueueSend(udpQueue,&UartQ,300);
- break;
- case 0xEE:
- case 0xC8:
- break;
- }
- printf("Reply:[ ");
- for (int i = 0; i < 8; i++)
- {
- printf("%.2X ", (uint8_t)send[i]);
- }
- printf("]\n\r");
- set_Wait_time(1);
- uart_write_bytes(uart_num, send, 8);
- memset(data,0,BUF_SIZE);
- }
- }
- }
- }